# FloydWarshallResult

> **FloydWarshallResult** = { `negativeCycle`: `false`; `distance`: `Float64Array`; } | { `negativeCycle`: `true`; `vertex`: `number`; }

Defined in: [packages/graph/src/floyd-warshall.ts:10](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/graph/src/floyd-warshall.ts#L10)

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

### Type Literal

{ `negativeCycle`: `false`; `distance`: `Float64Array`; }

#### negativeCycle

> `readonly` **negativeCycle**: `false`

#### distance

> `readonly` **distance**: `Float64Array`

Row-major `n × n`: `distance[from * n + to]` is the least total weight, or `Infinity` when unreachable.

***

### Type Literal

{ `negativeCycle`: `true`; `vertex`: `number`; }

#### negativeCycle

> `readonly` **negativeCycle**: `true`

#### vertex

> `readonly` **vertex**: `number`

A vertex on a cycle of negative total weight: walking the cycle from it returns to it.
