Lec 18 MIT 6.046J 18.410J Introduction to Algorithms (SMA 5503), Fall 2005
Good morning, everyone. Glad you are all here bright and early. I'm counting the days till the TA's outnumber the students. They'll show up. We return to a familiar story. This is part two, the Empire Strikes Back. So last time, our adversary, the graph, came to us with a problem. We have a source, and we had a directed graph, and we had weights on the edges, and they were all nonnegative. And there was happiness. And we triumphed over the Empire by designing Dijkstra's algorithm, and very efficiently finding single source shortest paths, shortest path weight from s to every other vertex. Today, however, the Death Star has a new trick up its sleeve, and we have negative weights, potentially. And we're going to have to somehow deal with, in particular, negative weight cycles. And we saw that when we have a negative weight cycle, we can just keep going around, and around, and around, and go back in time farther, and farther, and farther. And we can get t...