Skip to content

Type Alias: FlowAlgorithm

@kortexya/reasoninglayer


@kortexya/reasoninglayer / FlowAlgorithm

FlowAlgorithm = { kind: "max_flow"; } | { kind: "min_cost_max_flow"; } | { kind: "classify_edges"; } | { kind: "classify_edges_optimal"; } | { kind: "min_cut"; }

Defined in: src/types/flow-networks.ts:27

Strategy chosen at solve time.

The flow network is algorithm-agnostic — the same persisted graph can be solved with different algorithms, and the response shape narrows the relevant fields per algorithm.

  • "max_flow" — Dinic’s algorithm. Returns totalFlow + per-edge flow.
  • "min_cost_max_flow" — Successive-shortest-path MCMF. Returns totalFlow, totalCost, per-edge flow. Edges should carry cost.
  • "classify_edges" — Dulmage–Mendelsohn residual classification. Returns per-edge always_used / never_used / sometimes_used.
  • "classify_edges_optimal" — As above, but only over optimal (min-cost) max-flow solutions.
  • "min_cut" — Source-sink min cut. Returns the cut partition and the saturated cut edges.