Why Bellmen-Ford working but Dijkstra not?
Bellman-Ford runs for at most n−1 iterations to relax all edges, ensuring the shortest paths are found. After this, it performs one more check to detect negative weight cycles. In contrast, Dijkstra...