Minimum-hop shortest paths

ID: minimum-hop-shortest-paths

Among paths of minimum total weight, choose the fewest edges. Store a lexicographic order pair and extend it across weight as . For positive edge weights, every extension strictly increases its first component, so Dijkstra's algorithm settles these pairs correctly when its priority queue and relaxation both compare the full pair. Equal total weight then selects the smaller hop count; arbitrary vertex-name tie-breaking does not express this objective.

New to topics? Read the docs here!