-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Detailed Description
it looks like we don't have any algorithm to detect the negative weight cycle in graphs
Possible Implementation
we can implemnt this using Bellaman-Ford algorithm.
Bellaman-Ford Algorithm gives the shortest path from a given source node to all other nodes in |V|-1 iterations (where V is the number of vertex or nodes in graph), if we perform one more iteration of Bellaman-Ford algorithm that is the V-th iteration and if distance of any node gets improved in this V-th iteration then it seems like we have a negative cycle in the graph
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request