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 Z:
================================================
|    Node     |    Shortest distance from Z    |    Previous Node   |
================================================
       Z                                0                                     n/a   
       W                               3                                     Z   
       V                                4                                     W   
       X                                5                                     V   
       Y                                5                                     Z   
       U                                6                                     W   
================================================



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 X is V, and we know the shortest distance of both X (5) and V (4), so 5 - 4 = 1 which is X.

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



That's incorrect

That's correct

The answer was: 1

Question 1 of 2

The answer was: 5

Question 2 of 2

Try Another Problem

We gratefully acknowledge the programming and problem design work of John Broderick (UMass '21), which has really helped to substantially improve this site.

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