Question

Let G = (V, E) be a weighted, directed graph with weight function w: E → ℝ and no negative-weight cycles. Let s ∈ V be the source vertex, and let G be initialized by INITIALIZE-SINGLE-SOURCE (G, s). Prove that for every vertex

vVπv ∈ V_π

, there exists a path from s to in

GπG_π

and that this property is maintained as an invariant over any sequence of relaxations.

Solution

Verified

Step 1

1 of 2

The only vertex in Vπ\mathrm{V}_{\mathrm{\pi}} is s\mathrm{s}, and there is trivially a path from s to itself. Now suppose that after any sequence of n relaxations, for every vertex vVπv \in V_{\pi} there exists a path from ss to vv in GmG_{m}. Consider the (n+1)st(n+1)^{st} relaxation. Suppose it is such that vd>ud+w(u,v).v \cdot d>u \cdot d+w(u, v) . When we relax v,v, we update v.π=u.π.v . \pi=u . \pi . By the induction hypothesis, there was a path from s\mathrm{s} to u\mathrm{u} in Gπ\mathrm{G}_{\pi}. Now v\mathrm{v} is in Vπ\mathrm{V}_{\pi}, and the path from s\mathrm{s} to u,\mathrm{u}, followed by the edge (u,v)=(vπ,v)(u, v)=(v \cdot \pi, v) is a path from ss to vv in Gπ,G_{\pi}, so the claim holds.

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Recommended textbook solutions

Computer Organization and Design MIPS Edition: The Hardware/Software Interface 5th Edition by David A. Patterson, John L. Hennessy

Computer Organization and Design MIPS Edition: The Hardware/Software Interface

5th EditionDavid A. Patterson, John L. Hennessy
220 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionRamez Elmasri, Shamkant B. Navathe
687 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionCharles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
726 solutions
Introduction to the Theory of Computation 3rd Edition by Michael Sipser

Introduction to the Theory of Computation

3rd EditionMichael Sipser
389 solutions

Related questions