effect-io-ai

Package: effect
Module: Graph

Graph.BellmanFordConfig

Configuration for finding a shortest path with the Bellman-Ford algorithm.

When to use

Use when configuring bellmanFord to find a shortest path where edge weights may be negative.

Details

Specifies the source and target node indices, plus a cost function that maps each edge’s data to a numeric weight.

See

Signature

export interface BellmanFordConfig<E> {
  source: NodeIndex
  target: NodeIndex
  cost: (edgeData: E) => number
}

Source

Since v3.18.0