1 TCOM 5143 Telecommunications Analysis, Planning and Design Lecture 6 Network Design and Graph Theory: part 2 Shortest Path trees and Tours.

Slides:



Advertisements
Similar presentations
Weighted graphs Example Consider the following graph, where nodes represent cities, and edges show if there is a direct flight between each pair of cities.
Advertisements

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.
CP3397 Network Design and Security Lecture 4 WAN design - Principles and practice.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Data Structures Using C++
More Graph Algorithms Minimum Spanning Trees, Shortest Path Algorithms.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
Graph II MST, Shortest Path. Graph Terminology Node (vertex) Edge (arc) Directed graph, undirected graph Degree, in-degree, out-degree Subgraph Simple.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
1 Greedy 2 Jose Rolim University of Geneva. Algorithmique Greedy 2Jose Rolim2 Examples Greedy  Minimum Spanning Trees  Shortest Paths Dijkstra.
Directed Graph Algorithms CSE 373 Data Structures Lecture 14.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
TCOM 501: Networking Theory & Fundamentals
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
The Shortest Path Problem
Minimum Spanning Trees
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Shortest Path Algorithms. Kruskal’s Algorithm We construct a set of edges A satisfying the following invariant:  A is a subset of some MST We start with.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
Graph Theory Topics to be covered:
COSC 2007 Data Structures II Chapter 14 Graphs III.
Minimum Spanning Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
Shortest Path Problem Weight of the graph –Nonnegative real number assigned to the edges connecting to vertices Weighted graphs –When a graph.
Chapter 3 Graphs, Trees, and Tours Presented by Qibin Cai.
Slide 1 Chapter 9 Mesh Network Design - II. Slide 2 Mesh Network Design The design of backbone networks is governed by 3 goals: nDirect path between source.
Spanning Trees CSIT 402 Data Structures II 1. 2 Two Algorithms Prim: (build tree incrementally) – Pick lower cost edge connected to known (incomplete)
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.
Kruskal’s and Dijkstra’s Algorithm.  Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted.
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Most of contents are provided by the website Graph Essentials TJTSD66: Advanced Topics in Social Media.
TCOM 540/11 TCOM 540 Session 2. TCOM 540/12 Web Page OM htm.
CSC 213 – Large Scale Programming. Today’s Goals  Discuss what is meant by weighted graphs  Where weights placed within Graph  How to use Graph ’s.
Minimum Spanning Trees CSE 373 Data Structures Lecture 21.
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight)
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.
CSE 373: Data Structures and Algorithms Lecture 21: Graphs V 1.
Shortest Path -Prim’s -Djikstra’s. PRIM’s - Minimum Spanning Tree -A spanning tree of a graph is a tree that has all the vertices of the graph connected.
Graphs – Part III CS 367 – Introduction to Data Structures.
Graph Search Applications, Minimum Spanning Tree
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Greedy Technique.
Shortest Paths and Minimum Spanning Trees
Programming Abstractions
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Minimum Spanning Trees and Shortest Paths
Introduction to Graphs
Three Graph Algorithms
Graph Algorithm.
Minimum Spanning Tree.
Graph Algorithm.
Graphs & Graph Algorithms 2
Graphs Chapter 11 Objectives Upon completion you will be able to:
Minimum Spanning Trees
CSE 373 Data Structures and Algorithms
CSE 373: Data Structures and Algorithms
Chapter 9: Graphs Basic Concepts
Shortest Paths and Minimum Spanning Trees
Minimum Spanning Trees
Weighted Graphs & Shortest Paths
Dijkstra's Shortest Path Algorithm
CSE 373: Data Structures and Algorithms
Chapter 9: Graphs Basic Concepts
Graph Algorithm.
Presentation transcript:

1 TCOM 5143 Telecommunications Analysis, Planning and Design Lecture 6 Network Design and Graph Theory: part 2 Shortest Path trees and Tours

2 Definition: Shortest path: Given a weighted graph G(V,E); i.e., each edge has a weight W(e), and two nodes u and v, the shortest path from u to v is a path P from u to v such that the total weight of edges in the path P is minimum. Shortest paths have the following “optimal nest” property: Every subpath of a shortest path is a shortest path (between its own endvertices).

3 Definition: Shortest path Tree Given a weighted graph G(V,E) and a specified node r in the graph (called root node), a shortest-path (spanning) tree T is a spanning tree of G such that for all v  V, the unique path from r to v in T is a shortest path from r to v in G.

4 Dijkstra’s algorithm is a greedy algorithm that solves the shortest-path tree problem. In the Dijkstra’s algorithm, each node v will have two elements:  a label, denoted dist(v): this is a number that represents the shortest distance from the root r to that node v, and  a predecessor, denoted pred(v): this is the preceding node on the path from the root r to the node v in question.

5 Dijkstra’s algorithm: Step 1. Mark the root node r as scanned and set the label of the root r to zero and set its predecessor to itself. The root is the only node that is its own predecessor. Step 2. Mark all nodes except the root in the graph as unscanned and set their labels to . For each node v adjacent to the root, set the label of the node to the weight of edge between the root and the node; i.e, dist(v)=W(r,v). Set pred(v)=r.

6 Step 3. Repeat the following until all nodes are scanned:  Find the node v* with the smallest label. Mark this node as scanned.  For every node v adjacent to v*, check:  If dist(v*) + w(v*,v) < dist(v) then update the label of v as dist(v*) + w(v*,v) and set the predecessor of v to v*. Step 4. When the loop in step 3 finishes, we have the minimal shortest path tree rooted at r stored in pred format.

7 Notes: when the weights of all edges are positive, once a node is marked as scanned, then it need never be rescanned. If the label of a node changes, it must be rescanned.

8 Example: Find shortest paths from A to all other nodes in the graph below. 6 A B D E F C

9 Step 1 and 2: Scanned nodes: A Step 3: v* is C because C has the lowest label. Scan C. So, scanned nodes are A,C Label of B becomes 4 because 3+1 < 5. And Pred(B)=C. Label of D becomes 6 because 5+1 < . And Pred(D)=C. ,, A B D E F C ,A 5,A ,, 1,A ,, Label pred

10 Step 3: Scan B because it has the lowest label (4). So, scanned nodes are A,B,C. The label of D becomes 5 (=4+1). Pred(D)=B The label of E becomes 10 (=4+6). Pred(E)=B ,, A B D E F C ,A 4,C ,, 1,A6,C

11 Step 3: Scan D because it has the lowest label (5). So, the scanned nodes are A,B,C,D. Update the label of F as 9 (=5+4). And set pred(F)=D 10,B A B D E F C ,A 4,C ,, 1,A5,B

12 Step 3: Scan F because it has the lowest label 9. So, the scanned nodes are A,B,C,D,F.. Do we update the label of E? no, because 9+2 is not < ,B A B D E F C ,A 4,C 9,D 1,A5,B

13 Step 3: Scan E and we are done. The scanned nodes are A,B,C,D,E,F. 10,B A B D E F C ,A 4,C 9,D 1,A5,B

14 The final solution is: 10,B A B D E F C ,A 4,C 9,D 1,A5,B

15 The shortest path spanning tree for the example graph is therefore the following: The tree is made of the six nodes connected with the large, blue links. 10,B A B D E F C ,A 4,C 9,D 1,A5,B In Delite, we can run Dijkstra’s algorithm by invoking Prim-Dijkstra from Delite with  =1. (  is explained below.)

16 Comparing MSTs and SPTs: cost versus delay Recall that for the 20-node MST in figure 3.4 in Cahn textbook, the total link cost is $48,686/month, and its average delay over the network is The shortest-path spanning tree produced by Dijkstra’s algorithm in figure 3.7 in Cahn textbook is a star centered at the node N14. Its total link cost is $88,612/ month, and its average delay over the network is Note that in general the shortest-path spanning trees produced by Dijkstra’s algorithm are not stars.

17 Tradeoffs between Total Link Cost and If we compare MSTs and SPTs (Shortest path trees), we find that MSTs have optimal (lowest) cost, but high average number of hops for large graph; SPTs do not have optimal (lowest) cost, but they have reasonable average number of hops for all graphs.

18 Prim-Dijkstra Trees One way to to produce designs that are not as expensive as the SPTs or that are not associated with as high delays as the MSTs is to use the following labeling scheme in Dijkstra’s algorithm: Consider the scenario after the augmentation of the tree T (i.e., the vertex v has just been included), the update of label (u) for every neighbor u of v not in T is: Prim’slabel(u) = min {label(u), w(v, u)} Dijkstra’slabel(u) = min {label(u), label(v) + w(v, u)}.

19 Prim’slabel(u) = min {label(u), w(v, u)} Dijkstra’slabel(u) = min {label(u), label(v) + w(v, u)}. A unified labeling scheme is label(u) = min {label(u),  label(v) + w(v, u)}, where   [0, 1] is a parameter to yield the desired tradeoffs. For  = 0, the unified algorithm reduces to Prim’s algorithm for MSTs. For  = 1, the unified algorithm reduces to Dijkstra’s algorithm for shortest-path spanning trees.

20 Table 3.12 in Cahn textbook shows a range of tradeoffs for a 100-node tree design over a range of  -values in [0, 1].

21 Comparing Candidate Designs: Dominance Among Designs Goal: Select the best designs based the following factors: network cost and performance (i.e., delay, reliability). Definition: For two candidate designs D 1 and D 2 with cost-performance (C 1, P 1 ) and (C 2, P 2 ), respectively, we say that D 1 dominates D 2 when C 1 < C 2 and P 1 is better than P 2.

22 Notes: 1.The interpretation of “P 1 is better than P 2 ” depends on the context of performance: P 1 P 2 when P measures network reliability. 2.The dominance relation, denoted by <, on a set S of candidate designs, is irreflexive, i.e., for D  S, D is not dominated by D; anti-symmetric, i.e., for D 1, D 2  S, D 1 < D 2  D 2 is not < D 1 ; transitive, i.e., for D 1, D 2, D 3  S, D 1 < D 2 and D 2 < D 3  D 1 < D 3.

23 3.Two candidate designs D 1 and D 2 may not be comparable: D 1 is not < D 2 and D 2 is not < D 1, that is, D 1 and D 2 exhibit a tradeoff in cost and performance.

24 The following table shows the dominance among the designs for the 100-node Prim-Disjksta trees

25 We should discard candidate designs N0, N1, and N2 because they are dominated by other candidates. The remaining candidate designs are pairwise noncomparable candidate designs: They exhibit tradeoffs between cost and performance (delay). Each candidate can be used as a valid design.

26 One way to select among pairwise noncomparable candidate designs is use the marginal cost of performance defined as follows: