Aim
We are given a directed graph. We need to detect whether the graph has a negative cycle or not. A negative cycle is one in which the overall sum of the cycle becomes negative.
Details
Bellman Ford algorithm is a algorithm which help us to find the shortest path from a starting vertex to all other vertices of a weighted graph.
Aim We are given a directed graph. We need to detect whether the graph has a negative cycle or not. A negative cycle is one in which the overall sum of the cycle becomes negative.
Details Bellman Ford algorithm is a algorithm which help us to find the shortest path from a starting vertex to all other vertices of a weighted graph.