Ta6sol - a s w u v A 2 4-3 1 s w u v 2 4-3 1 s w u v 4 1 3 The proof of Dijkstra’s algorithm does not go through when negative edge weights are

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1. (a) Order in which vertices are removed from priority queue: s, c, a, b. (b) On termination, d [ s ] = 0; d [ a ] = 4; d [ b ] = 5; d [ c ] = 3 . (c) d [ b ] is initially . It decreases to 7 and then to 5. 2. (The solution to only the Frst part of the problem is given here.) The trick is to get Dijkstra’s algorithm to Fnalize a vertex before its true minimum distance is known. Consider the following digraph. When s is processed, d [ u ] = 2 and d [ w ] = 4. We process u Frst, setting d [ v ] = 3. Next we process d [ v ], which changes nothing. ±inally we process w , setting d [ u ] = 1. The Fnal value of d [ v ] = 3, but there is a path of length 2:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a s, w, u, v A . 2 4-3 1 s w u v 2 4-3 1 s w u v 4 1 3 The proof of Dijkstra’s algorithm does not go through when negative edge weights are allowed, for the following reason. Recall that in case 2 of the proof, y lies on the shortest path from s to u and y n = u . In the proof given in class, we claim that since y lies midway on the shortest path from s to u , δ ( s, y ) < δ ( s, u ). This crucial fact is true if the edge weights are all positive; however, it breaks down if negative edge weights are allowed! 1...
View Full Document

This note was uploaded on 12/09/2010 for the course ENGLISH 1303 taught by Professor May during the Spring '10 term at HKU.

Ask a homework question - tutors are online