Title: Shortest-Path Property 4.1
1Shortest-Path Property 4.1
- If the path s -gt n1 -gt n2 -gt -gt nk is a
shortest path from s to k, then the subpath s -gt
n1 -gt n2 -gt -gt ni is a shortest path from s to
i for i 1, 2, 3, , k-1.
2Proof of Prop. 4.1 Idea
1) P1 P2 is a shortest path from s to k
P1
P2
s
k
i
If P3 is shorter than P1, then the directed walk
P3 P2 contains a shorter path from s to k than
P1 P2. Contradicts statement 1.
3Proof of Prop. 4.1 Details
Suppose P1 P2 is a shortest path from s to k,
but P1 is not a shortest path from s to i.
P1
P2
s
k
i
Case 1 P1 and P3 are node-disjoint Case 2 P1
and P3 have at least one node in common
4Proof of Prop. 4.1 Case 1
If P1 is not a shortest path from s to node i and
P1 and P3 are node-disjoint, then the path
composed of P3 followed by P2 is a shorter path
from s to k then the path composed of P1 followed
by P2. This is a contradiction.
P1
P2
s
k
i
Case 1 P1 and P3 are node-disjoint
5Proof of Prop. 4.1 Case 2
s
k
i
j
P3 and P2 pass have node j in common.
6Directed Path Contained in the Directed Walk P3
P2
s
k
i
P4
j
7Proof by Contradiction
- We assume there are no negative cycles.
- Length (P4) ? Length(P3 P2).
- If P3 is a shortest path from s to i, but P1 is
not then Length(P3 P2) lt Length(P1 P2). - Implies Length (P4) lt Length(P1 P2).
- Implies P1 P2 is not a shortest path from s to
k which is a contradiction.
8A shortest path from 1 to 5
From 4.1 d(2) c12 c12 0 c12 d(1)
d(3) d(2) c23
d(4) d(3) c34
d(5) d(4) c45
9Shortest Path Tree
7
6
7
5
?
2
4
5
7
1
1
6
2
?
9
8
0
1
6
5
2
3
4
-2
?
5
3
?
10Corollary 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 some node k.
- d(j) d(i) cij for every arc (i,j) in P
-
11Converse Property
- Suppose d(j) d(i) cij for every arc (i,j) on
a path P from s to t. - Claim
- P is a shortest path from s to t.
12A path where d(j) d(i) cij
Length of path c12 c23 c34 c45
d(2) d(1) c12 c12
d(3) d(2) c23 c12 c23
d(4) d(3) c34 c12 c23 c34
d(5) d(4) c45 c12 c23 c34 c45
Length of path d(5) (shortest path length)
13Shortest-Path Property 4.2
- Let d be the vector of shortest path distances
for a given network. - The directed path P from the source to node k is
a shortest path if and only if - d(j) d(i) cij for every arc (i,j) in P.
14Optimality 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) cij for every arc (i,j) in T and
- d(j) ? d(i) cij for every arc (i,j) not in T.
15Correctness of the Reaching Algorithm
- Proof by induction.
- Suppose the algorithm has reached node k-1 and
that the labels on nodes 1,2,,k-1 are optimal. - Show that when the algorithm reaches node k that
the label on node k is optimal.
16A shortest path to node k
By 4.1, the subpath to ni is a shortest path.
Since we have a T.O., ni lt k.
Inductive hypothesis the label on is ni is a
correct shortest path label.
When the algorithm reached ni it scanned
arc (ni,k) and set the label on k to d(ni)
c(ni,k) length of shortest path from s to node
k.