Generalized maximum flow

Maximum flow where every edge has a capacity and a multiplier: pushing x units in consumes x of capacity and delivers multiplier · x out. The solver is C++ compiled to WebAssembly and runs entirely in this page — nothing is uploaded.

Graph

Result

Pick an example or paste a graph, then press Solve.

Filled paths, in order

—

Each entry is one augmentation: the flow that entered, what reached the sink, and the constricting edge that limited it. A flow-generating cycle is a loop whose multipliers multiply to more than one — it manufactures flow, and its excess is routed to the sink. Source and documentation.