Solution to HW1. Problem 1 Need to find shortest path from a single source s to a single destination d. Have a condition in the Dijkstra algo loop which.

Slides:



Advertisements
Similar presentations
The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Advertisements

Lecture 15. Graph Algorithms
Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
O(N 1.5 ) divide-and-conquer technique for Minimum Spanning Tree problem Step 1: Divide the graph into  N sub-graph by clustering. Step 2: Solve each.
Greed is good. (Some of the time)
Chapter 3 The Greedy Method 3.
HW2 Solutions. Problem 1 Construct a bipartite graph where, every family represents a vertex in one partition, and table represents a vertex in another.
CS 311 Graph Algorithms. Definitions A Graph G = (V, E) where V is a set of vertices and E is a set of edges, An edge is a pair (u,v) where u,v  V. If.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
CSE 421 Algorithms Richard Anderson Dijkstra’s algorithm.
Lecture 3. Preview of Markov Process A sequence of random variables X 1, X 2,….,X n,….. such that –X i+1 is independent of X 1,….X i-1 given X i –Pr(X.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Lecture 5 Group Communication. Point to Multipoint Communication Single source, Multiple Destinations Broadcast – All nodes in the network are destinations.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Lecture 12 Minimum Spanning Tree. Motivating Example: Point to Multipoint Communication Single source, Multiple Destinations Broadcast – All nodes in.
TCOM 501: Networking Theory & Fundamentals
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
DAST 2005 Tirgul 12 (and more) sample questions. DAST 2005 Q.We’ve seen that solving the shortest paths problem requires O(VE) time using the Belman-Ford.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Minimum Spanning Trees What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
Social Media Mining Graph Essentials.
The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each decision is locally optimal. These.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
COSC 2007 Data Structures II Chapter 14 Graphs III.
UNC Chapel Hill Lin/Foskey/Manocha Minimum Spanning Trees Problem: Connect a set of nodes by a network of minimal total length Some applications: –Communication.
© 2015 JW Ryder CSCI 203 Data Structures1. © 2015 JW Ryder CSCI 203 Data Structures2.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
TCP Traffic and Congestion Control in ATM Networks
Network and Communications Ju Wang Chapter 5 Routing Algorithm Adopted from Choi’s notes Virginia Commonwealth University.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Introduction to Graph Theory
Most of contents are provided by the website Graph Essentials TJTSD66: Advanced Topics in Social Media.
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
Homework 1 Problem 1: (5 points) Both Dijkstras algorihm and Bellmanford Algorithm generates shortest paths to all destinations. Modify the algorithm to.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
1 GRAPHS – Definitions A graph G = (V, E) consists of –a set of vertices, V, and –a set of edges, E, where each edge is a pair (v,w) s.t. v,w  V Vertices.
1 Data Structures and Algorithms Graphs. 2 Graphs Basic Definitions Paths and Cycles Connectivity Other Properties Representation Examples of Graph Algorithms:
Graph Search Applications, Minimum Spanning Tree
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Greedy Technique.
Minimum Spanning Trees
Lecture 12 Algorithm Analysis
1.3 Modeling with exponentially many constr.
Graph Algorithm.
Minimum Spanning Tree.
Minimum Spanning Tree Neil Tang 3/25/2010
Graph Algorithm.
CSE 373 Data Structures and Algorithms
Graph Operations And Representation
Connectivity Section 10.4.
Chapter 11 Graphs.
Autumn 2015 Lecture 10 Minimum Spanning Trees
Minimum Spanning Tree Algorithms
Minimum Spanning Tree.
Text Book: Introduction to algorithms By C L R S
Autumn 2016 Lecture 10 Minimum Spanning Trees
Lecture 19 Linear Program
Lecture 12 Algorithm Analysis
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Winter 2019 Lecture 10 Minimum Spanning Trees
Chapter 9 Graph algorithms
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Solution to HW1

Problem 1 Need to find shortest path from a single source s to a single destination d. Have a condition in the Dijkstra algo loop which terminates the process whenever v is inducted into the set S.

Problem 2 Whenever some node v is inducted into S such that d(v) = , then we know the graph is disconnected. When a vertex v is inducted into S, d(v) is the shortest distance from s to v. If this shortest distance is infinity, then s is disconnected to v.

Problem 3 All answers were correct!

Problem 4 Given a graph, construct a new graph with same nodes and edges, weight of an edge = negative of weight of the corresponding edge in the given graph. Minimum spanning tree in this new graph is maximum weight spanning tree in the old one.

Problem 5 MST s are identical if a  0, otherwise they may be different (two MSTs have same number of edges). Shortest paths are identical if a  0 and b=0. Yes, with reciprocal edge weights, minimum weight spanning tree becomes maximum weight spanning tree.

Now the light weight edge crossing a cut in one is the heavy weight edge crossing the cut. By choosing the heavy weight one we get maximum weight spanning tree. By choosing the light weight one we get minimum weight spanning tree. The same sequence of choices in Kruskals leads to minimum spanning tree in one and max. spanning tree in another. So, minimum spanning tree in one is identical to the maximum spanning tree in another.

Problem 6 We know all the vertices in the Steiner tree given the intermediate ones. Need to find a minimum spanning tree in the induces subgraph.

Problem 7 No. All counter examples were valid!

Problem 8 The system can be represented with the queue lengths of different sessions in different buffers. The state process is a markov chain. Let the current state of the markov chain be (…..B i1 (t), B i2 (t),….. ) There is a positive probability of 0 arrival in this state If there is no arrival, then it moves to a state where total number of packets in the system is lesser, or equal but packets have moved closer to the destination.

Given a particular state, there is a finite time such that if there is no arrival in any slot in that time interval, then the system moves to all zero state. Given any finite number of slots, there is a positive probability that the number of arrivals is 0 in each of these slots. There is a positive probability path from each state to the all zero state. Every state communicates to the all zero state.

All zero state communicates to some states. All states which have positive probability path from the zero state, communicate with each other, and does not communicate to any state which does not have a positive probability path from the all zero state. All states which have positive probability path from the zero state constitute a closed set (along with the all zero state). All other states communicate to the zero state, and the zero state does not communicate to them. So all other states are open.

Problem 9 Sort all the reward values. (1)Remove all edges with reward value less than R R = highest reward value. Find whether source is connected to the destination. If so, stop. If not, reduce R to the next highest reward value and go to step (1) The final value of R is the highest reward and the final path is the highest reward path.

Complexity is O(E 2 ) Can do a binary search on the reward values, complexity will be O(ElogE)

Problem 10 Unirate Multicast The feasible set looks like r i + r j + ….. r p  C l (constraint for link l) ………………. ……………………….. For every link constraint, create a link in the new unicast network, with all sessions appearing in the constraint traversing the link. The capacity of this link is the same as the capacity of the link in the constraint.

Consider any session i. Join all the links traversed by session i by links of very high capacity. Every session is unicast in this network. The number of sessions is the same in both networks. The number of links are N(L + 1) in the new network. The feasibility constraints are identical in both links. Hence, the feasible sets are identical.

Multirate Multicast Network The constraints are max(r i, r j, ….. r p ) + max(…..) + ….  C l Replace each constraint by linear constraints. Consider an example: max(r 1, r 2 ) + r 3  C l The equivalent linear constraints are: r 1 + r 3  C l, r 2 + r 3  C l

Consider an example: max(r 1, r 2 ) + max(r 3, r 4 )  C l The equivalent constraints are: r 1 + r 3  C l, r 2 + r 3  C l r 1 + r 4  C l, r 2 + r 4  C l If there are L links in the network, there can be at most m N L linear constraints, where m is the maximum number of receivers in the network, and N is the number of sessions.

These constraints are of the form r i + r j + ….. r p  C l And involve r 1, r 2, ….. r M Proceeding in the same manner as for unirate multicast, we can now get a unicast network of M sessions, m N L(M + 1) links. A multirate, multicast can be reduced to unicast network, but the unicast network has exponentially larger size!