Interactive end-of-chapter exercises


Dijkstra's Link State Algorithm (for computing least cost paths)

Consider the 6-node network shown below, with the given link costs.


Using Dijkstra's algorithm, find the least cost path from source node U to all other destinations and answer the following questions



Question List


1. What is the shortest distance to node z and what node is its predecessor? Write your answer as n,p

2. What is the shortest distance to node w and what node is its predecessor? Write your answer as n,p

3. What is the shortest distance to node y and what node is its predecessor? Write your answer as n,p




Solution


1. The minimum distance from node u to node z is 13, and node z's predecessor is node w. The full answer was: 13,w

2. The minimum distance from node u to node w is 6, and node w's predecessor is node v. The full answer was: 6,v

3. The minimum distance from node u to node y is 10, and node y's predecessor is node w. The full answer was: 10,w



That's incorrect

That's correct

The answer was: 13,w

Question 1 of 3

The answer was: 6,v

Question 2 of 3

The answer was: 10,w

Question 3 of 3

Try Another Problem

We greatly appreciate the work of John Broderick (UMass '21) in helping to develop these interactive problems.

Copyright © 2010-2025 J.F. Kurose, K.W. Ross
Comments welcome and appreciated: kurose@cs.umass.edu