Skip to content

Event

Why Dijkstra still finds the globally shortest path by selecting the nearest point each round

1 reports · 1 sources

In each round, Dijkstra's algorithm selects from the unsettled nodes the one with the smallest cumulative cost from the source and finalizes it, then performs relaxation updates on its neighbors. Under the premise that edge weights are non-negative, the path obtained this way is the globally shortest path. If negative-weight edges exist in the graph, a finalized node may be overturned by a cheaper route, and standard Dijkstra no longer guarantees correctness; algorithms such as Bellman-Ford must be used instead.

Report timeline

  1. Understanding Dijkstra Completely: Why Does Picking the Nearest Point Each Time Still Find the Globally Shortest Path?

    In each round, Dijkstra selects the node with the smallest cumulative cost from the source among the nodes not yet finalized and formally finalizes it, then performs relaxation updates on its neighbors; under the premise of non-negative edge weights, this guarantees the globally shortest path. If negative-weight edges exist, a finalized node may be overturned by a cheaper route, so standard Dijkstra no longer guarantees correctness, and algorithms such as Bellman-Ford must be used instead.

    深蓝AI · 微信公众号 ·

Related topics