FloydWarshallResult = {
negativeCycle:false;distance:Float64Array; } | {negativeCycle:true;vertex:number; }
Defined in: packages/graph/src/floyd-warshall.ts:10
Every pairwise shortest distance, or a vertex on a negative cycle that makes
shortest distances undefined. Exactly one of the two answers holds, and
negativeCycle says which.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ negativeCycle: false; distance: Float64Array; }
negativeCycle
Section titled “negativeCycle”
readonlynegativeCycle:false
distance
Section titled “distance”
readonlydistance:Float64Array
Row-major n × n: distance[from * n + to] is the least total weight, or Infinity when unreachable.
Type Literal
Section titled “Type Literal”{ negativeCycle: true; vertex: number; }
negativeCycle
Section titled “negativeCycle”
readonlynegativeCycle:true
vertex
Section titled “vertex”
readonlyvertex:number
A vertex on a cycle of negative total weight: walking the cycle from it returns to it.