CS FundamentalsVery hardCognizant · Capgemini pattern

Run Dijkstra's algorithm on this undirected weighted graph (edges given as node-node:weight): R1-R2:3, R1-R3:6, R2-R3:2, R2-R4:8, R3-R4:1. Starting from R1, what is the shortest-path distance to R4?

  1. A. 7
  2. B. 5
  3. C. 8
  4. D. 6

Correct answer: D. 6

Dijkstra from R1 settles nodes in increasing distance order; the shortest-path distance it finds to R4 is 6.

More Computer Networks questions

Exams that ask this topic