18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dijkstra's <strong>Algorithm</strong><br />

To be certain of finding the shortest path between and t, we might have to first find the shortest path between and all other<br />

vertices. This defines a shortest path spanning tree rooted in . For undirected graphs, this will be the breadth-first search tree,<br />

but in general it provides the shortest path between and all other vertices.<br />

What is the running time of this algorithm? When implemented using adjacency lists and a Boolean array to mark what is<br />

known about each vertex, the complexity is . This is the same running time as a proper version of Prim's algorithm;<br />

indeed, except for the extension condition, it is the same algorithm as Prim's.<br />

Next: All-Pairs Shortest Path Up: Shortest Paths Previous: Shortest Paths<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK2/NODE77.HTM (2 of 2) [19/1/2003 1:29:17]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!