Bellman Ford Algorithm, Data Structure Algorithm, Algorithms, Weighted Graph, Graph Data Structure.
the below-weighted graph as an example. A weighted graph with a negative cycle If you have observed keenly the graph has a negative cycle: 4 → 3 → 2. In this particular case, the Bellman-Ford algorithm doesn’t work but the code does detect for negative weighted edge cycle and terminates the program