Package: effect
Module: Graph
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
bellmanFord for the algorithm that consumes this configurationDijkstraConfig for non-negative edge costsAstarConfig for heuristic shortest-path searchSignature
export interface BellmanFordConfig<E> {
source: NodeIndex
target: NodeIndex
cost: (edgeData: E) => number
}
Since v3.18.0