Source Sink Relay node Edge carrying flow
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Minimum-Cost Network Flow Optimizer

A network of capacitated, priced links has to move a required amount of flow from a source to a sink for the lowest possible total cost — the same problem that governs bandwidth allocation on telecom backbones and shipment routing in logistics networks. This simulator builds a small layered graph with random per-edge capacities and costs, then solves it exactly with the successive-shortest-augmenting-path algorithm: repeatedly finding the cheapest still-available route through the residual graph via Bellman-Ford (which must tolerate the negative-cost "undo" edges the algorithm creates), pushing the largest amount of flow that route can bear, and repeating until the full demand is routed or the network is proven infeasible. Adjust the demand and capacity scale to watch cheap routes saturate and flow reroute onto costlier detours, with animated particles tracing every unit of flow along its chosen path in real time.