effect-io-ai

Package: effect
Module: Graph

Graph.AllPairsResult

Result of an all-pairs shortest path computation.

When to use

Use when storing or passing around the complete output of floydWarshall so callers can look up shortest distances, node paths, and edge data for any source and target node pair.

Details

Contains distance, node-path, and edge-data maps keyed by source and target node indices.

See

Signature

export interface AllPairsResult<E> {
  readonly distances: Map<NodeIndex, Map<NodeIndex, number>>
  readonly paths: Map<NodeIndex, Map<NodeIndex, Array<NodeIndex> | null>>
  readonly costs: Map<NodeIndex, Map<NodeIndex, Array<E>>>
}

Source

Since v3.18.0