Loading...
Greedy shortest path find for non-negative weights.
Choose nearest unsettled
Min-distance ordering
Improve tentative paths
Maintain a set of settled vertices whose distances are finalized. Keep a priority queue of frontier vertices keyed by tentative dist. Extract the minimum, settle it, and relax all outgoing edges—updating neighbors' tentative distances if a shorter path is found.