ta6sol

# ta6sol - 1(a Order in which vertices are removed from...

• Notes
• 1

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

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 first part of the problem is given here.) The trick is to get Dijkstra’s algorithm to finalize 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 first, setting d [ v ] = 3. Next we process d [ v ], which changes nothing. Finally we process w , setting d [ u ] = 1. The final value of d [ v ] = 3, but there is a path of length 2:
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

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern