Skip to content

@graphty/algorithms / index / floydWarshall

Function: floydWarshall() ​

floydWarshall(graph): FloydWarshallResult

Defined in: algorithms/shortest-path/floyd-warshall.ts:15

Computes all-pairs shortest paths using the Floyd-Warshall algorithm

Parameters ​

graph ​

Graph

The graph to compute shortest paths for

Returns ​

FloydWarshallResult

The distances, predecessors, and negative cycle detection result