logo

Question detail

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?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Optimisation algorithms

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?.

  1. A.It should be changed to 9
  2. B.It should remain 6
  3. C.It should be changed to 3
  4. D.It should be changed to infinity

Model answer

What a good answer should say

  • It should remain 6

Explanation

Why this works

The existing tentative distance of 6 is shorter than the newly calculated distance of 9, so it is not replaced.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.