Skip to content

@graphty/algorithms / index / hasNegativeCycle

Function: hasNegativeCycle() ​

hasNegativeCycle(graph): boolean

Defined in: algorithms/shortest-path/bellman-ford.ts:174

Check if graph has negative cycles using Bellman-Ford

Parameters ​

graph ​

Graph

The graph to check for negative cycles

Returns ​

boolean

True if the graph contains a negative cycle