Skip to content

[FEATURE] Negative weight cycle detection #766

@ayaankhan98

Description

@ayaankhan98

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions