Choosing best shortcuts for a path Martin Peˇ car Jozef Stefan Institute, Ljubljana, Slovenia Koper, 17. 6. 2015 1 / 19
Motivation We want to improve the network, but are constrained (budget) Our goal is to improve DAGs like Contraction Hierarchies 2 / 19
Motivation We want to improve the network, but are constrained (budget) Our goal is to improve DAGs like Contraction Hierarchies 2 / 19
Motivation - example 3 / 19
Related problems The Shortcut Problem: asks what is the best set of k 1 additional edges (shortcuts) so that shortest paths will be preserved and the average hop length of paths will be minimal; Multi-Constrained Shortest Path: find a path from s to t 2 with lowest cost, subject to constraints; Constrained Network Optimization 3 4 / 19
Related problems The Shortcut Problem: asks what is the best set of k 1 additional edges (shortcuts) so that shortest paths will be preserved and the average hop length of paths will be minimal; Multi-Constrained Shortest Path: find a path from s to t 2 with lowest cost, subject to constraints; Constrained Network Optimization 3 4 / 19
Related problems The Shortcut Problem: asks what is the best set of k 1 additional edges (shortcuts) so that shortest paths will be preserved and the average hop length of paths will be minimal; Multi-Constrained Shortest Path: find a path from s to t 2 with lowest cost, subject to constraints; Constrained Network Optimization 3 4 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
General model Definition Weighted multiobjective network design problem d 2 B ∈ R + a vector of constraints (”budget”) 0 G = ( V , E ) a directed (multi)graph d 1 c : E �→ R + costs 0 d 2 b : E �→ R + ”building” costs 0 d 1 w : V × V �→ R + weights 0 Determine E 0 ⊂ E such that it satisfies the constrains b ( E 0 ) ≤ B and achieves � E S ⊂ E ( min w ij c ( P G ( V , E S ) ( i , j ))) i , j 5 / 19
Simple problem Consider a path connecting some cities. We have a budget which allows construction of a few new road sections. ... n 1 2 3 Dashed shortcuts are not allowed ( b ( e s ) = Inf ) All arcs point to a vertex with higher index 6 / 19
Simple problem Consider a path connecting some cities. We have a budget which allows construction of a few new road sections. ... n 1 2 3 Dashed shortcuts are not allowed ( b ( e s ) = Inf ) All arcs point to a vertex with higher index 6 / 19
Simple problem Consider a path connecting some cities. We have a budget which allows construction of a few new road sections. ... n 1 2 3 Dashed shortcuts are not allowed ( b ( e s ) = Inf ) All arcs point to a vertex with higher index 6 / 19
Simple problem Consider a path connecting some cities. We have a budget which allows construction of a few new road sections. ... n 1 2 3 Dashed shortcuts are not allowed ( b ( e s ) = Inf ) All arcs point to a vertex with higher index 6 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
Variants of the problem Cost of using a shortcut ( b ( e s ) ): b ( e s ) = 1 for all allowed shortcuts, b ( e s ) can be different. Weights ( w ij ): w 1 n = 1, other w ij = 0 ⇒ constrained shortest path; several non-zero weights ⇒ constrained network optimization. 7 / 19
All subpaths distances Subpath travelling costs c 45 c 34 c 35 c 23 c 24 c 25 c 12 c 13 c 14 c 15 c ij = c ij − 1 + c j − 1 j 8 / 19
All subpaths distances Subpath travelling costs c 45 c 34 c 35 c 23 c 24 c 25 c 12 c 13 c 14 c 15 c ij = c ij − 1 + c j − 1 j 8 / 19
b = 1 Constrained shortest path c ( 1 , n , B ) = min i , k ( c ( 1 , i , k ) + c ( i , n , B − k )) k = ⌊ B ⌋ Algorithm 1 Dynamic Programming CSP 1: for l = 0 to k do for i = 1 to n do 2: for j = i to n do 3: c ( i , j , l ) = min v , s ( c ( i , v , s ) + c ( v , j , l − s )) 4: c ( i , j , l ) = min ( c ( i , j , l ) , c s ij ) 5: end for 6: end for 7: 8: end for Complexity is O ( k 2 n 3 ) 9 / 19
b = 1 Constrained shortest path c ( 1 , n , B ) = min i , k ( c ( 1 , i , k ) + c ( i , n , B − k )) k = ⌊ B ⌋ Algorithm 2 Dynamic Programming CSP 1: for l = 0 to k do for i = 1 to n do 2: for j = i to n do 3: c ( i , j , l ) = min v , s ( c ( i , v , s ) + c ( v , j , l − s )) 4: c ( i , j , l ) = min ( c ( i , j , l ) , c s ij ) 5: end for 6: end for 7: 8: end for Complexity is O ( k 2 n 3 ) 9 / 19
b = 1 Constrained shortest path c ( 1 , n , B ) = min i , k ( c ( 1 , i , k ) + c ( i , n , B − k )) k = ⌊ B ⌋ Algorithm 3 Dynamic Programming CSP 1: for l = 0 to k do for i = 1 to n do 2: for j = i to n do 3: c ( i , j , l ) = min v , s ( c ( i , v , s ) + c ( v , j , l − s )) 4: c ( i , j , l ) = min ( c ( i , j , l ) , c s ij ) 5: end for 6: end for 7: 8: end for Complexity is O ( k 2 n 3 ) 9 / 19
b > 0 Constrained shortest path Even the simplest form (each arc replaced by a shortcut) is NP-complete, can be translated to knapsack problem ( M − c 12 , b 12 ) ( M − c 23 , b 23 ) ( M − c n − 1 n , b n − 1 n ) ... n 3 1 2 ( M , 0 ) ( M , 0 ) ( M , 0 ) ( M , 0 ) M = max i c ii + 1 10 / 19
b > 0 Constrained shortest path Even the simplest form (each arc replaced by a shortcut) is NP-complete, can be translated to knapsack problem ( M − c 12 , b 12 ) ( M − c 23 , b 23 ) ( M − c n − 1 n , b n − 1 n ) ... n 3 1 2 ( M , 0 ) ( M , 0 ) ( M , 0 ) ( M , 0 ) M = max i c ii + 1 10 / 19
Recommend
More recommend