Académique Documents
Professionnel Documents
Culture Documents
Convert graph to contain only positive weight edges and then use
Dijkstras starting at every node.
Requirements:
Preserving shortest paths after edge reweighting :
Preserving negative cycles
Producing nonnegative edge weights by reweighting :
• L1 : given G = ( V , E ) with ω : E → R
► let h : V → R be any weighting function on the vertex set
► define ω( ω , h ) : E → R as ω( u , v ) = ω( u , v ) + h (u) – h (v)
► let p0k = < v0 , v1 , ... , vk > be a path from v0 to vk
0 v2
3 4
v1
v0 = s
0 v3
8
2
-5
0 1
-4 7 ( G', ω' )
6 v4
v5
0
v2
-1
3 4
v1
0 -5 v3
8
2
-5
1
-4 7 (G', ω' )
-4 0 v with h(v)
6 4
v5
4 0
v1 v3
13
2
0
0
0 10
(G, ω )
2
v5 v4