Bellman–Ford AlgorithmSingle-source shortest paths with negative edges and reachable negative-cycle detection.