Lecture18-shortestpaths2

# Back to graphs with negative edges if we dont know

• Notes
• 29

This preview shows page 21 - 29 out of 29 pages.

Back to graphs with negative edges . § If we don’t know all the shortest paths beforehand, how can we be sure to update the right edges in the right order to get the right dist(v) for all v?? § Must update all edges |V|-1 times § All possible ways!

Subscribe to view the full document.

Bellman-Ford Algorithm Solves: Single-source, shortest paths, in presence of negative edges
Example

Subscribe to view the full document.

Example In general, no vertex is guaranteed to be settled until the last iteration. It is possible to stop if there is an iteration in which nothing changes from the previous iteration. dist(Node) at Iteration i
3 Questions § Is it correct? § How long does it take? § Can we do better?

Subscribe to view the full document.

Bellman-Ford Algorithm Solves: Single-source, shortest paths, in presence of negative edges
Negative Cycles Run Bellman-Ford one more iteration (a |V|th time). If any shortest path decreases again, then there is a negative cycle. Shortest paths do not exist.

Subscribe to view the full document.

Shortest Paths in DAGs
Assignment § Project #3 final proofs § Due Thursday § HW #12: § Due Friday § To be updated with some review exercises § Read Section 5.1
You've reached the end of this preview.
• Spring '08
• Jones,M
• Graph Theory, Shortest path problem, Dijkstra, Priority queue

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern