Edge relaxations
Dependencies:
-
Triangle inequality of shortest paths
Let be a weighted graph. Also assume that .
Let be a source vertex from which we wish to find the shortest path to every vertex.
Let be the weight of the shortest path from to .
Let and
be attributes that we will maintain for every vertex.
Initially, and .
Relaxation of the edge is the following operation:
If , set to and to .
It is easy to see that right after relaxing , .
When is undirected, relaxation of means relaxing in both the and directions.
Let where
and .
We will soon prove that ,
which is necessary and sufficient for to be a valid graph.
is a subgraph of , since
was relaxed .
Therefore, is called a predecessor subgraph of with source .
While relaxations are iteratively applied to , the following properties hold:
- Monotonicity: never increases with time.
- Upper-bound property: upper-bounds .
- Reachability: is not reachable from
by the upper-bound property.
- .
- .
Since is an upper-bound on ,
it is called the shortest-path-length estimate of .
Proof
Monotonicity
On relaxing , is the only vertex for which changes.
In an operation of the form 'if , set to ', cannot increase.
Therefore, cannot increase.
Therefore, for every vertex , cannot increase with time.
Upper-bound property
Initially, is an upper-bound on ,
since and for all .
We will prove that if the upper bound property holds before relaxing ,
it also holds after relaxing .
After relaxing , if changed, then
Membership in
.
.
was relaxed for some .
This can only happen if .
Therefore, after is relaxed, .
Therefore, .
was never relaxed for any and .
.
Therefore, .
Proof of
Let . This means was relaxed.
This could have only happened if .
Therefore, .
Dependency for:
-
Dijkstra's algorithm
-
Edge relaxations: Predecessor subgraph is a rooted tree
-
Edge relaxations: Predecessor subgraph is a shortest-path tree after convergence
-
Convergence of edge relaxations
Info:
- Depth: 3
- Number of transitive dependencies: 6
Transitive dependencies:
-
/sets-and-relations/equivalence-classes
-
/sets-and-relations/relation-composition-is-associative
-
/sets-and-relations/equivalence-relation
-
Graph
-
Path in Graph
-
Triangle inequality of shortest paths