To update the neighbors, you calculate the total distance from the source to each unvisited neighbor by adding the edge weight to the current circled vertex's distance. You then write these new distances next to the neighbors.
Conditions: There is a current circled (settled) vertex.; The vertex has neighbors that are not yet circled.; Edge weights are known and non-negative.
To update the neighbors, you calculate the total distance from the source to each unvisited neighbor by adding the edge weight to the current circled vertex's distance. You then write these new distances next to the neighbors.
Conditions: There is a current circled (settled) vertex.; The vertex has neighbors that are not yet circled.; Edge weights are known and non-negative.
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.
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.