Diverse Routing Algorithms CSCECE 772 Survivable Networks Spring
Diverse Routing Algorithms CSC/ECE 772: Survivable Networks Spring, 2009, Rudra Dutta Copyright Rudra Dutta, NCSU, Spring, 2009
Disjoint Paths Algorithms Simple approach (two-step) fails with trap topologies l Remedy - “remember” first path found by link reversal l – As in flow problems Must be able to find shortest paths in presence of negative-cost arcs l Remedy - modify Dijkstra’s algorithm l Can also use general purpose shortest path algorithm for negative-cost arcs – Can also use graph transformation to eliminate negative-cost arcs – Copyright Rudra Dutta, NCSU, Spring, 2009 2
Dijkstra’s Algorithm l Given: Undirected graph G with vertices V, – Source node A, – Destination node Z – Edge costs l(ij) – l Use: N(i) = set of neighbors of i, – d(i) = distance from A to i, – S = set of nodes to which shortest distance has NOT been found, – P(i) = predecessor of i in path from A – Copyright Rudra Dutta, NCSU, Spring, 2009 3
l(ij) cost of edge ij Dijkstra’s Algorithm 1. Initialize N(i) = neighbors of i d(i) = distance A to i S = nodes not found P(i) = predecessor of i d(A) = 0; d(i) = l(Ai) for all i in N(A), for all other i 1. S = all vertices except A 2. P(i) = A for all i in S l l Select new vertex to label permanently Choose j from S such that d(j) = min d(i), for i in S 1. Remove j from S 2. If j = Z, then stop; otherwise go to Step 3 l l Update distances l For all i in N(j) such that i is also in S l l If d(j) + l(ij) < d(i), update d(i) to d(j) + l(ij) and set P(i) to j Back to Step 2 Copyright Rudra Dutta, NCSU, Spring, 2009 4
Dijkstra’s Algorithm - Example Copyright Rudra Dutta, NCSU, Spring, 2009 5
Negative Cost Arcs Many reasonable cost metrics are positive-only l However, sometimes negatives costs can turn up l – l Sometimes introduced by specific desired transformations of graphs Graph may have cycles – Cycles with negative total costs exist l – Concept of shortest path? If negative cost arcs, but not cycles? Specific family of such graphs generated by useful diverse routing algorithms l Dijkstra’s algorithm fails with negative arc costs l Copyright Rudra Dutta, NCSU, Spring, 2009 6
Failure of Dijkstra - Example Copyright Rudra Dutta, NCSU, Spring, 2009 7
l(ij) cost of edge ij Dijkstra’s Algorithm - Modified 1. Initialize N(i) = neighbors of i d(i) = distance A to i S = nodes not found P(i) = predecessor of i d(A) = 0; d(i) = l(Ai) for all i in N(A), for all other i 1. S = all vertices except A 2. P(i) = A for all i in S l l Select new vertex to label permanently Choose j from S such that d(j) = min d(i), for i in S 1. Remove j from S = Z, then stop; otherwise go to Step 3 2. If S j= l l Update distances l For all i in N(j) --------------such that i is also in S If d(j) + l(ij) < d(i), update d(i) to d(j) + l(ij) and set P(i) to j 1. Also add i back to S l l Back to Step 2 Copyright Rudra Dutta, NCSU, Spring, 2009 8
Modified Dijkstra - Example Copyright Rudra Dutta, NCSU, Spring, 2009 9
Shortest Disjoint Path Pair l Objective: find a pair of paths between a source a destination that are: Edge-disjoint, or Vertex-disjoint – Sum of their lengths is minimum – l Observations: Vertex-disjointness implies edge-disjointedness – For graph of vertices with degrees 3 or less: Edge-disjointedness implies Vertex-disjointedness – l Length of vertex-disjoint pair ≥ length of edgedisjoint pair Copyright Rudra Dutta, NCSU, Spring, 2009 10
Simple Two-step Approach Fails l Obvious approach - find one, then other May not find shortest pair – May not find pair at all even when one exists – Trap topology – B 1 2 D 1 A 1 1 Z C 1 2 E Copyright Rudra Dutta, NCSU, Spring, 2009 11
Shortest Disjoint Path Algorithms l Various types Most based on flow canceling approaches (like flow maximization) – One early approach by Bhandari – Other early approach by Suurballe (and with Tarjan) – l Bhandari’s algorithm – – – Simpler to state on undirected graphs Assumes original graph has non-negative edge costs Creates intermediate mixed graphs with negative directed arc costs Only specific family of such graphs - arcs form s-d path Modified Dijkstra’s algorithm works correctly on such graphs Can be used in lieu of more complicated negative cost algorithms Copyright Rudra Dutta, NCSU, Spring, 2009 12
Bhandari’s Algorithm 1. 2. 3. 4. 5. 6. Find the shortest path from A to Z with the modified Dijkstra algorithm Replace each edge of the shortest path by a single arc directed towards the source vertex Make the length of each of the above arcs negative Find the shortest path from A to Z in the modified graph with the modified Dijkstra algorithm Transform to the original graph, and erase any interlacing edges of the two paths found Group the remaining edges to obtain the shortest pair of edge-disjoint paths Copyright Rudra Dutta, NCSU, Spring, 2009 13
Bhandari’s Algorithm - Example Copyright Rudra Dutta, NCSU, Spring, 2009 14
k Disjoint Paths Can be generalized to obtain more disjoint paths l Edge-disjoint shortest triplet algorithm: l 1. 2. 3. 4. 5. l Find the shortest edge-disjoint pair of paths between A and Z Replace the edges of the disjoint paths by arcs directed towards the source Make the length of the arcs negative Find the shortest path from A to Z in the modified graph using the modified Dijkstra algorithm Transform to the original graph, and erase any edges of this shortest path interlacing with the shortest edge-disjoint pair of paths Straightforward generalization to k > 3 Copyright Rudra Dutta, NCSU, Spring, 2009 15
Edge Disjoint Triple - Example Copyright Rudra Dutta, NCSU, Spring, 2009 16
Vertex Disjoint Paths Builds on the edge disjoint path algorithm l Simple graph transformation l Separate “source” nature of “destination” nature of each vertex into two fictitious vertices – Directed arc from “destination” to “source” for each, zero cost – Path, flow etc. preserved in magnitude and cost – Use of fictitious vertices/arcs can be limited to “as needed” basis l Edge disjoint paths in transformed graph are clearly vertex disjoint in original l Can be generalized to k > 2 as before l Copyright Rudra Dutta, NCSU, Spring, 2009 17
Vertex Disjoint Pair Algorithm 1. 2. 3. Find the shortest path from A to Z with the modified Dijkstra algorithm Replace each edge on the shortest path by an arc directed towards the destination vertex Split each vertex on the shortest path into two co-located subvertices joined by an arc of length zero – – – 4. 5. 6. direct the arc of length zero towards the destination replace each external edge connected to a vertex on the shortest path by its two component arcs (of the same length) let one arc terminate on one subvertex, the other emanate from the other subvertex - forming cycle along zero-length arc Reverse the direction of the arcs on the shortest path, and make their length negative Find the shortest path from A to Z in the modified graph with the modified Dijkstra algorithm Remove zero-length arcs; coalesce subvertices into parent vertices; replace arcs on first shortest path with original edges of positive length; remove interlacing edges of the two paths Copyright Rudra Dutta, NCSU, Spring, 2009 18
Vertex Disjoint Pair - Example Copyright Rudra Dutta, NCSU, Spring, 2009 19
Use for Multiple Source/Destinations Z 1 A Z A Z 2 A 1 Z A Z 2 Z 1 Z A A 2 Copyright Rudra Dutta, NCSU, Spring, 2009 Z 1 Z 2 20
- Slides: 20