Python, Graph, Algorithms.
which some of the edge weights are negative. The algorithm initializes the distance to the source to 0 and all other nodes to infinity. Then for all edges, if the distance to the destination can be shortened by taking the edge, the distance is updated to the new lower value. This step is repeated