Skip to content
START WITH A QUESTION

What would you like to understand?

Find an answer. See the moment it becomes clear. Follow the idea further.

← Concept directory

Answers for “为什么 Dijkstra 算法在目标标签 7 首次出现时不立即将其最终确定?”

6 keyword matches

Understanding your question. You can explore the search results below now.

Understand why

↗

The algorithm does not finalize the destination label 7 at university immediately because there are still other uncircled vertices with smaller tentative distances that must be processed first. Specifically, vertex E has an uncircled label of 4, which is smaller than 7.

Conditions: The graph is being processed by Dijkstra's algorithm.; Vertices with circled labels are treated as already selected/settled.; Uncircled labels are still tentative candidates.; There exists at least one uncircled vertex with a label smaller than the target's current label.

Meet the concept

↗

The final shortest distance from home to university is 7. This value is determined after all smaller uncircled candidates (specifically vertices E with label 4 and B with label 6) have been processed.

Conditions: The algorithm has processed all vertices with tentative labels smaller than 7.; The label 7 at university is the smallest remaining uncircled label.; The graph edge weights are fixed as shown in the example.

Find a method

↗

When a vertex receives multiple distance calculations from different paths, you keep only the smallest value and cross out the larger ones. This ensures that the vertex's label always represents the shortest known distance from the source.

Conditions: A vertex is reachable via multiple paths from different circled vertices.; New distance calculations are performed for an already labeled vertex.

Meet the concept

↗

The initialization step involves assigning a distance of 0 to the starting vertex (home) and marking it as visited by drawing a circle around it. All other vertices are initially considered to have an infinite or undefined distance until they are updated by neighbor calculations.

Conditions: The algorithm is starting.; The source vertex is identified as 'home'.

Meet the concept

↗

The numeric labels at the vertices represent the current best known distance from the source vertex (home) to that specific vertex. A blue circle around a label indicates that this distance has been accepted as final for that vertex in the current run of the algorithm.

Conditions: The demonstration uses a visual whiteboard-style representation.; The source vertex is 'home'.; The algorithm is Dijkstra's shortest path algorithm.

Meet the concept

↗

The rule is to select the uncircled vertex with the smallest tentative distance label. This vertex is then circled to mark it as settled, and a predecessor arrow is drawn from the vertex that supplied this smallest distance.

Conditions: There are uncircled vertices with assigned distance labels.; The algorithm is in the selection phase after updating neighbors.