This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: A walk over the shortest path: Dijkstra’s Algorithm viewed as fixedpoint computation Jayadev Misra 1 Department of Computer Sciences, University of Texas at Austin, Austin, Texas 787121188, USA Abstract We present a derivation Dijkstra’s shortest path algorithm[1]. We view the prob lem as computation of a “greatest solution” of a set of equations. A UNITYstyle computation[0] is then prescribed whose implementation results in Dijkstra’s algo rithm. Key words: Design of algorithms, Graph algorithms, Combinatorial problems, Program derivation 0 Introduction Dijkstra’s shortest path algorithm[1] has, by now, become a classic (the cited paper has received such an official designation from the Citation Index Ser vice). Typical descriptions (and derivations) of this algorithm start by pos tulating that the shortest paths be enumerated in the order of increasing distances from the source. In this note, we present a derivation that is quite different in character. We view the problem as computation of a “greatest so lution” of a set of equations. A UNITYstyle computation[0] is then prescribed whose implementation results in Dijkstra’s algorithm. The bulk of the work in our derivation is in designing the appropriate heuris tics that guarantee termination; this is in contrast to traditional derivations where most of the effort is directed toward postulating and maintaining the appropriate invariant. 1 Email: [email protected] Partially supported by the NSF grant CCR– 9803842. Preprint submitted to Elsevier Preprint 1/30/2000 1 The Shortest Path Problem Given is a finite directed graph that has (i) a source node, henceforth, desig nated by s , and (ii) for each edge ( i,j ) a nonnegative real number, w ij , called its length . Length of a path is the sum of edge lengths along the path. It is required to compute the shortest path, i.e., a path of minimum length, from s to every node. Henceforth, “shortest path to a node” means the shortest path from s to that node, and distance to a node is the length of the shortest path. The distance to a reachable node from s is a nonnegative real and dis tance to an unreachable node is ∞ . For the moment, assume that every node in the graph is reachable from s ; the general case, where some of the nodes are unreachable, is taken up in section 1.4. We restrict ourselves to comput ing the distances to all nodes; shortest paths can be computed using a minor modification of this algorithm. 1.1 Equations, E, for Distances Let D k denote the distance to node k ; this is a nonnegative real number since all nodes are reachable from s . Note that D s = 0. Call i a predecessor of k if there is an edge ( i,k ) in the graph. For a node k , k 6 = s , whose only predecessors are i,j , D k = min( D i + w ik , D j + w jk )....
View
Full
Document
This note was uploaded on 06/05/2010 for the course COMPUTER S 700 taught by Professor Joewhite during the Spring '10 term at Universidad San Martín de Porres.
 Spring '10
 JoeWhite
 Computer Science

Click to edit the document details