Rudra Dutta CSC 453-001, Fall, 2012 A Simple Sensing Program Structure.
Diverse Routing Algorithms CSC/ECE 772: Survivable Networks Spring, 2009, Rudra Dutta.
-
Upload
briana-berry -
Category
Documents
-
view
217 -
download
0
Transcript of Diverse Routing Algorithms CSC/ECE 772: Survivable Networks Spring, 2009, Rudra Dutta.
Diverse Routing AlgorithmsDiverse Routing Algorithms
CSC/ECE 772: Survivable Networks
Spring, 2009, Rudra Dutta
Copyright Rudra Dutta, NCSU, Spring, 2009 2
Disjoint Paths AlgorithmsDisjoint Paths Algorithms Simple approach (two-step) fails with trap
topologies Remedy - “remember” first path found by link
reversal– As in flow problems
Must be able to find shortest paths in presence of negative-cost arcs
Remedy - modify Dijkstra’s algorithm– 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 3
Dijkstra’s AlgorithmDijkstra’s Algorithm Given:
– Undirected graph G with vertices V,– Source node A,– Destination node Z– Edge costs l(ij)
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 4
Dijkstra’s AlgorithmDijkstra’s Algorithm1. Initialize
d(A) = 0; d(i) = l(Ai) for all i in N(A), for all other i S = all vertices except A P(i) = A for all i in S
l Select new vertex to label permanently Choose j from S such that d(j) = min d(i), for i in S Remove j from S If j = Z, then stop; otherwise go to Step 3
l Update distances 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 Back to Step 2
l(ij) cost of edge ij
N(i) = neighbors of i
d(i) = distance A to i
S = nodes not found
P(i) = predecessor of i
Copyright Rudra Dutta, NCSU, Spring, 2009 5
Dijkstra’s Algorithm - ExampleDijkstra’s Algorithm - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 6
Negative Cost ArcsNegative Cost Arcs Many reasonable cost metrics are positive-only However, sometimes negatives costs can turn
up– Sometimes introduced by specific desired
transformations of graphs Graph may have cycles
– Cycles with negative total costs existConcept of shortest path?
– If negative cost arcs, but not cycles? Specific family of such graphs generated by
useful diverse routing algorithms Dijkstra’s algorithm fails with negative arc costs
Copyright Rudra Dutta, NCSU, Spring, 2009 7
Failure of Dijkstra - ExampleFailure of Dijkstra - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 8
Dijkstra’s Algorithm - ModifiedDijkstra’s Algorithm - Modified1. Initialize
d(A) = 0; d(i) = l(Ai) for all i in N(A), for all other i S = all vertices except A P(i) = A for all i in S
l Select new vertex to label permanently Choose j from S such that d(j) = min d(i), for i in S Remove j from S If j = Z, then stop; otherwise go to Step 3
l Update distances 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
Back to Step 2
-----------------------------
Also add i back to S
S =
l(ij) cost of edge ij
N(i) = neighbors of i
d(i) = distance A to i
S = nodes not found
P(i) = predecessor of i
Copyright Rudra Dutta, NCSU, Spring, 2009 9
Modified Dijkstra - ExampleModified Dijkstra - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 10
Shortest Disjoint Path PairShortest Disjoint Path Pair Objective: find a pair of paths between a source
a destination that are:– Edge-disjoint, or Vertex-disjoint– Sum of their lengths is minimum
Observations:– Vertex-disjointness implies edge-disjointedness– For graph of vertices with degrees 3 or less:
Edge-disjointedness implies Vertex-disjointedness
Length of vertex-disjoint pair ≥ length of edge-disjoint pair
Copyright Rudra Dutta, NCSU, Spring, 2009 11
Simple Two-step Approach FailsSimple Two-step Approach Fails Obvious approach - find one, then other
– May not find shortest pair– May not find pair at all even when one exists– Trap topology
A
B
D
Z
E
C
1 1 1
1
12
2
Copyright Rudra Dutta, NCSU, Spring, 2009 12
Shortest Disjoint Path AlgorithmsShortest Disjoint Path Algorithms Various types
– Most based on flow canceling approaches (like flow maximization)
– One early approach by Bhandari– Other early approach by Suurballe (and with Tarjan)
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 13
Bhandari’s AlgorithmBhandari’s Algorithm1. Find the shortest path from A to Z with the modified
Dijkstra algorithm
2. Replace each edge of the shortest path by a single arc directed towards the source vertex
3. Make the length of each of the above arcs negative
4. Find the shortest path from A to Z in the modified graph with the modified Dijkstra algorithm
5. Transform to the original graph, and erase any interlacing edges of the two paths found
6. Group the remaining edges to obtain the shortest pair of edge-disjoint paths
Copyright Rudra Dutta, NCSU, Spring, 2009 14
Bhandari’s Algorithm - ExampleBhandari’s Algorithm - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 15
kk Disjoint Paths Disjoint Paths Can be generalized to obtain more disjoint paths Edge-disjoint shortest triplet algorithm:
1. Find the shortest edge-disjoint pair of paths between A and Z
2. Replace the edges of the disjoint paths by arcs directed towards the source
3. Make the length of the arcs negative
4. Find the shortest path from A to Z in the modified graph using the modified Dijkstra algorithm
5. 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 16
Edge Disjoint Triple - ExampleEdge Disjoint Triple - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 17
Vertex Disjoint PathsVertex Disjoint Paths Builds on the edge disjoint path algorithm Simple graph transformation
– 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 Edge disjoint paths in transformed graph are
clearly vertex disjoint in original Can be generalized to k > 2 as before
Copyright Rudra Dutta, NCSU, Spring, 2009 18
Vertex Disjoint Pair AlgorithmVertex Disjoint Pair Algorithm1. Find the shortest path from A to Z with the modified Dijkstra
algorithm2. Replace each edge on the shortest path by an arc directed towards
the destination vertex3. Split each vertex on the shortest path into two co-located subvertices
joined by an arc of length zero– 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
4. Reverse the direction of the arcs on the shortest path, and make their length negative
5. Find the shortest path from A to Z in the modified graph with the modified Dijkstra algorithm
6. 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 19
Vertex Disjoint Pair - ExampleVertex Disjoint Pair - Example
Copyright Rudra Dutta, NCSU, Spring, 2009 20
Use for Multiple Source/DestinationsUse for Multiple Source/Destinations
A
Z1
Z2
ZA
Z1
Z2
ZA
Z1
Z2
A1
A2
ZA
Z1
Z2
A1
A2