Presentation is loading. Please wait.

Presentation is loading. Please wait.

EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1.

Similar presentations


Presentation on theme: "EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1."— Presentation transcript:

1 EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1

2 Shortest-Path Property 4.1 If the path s, (s, v 1 ), v 1, (v 1, v 2 ), v 2, …, v k is a shortest path from s to k, then the subpath s, (s, v 1 ), v 1, (v 1, v 2 ), v 2, …, v i is a shortest path from s to i for i = 1, 2, 3, …, k-1. Subpaths of shortest paths are shortest paths. Slide 2

3 Proof of Prop. 4.1: Idea ski P1P1 P2P2 1) P 1 + P 2 is a shortest path from s to k P3P3 If P 3 is shorter than P 1, then the directed walk P 3 + P 2 contains a shorter path from s to k than P 1 + P 2. This contradicts statement 1. Slide 3

4 Proof of Prop. 4.1: Details ski P1P1 P2P2 Suppose that P 1 + P 2 is a shortest path from s to k, but P 1 is not a shortest path from s to i. P3P3 Let P 3 be a shortest path from s to i Case 1: P 2 and P 3 are node-disjoint Case 2: P 2 and P 3 have at least one node in common Slide 4

5 If P 1 is not a shortest path from s to node i and P 1 and P 3 are node-disjoint, then the path composed of P 3 followed by P 2 is a shorter path from s to k then the path composed of P 1 followed by P 2. This is a contradiction. Proof of Prop. 4.1: Case 1 ski P1P1 P2P2 P3P3 Case 1: P 2 and P 3 are node-disjoint Slide 5

6 Proof of Prop. 4.1: Case 2 ski P1P1 j P3P3 P 3 and P 2 have node j in common. P2P2 Slide 6

7 Proof of Prop. 4.1: Case 2 ski P4P4 j Slide 7

8 Proof by Contradiction We assume there are no negative cycles. Length (P 4 )  Length(P 3 + P 2 ). If P 3 is a shortest path from s to i, but P 1 is not then Length(P 3 + P 2 ) < Length(P 1 + P 2 ). Implies Length (P 4 ) < Length(P 1 + P 2 ). Implies P 1 + P 2 is not a shortest path from s to k which is a contradiction. Slide 8

9 Corollary to 4.1 Let d * be the vector of shortest path distances for a given network and source node s. Let P be a shortest path from s to node t.  d * (j) = d * (i) + c ij for every arc (i,j) in P Slide 9

10 Converse Property Suppose that d * (j) = d * (i) + c ij for every arc (i,j) on a path P from s to t. Claim: P is a shortest path from s to t. Slide 10

11 Example of Converse Property 1432 s t Slide 11 d * (1) = 0d * (4) = 6d * (2) = 10 d * (3) = 15 645 d * (4) = d * (1) + c 14 d * (2) = d * (4) + c 42 d * (3) = d * (2) + c 23 The converse property says that the path P = 1, (1, 4), 4, (4, 2), 2, (2, 3), 3 is a shortest path from 1 to 3.

12 Shortest-Path Property 4.2 Let d * be the vector of shortest path distances for a given network and source node s. The directed path P from s to node k is a shortest path if and only if d * (j) = d * (i) + c ij for every arc (i,j) in P. Slide 12

13 Optimality Condition for Shortest Path Trees Let d * be the vector of shortest path distances for a given network. The directed-out tree T rooted at s is a shortest path tree if and only if d * (j) = d * (i) + c ij for every arc (i,j) in T and d * (j)  d * (i) + c ij for every arc (i,j) not in T. Slide 13

14 A Shortest Path Tree 5 1 45 23 4 6   0 7  5 2 -2 7 1 6 2 1  3 6 5 7 8 Tree ArcNon-Tree Arc Slide 14

15 Correctness of the Reaching Algorithm Proof by induction. Clearly, the algorithm assigns the correct label to node 1 (d(1) = 0). Since the nodes are visited according to the T.O., d(2) = d(1) + c 12. Since d(1) = 0 = d * (1), d(2) = d * (1) + c 12. Thus, by property 4.2 d(2) = d * (2). After the algorithm scans node 2, d(3) is either equal to d(1)+c 13 or d(2)+c 12. In the first case d(3) = d * (1) + c 13 and in the second case d(3) = d * (2) + c 23. Either way, d(3) = d * (3) by property 4.2. Slide 15

16 Correctness of d(1), d(2), and d(3): Case 1 123  0   d(3)=d * (2)+c 23 d(2) = c 12 = d * (1)+c 12 d(2)=d * (2) d(3)=d * (3) Slide 16

17 Correctness of d(1), d(2), and d(3): Case 2 1 2 3  0  d(3) = d * (1) + c 13 d(2) = c 12 = d * (1) + c 12 d(2) = d * (2) d(3) = d * (3) Slide 17

18 Inductive Step Claim: when the reaching algorithm scans node k, the label on node k is correct (i.e., d(k) = d * (k)). –We have established the base case by showing this is true for nodes 1, 2, and 3. –Inductive hypothesis : the labels for nodes 1, 2, …, k-1 are correct. –To complete the proof show that the label on node k is correct. Slide 18

19 A shortest path to node k n 1 =1n2n2 n3n3 nhnh k Let node 1 = n 1, (n 1,n 2 ), n 2, (n 2,n 3 ), n 3, …, n h, (n h,k), k be a shortest path to node k. By 4.1 n 1, (n 1,n 2 ), n 2, (n 2,n 3 ), n 3, …, n h is a shortest path to node n h. By 4.2, d * (k) = d * (n h ) + c n h,k Slide 19

20 A shortest path to node k By the induction hypothesis, d(n h ) = d * (n h ). Due to the T.O., node n h is scanned before node k. When the algorithm reaches n h it scans arc (n h,k) and sets the label on k to d * (n h ) + c n h,k Thus, the algorithm sets d(k) = d * (k). QED. Slide 20 n 1 =1n2n2 n3n3 nhnh k


Download ppt "EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1."

Similar presentations


Ads by Google