Skip to content

Flow Hot Sheet

Use this page when capacities, cuts, disjoint routes, or source-sink transport are already visible in the statement and you want the lightest reliable flow route.

Do Not Use When

  • the cleaner model is just bipartite matching
  • the task is shortest path or tree-path aggregation, not capacity transport
  • the statement still needs graph modeling before algorithm choice

Choose By Signal

Core Invariants

  • every residual reverse edge means “we can undo part of an earlier choice”
  • if no augmenting path remains, the current flow is maximum
  • in min-cost flow, reduced costs plus potentials keep Dijkstra valid after reweighting

Main Traps

  • mutating only the forward edge and breaking the residual invariant
  • forgetting node splitting when the statement constrains vertices rather than edges
  • forgetting that lower bounds change the model before Dinic is the right engine
  • asking plain Dinic for a cost-sensitive answer
  • feeding the min-cost-flow starter negative-cost edges without first ensuring valid initial potentials

Exact Starters In This Repo

Reopen Paths