問題文
A logistics team projects a road network with a distance property on each relationship and wants the cheapest route from one warehouse to one store. All distances are positive. Which algorithm fits?
選択肢
- Bellman-Ford, which is needed because road distances can be negative and would make the other procedures fail.
- The Minimum Weight Spanning Tree algorithm, which returns the set of relationships that connects all the reachable nodes together with the smallest possible total weight.
- Breadth First Search, which visits nodes in order of increasing distance counted as the number of relationships from the start node.
- The source-target form of Dijkstra, which returns the shortest path between a source and the targets given to it and supports positive relationship weights.