In a graph, if there are multiple paths to a node, how does Dijkstra's algorithm determine which path to take?
-
It chooses the path with the most edges
-
It chooses the path with the least weight
-
It randomly selects a path
-
It chooses the first path it encounters