Interactive end-of-chapter exercises


Dijkstra's Link State Algorithm - Advanced

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

Consider the completed table below, which calculates the shortest distance to all nodes from X:
================================================
|    Node     |    Shortest distance from X    |    Previous Node   |
================================================
       X                                0                                     n/a   
       Y                                1                                     X   
       Z                                2                                     Y   
       W                               4                                     Y   
       U                                7                                     X   
       V                                8                                     X   
================================================



Question List


1. For link X, what is the cost associated with this link? If the answer can't be determined given the information, respond with 'n/a'

2. For link Y, what is the cost associated with this link? If the answer can't be determined given the information, respond with 'n/a'




Solution


1. The prior node in the path to Y is X, and we know the shortest distance of both Y (1) and X (0), so 1 - 0 = 1 which is X.

2. The prior node in the path to Z is Y, and we know the shortest distance of both Z (2) and Y (1), so 2 - 1 = 1 which is Y.



That's incorrect

That's correct

The answer was: 1

Question 1 of 2

The answer was: 1

Question 2 of 2

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