Exam-style question
Try this first
During a trace of Dijkstra’s algorithm, a vertex has a current tentative distance of 6. A route through the vertex currently being processed would give that vertex a distance of 9. What should happen to the tentative distance?.
- A.It should be changed to 9
- B.It should remain 6
- C.It should be changed to 3
- D.It should be changed to infinity
Answer and explanation
Concise answer
It should remain 6
Why this is correct
The existing tentative distance of 6 is shorter than the newly calculated distance of 9, so it is not replaced.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
