(20 points) Let G = (V, E) be a weighted, directed graph with source vertex s, and let G be initialized by INITIALIZE-SINGLE-SOURCE (G, s). Prove that if a sequence of relaxation steps sets s.? to a non-NIL value, then G contains a negative-weight cycle.
Added by Gregory E.
Close
Step 1
The INITIALIZE-SINGLE-SOURCE(G, s) function sets the distance of all vertices in G to infinity, except for the source vertex s, which is set to 0. It also sets the predecessor of all vertices to NIL. Show more…
Show all steps
Your feedback will help us improve your experience
Chandra Jain and 82 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Sri K.
Let G be a simple connected graph and e any edge in G. Prove that G - e (i.e. G with edge e removed) is connected if and only if e is in a cycle of G.
Chandra J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD