This preview shows pages 1–2. Sign up to view the full content.
CS112 Spring 2011: Problem Set 13
Dijkstra's Algorithm/Quicksort

1. Suppose you are given this undirected graph in which the vertices
are towns, and the edges are toll roads between them. The weight of
an edge is the dollar amount of toll.
Use Dijsktra's shortest paths algorithm to determine the minimum
toll route from A to all other cities.
* Show each step of the algorithm in tabular form. Here's the
table after the initial step:
Done
D[B]
D[C]
D[D]
D[E]
D[F]
D[G]
D[H]
D[I]

A
4,A
8,A
?
?
?
?
?
?
Note that along with the distance, the "previous" vertex is also
shown.
* Draw the shortest path tree induced on the graph.
*SOLUTION*
*
Done
D[B]
D[C]
D[D]
D[E]
D[F]
D[G]
D[H]
D[I]

A
4,A
?
?
?
?
?
8,A
?
B
12,B
?
?
?
?
8,A
?
H
12,B
?
?
?
9,H
15,H
G
12,B
?
?
11,G
15,H
F
12,B
25,F
21,F
15,H
C
19,C
21,F
14,C
I
19,C
21,F
D
21,F
E
Note that along with the distance, the "previous" vertex is also
shown.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Summer '09
 VENUGOPAL

Click to edit the document details