250 likes | 357 Views
The selfish-edges Shortest-Path problem. The selfish-edges SP problem.
E N D
The selfish-edges SP problem • Input: an undirected graph G=(V,E) such that each edge is owned by a distinct selfish agent, a source node s and a destination node z; we assume that agent’s private type is the positive cost (length) of the edge, and his valuation function is equal to his type if edge is selected in the solution, and 0 otherwise. • SCF: a (true) shortest path in G between s and z.
Notation and assumptions • n=|V|, m=|E| • dG(s,z): distance in G=(V,E,r) between s ans z (sum of reported costs of edges on a shortest path PG(s,z)) • Nodes s and z are 2-edge-connected in G, i.e., there exists in G at least 2 edge disjoint paths between s and z for any edge of PG(s,z) removed from the graph there exist at least one replacement path in G-e between s and z (this will bound the problem, since otherwise a bridge-edge might have an unbounded marginal utility)
VCG mechanism • The problem is utilitarian(indeed, the cost of a solution is given by the sum of the valuations of the selected edges) VCG-mechanism M= <g(r), p(x)>: • g(r): computes PG(s,z) in G=(V,E,r) • pe: for each eE: pe =j≠e vj(rj,x(r-e)) -j≠e vj(rj,x), namely dG-e(s,z)-(dG(s,z)-re) if ePG(s,t) 0 otherwise • For each e PG(s,z), we have to compute dG-e(s,z), namely the length of a shortest path in G-e =(V,E\{e},r-e) between s and z. { pe=
The best replacement path s PG(s,z) 2 3 PG-e(s,z) 4 5 6 5 e 2 10 12 5 Remark: pere, since dG-e(s,z)dG(s,z) z
A trivial but costly implementation • Step 1: First of all, apply Dijkstra to compute PG(s,z) this costs O(m + n logn) time by using Fibonacci heaps. • Step 2: Then, e PG(s,z) apply Dijkstra in G-e to compute PG-e(s,z) we spend O(m + n logn) time for each of the O(n) edges in PG(s,z), i.e., O(mn + n2 logn) time Overall complexity: O(mn + n2 logn) time • We will see an efficient solution costing O(m + n logn) time
Notation • SG(s), SG(z): single-source shortest paths trees rooted at s and z • Ms(e): set of nodes in SG(s) not descending from edge e (i.e., the set of nodes whose shortest path from s does not use e) • Ns(e)=V/Ms(e) • Mz(e), Nz(e) defined analogously
A picture SG(s) s Ms(e) u e v Ns(e) z
Crossing edges • (Ms(e),Ns(e)) is a cut in G • Cs(e)={(x,y) E\{e}: x Ms(e), yNs(e)} edges “belonging” to the cut: crossing edges
Crossing edges SG(s) s Ms(e) u e v Cs(e) Ns(e) z
What about PG-e(s,z)? • Trivial: it does not use e • It must cross the cut Cs(e) • It is shortest among all the paths between s and z not using e • Its length is: where w(f) denotes the cost declared for f. dG-e(s,z)= min {dG-e(s,x)+w(f)+dG-e(y,z)} f=(x,y)Cs(e)
The path PG-e(s,z) s u x e v y z dG-e(s,z)= min {dG-e(s,x)+w(f)+dG-e(y,z)} f=(x,y) Cs(e)
How to compute dG-e(s,z) • Let f=(x,y) Cs(e); we will show that dG-e(s,x)+w(f)+dG-e(y,z)=dG(s,x)+w(f)+dG(y,z) Remark: dG-e(s,x)=dG(s,x), since xMs(e) Lemma: Let f=(x,y)Cs(e) be a crossing edge (xMs(e)). Then yMz(e) (from which it follows that dG-e(y,z)=dG(y,z)).
A simple lemma Proof (by contr.) Let yMz(e), then yNz(e). Hence, y is a descendant of u in SG(z), and PG(z,y) uses e. But PG(v,y) is a subpath of PG(z,y), and then: dG (v,y)=w(e) + dG (u,y) > dG (u,y). But yNs(e), then PG(s,y) uses e. But PG(u,y) is a subpath of PG(s,y), an then: dG (u,y)=w(e) + dG (v,y) > dG (v,y).
A picture s Ms(e) z Ns(e) Mz(e)
Computing best replacement paths Given SG(s) and SG(z), in O(1) time we compute: k(f):= dG-e(s,x) + w(f) + dG-e(y,z) dG(s,x) given by SG(s) dG(y,z) given by SG(z) Remark: k(f) is the length of a shortest path between s and z passing through f
A corresponding algorithm Step 1: Compute SG(s) and SG(z) Step 2:e PG(s,z) check all the crossing edges in Cs(e), and take the minimum w.r.t. k(). Time complexity Step 1: O(m + n logn) time Step 2: O(m) crossing edges for each of the O(n) edges on PG(s,z): total of O(mn) time • Overall complexity: O(mn) time Improves on O(mn + n2 logn) if m=o(n logn)
A more efficient solution: the Malik, Mittal and Gupta algorithm (1989) • MMG have solved in O(m+n log n) time the following related problem: given a SP PG(s,z), what is its most vital edge, namely an edge whose removal induces the worst (i.e., longest) best replacement path between s and z? • Their approach computes efficiently all the best replacement paths between s and z… …but this is exactly what we are looking for in our VCG-mechanism!
The MMG algorithm at work • Let e1, e2,…, eq be the edges of PG(s,z) from s to z, in this order. • At Step i, we maintain in a heap H the set of nodes Ns(ei) (initially H=V) • Let us call active the nodes in H. With each node yH, we associate a key k(y) and a corresponding crossing edge, as follows: k(y)= min {dG(s,x)+w(x,y)+dG(y,z)} k(y) is the length of a SP in G-ei from s to z passing through the active node y (x,y)E, xMs(ei)
The MMG algorithm at work (2) • Initially, H =V, and k(y)=+ for any yV • Consider e1, e2,…, eq one after the other. When edge ei is considered, modify H as follows: • Remove from H all the nodes in Ws(ei)=Ns(ei-1)\Ns(ei) • Consider all the edges (x,y) s.t. xWs(ei) and yH, and compute k’(y)=dG(s,x)+w(x,y)+dG(y,z). If k’(y)<k(y), decrease k(y) to k’(y), and update the corresponding crossing edge to (x,y) • Then, find the minimum in H w.r.t. k(), which returns the length of a best replacement path for ei (i.e., dG-ei(s,z)), along with the selected crossing edge
An example s Ws(e1) e1 e2 e3 Ns(e1) e4 e5 z
An example (2) s e1 e2 Ws(e2) e3 e4 Ns(e2) e5 z
Time complexity of MMG Theorem: Given a shortest path between two nodes s and z in a graph G with n vertices and m edges, all the best replacement paths between s and z can be computed in O(m + n log n) time.
Time complexity of MMG Proof: Compute SG(s) and SG(z) in O(m + n logn) time. Then, use a Fibonacci heap to maintain H, on which the following operations are executed: • A single make_heap • O(n) insert • O(n) find_min • O(n) delete • O(m) decrease_key In a Fibonacci heap, the amortized cost of a delete and a delete_min is O(logn), while insert, find_min, decrease_key,make_heap cost O(1), so O(m + n logn) total time
Plugging-in the MMG algorithm into the VCG-mechanism Corollary There exists a VCG-mechanism for the selfish-edges SP problem running in O(m + n logn) time. Proof. Running time for g(): O(m + n logn) (Dijkstra). Running time of p(): O(m + n logn), by applying MMG to compute all the distances dG-e(s,z).