160 likes | 323 Views
A Nearly Optimal Algorithm for Approximating Replacement Paths and k Shortest Simple Paths in General Graphs. Abhilasha Seth CSCE 669. Replacement Paths. G = (V,E) - directed graph with positive edge weights ‘s’, ‘t’ - specified vertices π (s, t) - shortest path between them
E N D
A Nearly Optimal Algorithm for Approximating Replacement Paths and k Shortest Simple Paths in General Graphs Abhilasha Seth CSCE 669
Replacement Paths • G = (V,E) - directed graph with positive edge weights • ‘s’, ‘t’ - specified vertices • π(s, t) - shortest path between them • Replacement Paths: • For every edge ‘e’ on π(s, t) • Find shortest path from ‘s’ to ‘t’ that avoids ‘e’. • Motivation • Finding shortest path considering edge failures. • Naïve Solution • Remove each edge ‘e’ one at a time, calculate shortest s-t path • O(mn + n2 log n) • Recently improved to - O(mn+n2 log log n)
Approximation • (1 + ε) approximate replacement paths, ε = [0,1) • For positive weighted, directed graphs • O(mlog(nC/c)/ ε) time • C- largest edge weight • c – smallest edge weight • α-approximate O(T(n)) algorithm for replacement paths: • α –approximate O(T(n)) algorithm for computing second shortest simple path • Just take the shortest replacement path
Notations • G = (V, E) is directed graph with positive weights • n = |V|, m = |E| • ‘s’ and ‘t’ are arbitrary vertices • For any path P, w(P) - length of P • π(s, t) – shortest path • π(s, t) = (s = v1; v2; :::; vq= t), q = 2b for some b • δ(x, y) = w (π(s, t)) • π2(s, t) – second shortest path from s to t • δ2(s,t) – analogous • Aim – compute (1+ ε) approximation of π2(s, t)
Definitions • Detour of P • P is a simple path • D(u,v) is a u-v simple path is a detour of P if: • D(u,v) ∩ P = {u, v} • u precedes v on P
Definitions • The second shortest path from ‘s’ to ‘t’ is of the form: • π(s, vi) o D(vi, vk) o π(vk, t) • D(vi, vk) is a detour of π(s, t) • Span of a detour D(vi, vk) = k – i
Approach • Find s-t path with sufficiently large detour span • Use it as an upper bound on δ2(s,t) • Progressively improve upper bound – O(log q ) phases • ‘i'th phase – • Detour span in [q/2i , q/2i-1] • Compute shortest s-t path
Approach • Wi be the length of shortest path s-t for phase i • Ui be the length of shortest path s-t with detour span >= q/2i • If q = 16
Approach • Concept • Either we can efficiently compute exact shortest path of ‘i’th phase. • Shortest path of some phase j < i is (1 + ε ) approximation of shortest path of ‘i’th phase. • Construct an algorithm which returns O(log q) values R1… Rlogq that satisfy the properties:
Approach • Letting R = mini { Ri }, we have • R is a suitable approximation to the second shortest path • Aim – find an algorithm which outputs a value of Ri for (log q) phases which satisfy the three properties.
Algorithm • Label some vertices as ‘start’ vertices • Other vertices as ‘end’ vertices • To find simple shortest path s-t, find shortest path whose detour: • Starts at a ‘start’ vertex • Ends at an ‘end’ vertex • Modify the edges of G such that • Remove incoming edges to start vertices • Remove outgoing edges from end vertices • Remove all edges on π(s, t) • For every start vertex, add edge (s, v) with weight δ(s, v) • For every end vertex, add edge (v, t) with weight δ(v, t)
Algorithm • Any path of the form: π(s, vi) o D(vi, vk) o π(vk, t) is represented in the modified graph if a. vi is a start vertex b. vk is an end vertex
Computing Ri • ‘i’ th phase – compute shortest path with detour span [q/2i, q/2i-1] • Split π(s, t) into intervals of size q/2i. • Let I1, I2,…. I2^i be the intervals • Split the phase into four sub phases. • Label every fourth interval with start vertex • For each subphase ‘j’, calculate R[i][j] • R[i][j] is the length of the shortest path in i’th phase and j’thsubphase
Computing Ri • Calculating Shortest distance • Use Modified Dijikstra’s algorithm • Progressive Dijikstra’s algorithm • For every stage, do not start from scratch • Use information from previous stages • Since we are looking for approximation • Explore a vertex ‘u’ only if the distance is significantly lower than previous stages • Relax an edge (u’, u): • Set c[u] = c[u’] + w(u’, u) • Only if c[u’] + w(u’, u) < c[u]/ (1 + ε)
Calculating Replacement Paths • Avoid vertices instead of edges. • Extending the algorithm to avoid edges is easy: • Insert a vertex in the middle of an edge • Re-run the algorithm to avoid that vertex • Le c[i, j, k ](vg)be the value of c(vg) at the end of stage k of progressive Dijikstra’s algorithm.
Conclusion • Second Shortest Path Approximation • Final approximation to δ2(s,t) = mini,j{ R[i, j] } • Replacement Paths • Final approximation to δ(s,t,vi) = mini,j{ m[i, j] (vi) } • Replacement Algorithm - O(mlog(nC/c)/ ε) time • Hope – get rid of log(nC/c) in the approximation replacement paths