Back to graphs with negative edges if we dont know

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!
Image of page 21

Subscribe to view the full document.

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

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
Image of page 24
3 Questions § Is it correct? § How long does it take? § Can we do better?
Image of page 25

Subscribe to view the full document.

Bellman-Ford Algorithm Solves: Single-source, shortest paths, in presence of negative edges
Image of page 26
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.
Image of page 27

Subscribe to view the full document.

Shortest Paths in DAGs
Image of page 28
Assignment § Project #3 final proofs § Due Thursday § HW #12: § Due Friday § To be updated with some review exercises § Read Section 5.1
Image of page 29
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

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern