Network Flow Reductions
Context: FIT2004_MOC Β· the W11 applied sheet the lectureβs matching agency the W12 applied matching and min-cut drills β LO1: transform the input so stock Ford-Fulkerson answers a new problem Β· the flow-world sibling of State-Space Graph Modelling Parent Framework: Ford-Fulkerson Method
Quick Revision
- π― Objective: build a network whose max flow (or min cut) is the answer β run FF unmodified β read the answer off the flow value, the middle-edge flows, or the cut sides.
- π¦ Core Components: super source/sink | vertex split | bipartite with quotas (incl. DAG path cover) | unit capacities disjoint paths | min cut cheapest two-way split, edges as hard constraints Β· lower bounds and fixed demands β Circulation with Demands and Lower Bounds.
- β‘ Key Constraint: every answer owes three things β the construction (vertices, edges, capacities), why max flow the answer, and the read-off rule. Never modify FF: βreduce the problem by transforming the inputβ (applied footnote).
π How It Works
1. Many Sources or Sinks β Super Source and Super Sink (applied P2 Β· [P,C,D,HD])
- Construction β new with an edge to each source , capacity total out-capacity of Β· new with an edge from each sink , capacity total in-capacity of β FF from to .
- Why the capacities β big enough never to bind, so they add no constraint that the original problem lacked.
- Contrast with BFS β the BFS super source shifts distances by (State-Space Graph Modelling Β§5); here nothing shifts β the flow value is unchanged.
2. Vertex Capacities β Split Every Vertex (applied P5 Β· [P,C,D,HD])
- Construction β each becomes with capacity Β· every edge into now enters , every edge out of leaves Β· delete .
- Why β all flow through must cross the single edge , so the vertex limit becomes an edge limit FF already enforces β conservation pushes everything through it, the capacity constraint caps it.
3. Bipartite Matching and Quota Assignment (lecture Β· applied P3 [C,D,HD] credit discussion Β· P7)
- Matching agency (lecture) β men , women , a preference is an edge of capacity Β· capacity , capacity β max flow max number of matches Β· matched pairs middle edges carrying .
- Why FF beats greedy β a greedy pairing stalls at on the lecture example where is possible; a backward edge re-assigns an earlier match to free a partner.
- Quotas β the source edgeβs capacity is how many matches that vertex may take (βif Zach pays moreβ βΉ ) Β· in general supply, demand, how many times that pair may be used.
- matrix with row sums , column sums (P3) β cap Β· cap Β· cap β feasible max flow (every source edge saturated) β Β· the lecturerβs drill , is Β§Applied Β· a 3D version was set on the 2026 S1 D/HD paper.
- Radio songs (P7) β eras genres, cap , cap number of distinct songs in that pair, cap β feasible max flow β how many songs to pick from that pair.
- Integrality is load-bearing β FF on integer capacities returns an integer flow on every edge (Ford-Fulkerson Method Β§5), so a middle edge carries exactly or β a valid matrix entry or match, never a fraction.
- Circulation with demands (applied P3 aside, taught in W12) β demand , demand , no /; the / construction above is exactly that problemβs reduction β Circulation with Demands and Lower Bounds Β§2.
- Minimum path cover of a DAG (W12 applied P2) β cover every vertex with vertex-disjoint paths (single-vertex paths allowed), as few as possible.
- Construction β two copies of , left and right Β· DAG edge βΉ Β· maximum bipartite matching by flow.
- Answer β minimum paths .
- Why β matching to choosing as βs successor Β· capacity on both sides βΉ successor and predecessor per vertex βΉ the chosen edges form disjoint paths Β· unmatched a path end, unmatched a path start βΉ paths ends , minimised by maximising .
4. Disjoint Paths β Unit Capacities (applied P6 Β· [P,C,D,HD] Β· past-year question)
- Edge-disjoint β every edge capacity β max flow maximum number of edge-disjoint β paths.
- Both directions β disjoint paths βΉ send along each βΉ a flow of Β· an integral flow of on unit edges βΉ trace paths from , each using its own saturated edges Β· a vertex carries at most paths, matching its flow limit.
- Vertex-disjoint (P6c) β add vertex capacity to every , then split as in Β§2 β without the split a vertex still carries as many paths as its degree allows.
5. Min Cut as a Cheapest Two-Way Split (W11 applied P4 [C,D,HD] credit discussion Β· W12 applied P3, P5)
- Problem β each job runs on computer or at known costs; related pairs on different computers pay a penalty β minimise total cost.
- Construction β cap cost on computer-s Β· cap cost on computer-t (the sheetβs computers and ) Β· each related pair gets two edges and , cap penalty.
- Why min cut min cost β every β cut puts each job on one side and pays: cuts (computer-s cost) Β· cuts (computer-t cost) Β· a related pair split across the cut cuts exactly one of its two edges (the one) βΉ penalty paid once.
- Read-off β reversed β a job runs on the computer whose edge is cut βΉ side βΉ computer-t, side βΉ computer-s Β· minimum cost max flow value Β· the sides come from residual reachability (Min-Cut Max-Flow Theorem Β§5) Β· in class the lecturer reads saturation instead (the jobβs saturated terminal edge) β same answer whenever exactly one of its two terminal edges is full Β· worked on the lecturerβs network in Β§Applied.
- Why two opposite edges β one edge only charges when , ; the reverse split would be free.
- edge hard constraint β an edge of capacity never crosses in a finite min cut βΉ β chosen βΉ chosenβ Β· of pins to .
- Project selection (W12 P3) β cap for profit Β· cap for profit Β· cap when is a prerequisite of .
- Read-off β side projects done, side skipped Β· a profitable drags every prerequisite into through the edges.
- What the cut pays β cost of unprofitable projects forced into (their ) profit given up on profitable projects left in (their ).
- Answer β max profit with the min cut.
- Land fencing / segmentation (W12 P5) β cells ending as ground, cells ending as holes Β· boundary cell cap (may never become a hole) Β· other ground cell cap Β· hole cap Β· each adjacent pair gets two opposite edges cap β minimum cost min cut max flow.
- Why no double count β a separated pair has exactly one of its two edges going , and a cutβs capacity counts only those.
- Same shape as the job split β two terminal costs per item a penalty per separated neighbour pair β the lectureβs βimage segmentationβ application.
βοΈ Complexity
FF costs on the built network; the construction is .
| Construction | Bound on | Total | ||
|---|---|---|---|---|
| Super source/sink | sourcessinks | unchanged | ||
| Vertex split | unchanged | |||
| Matching, | ||||
| matrix | ||||
| Edge-disjoint paths | ||||
| Job split, jobs, pairs | (cut ) | , pseudo-polynomial | ||
| DAG path cover | ||||
| Project selection, projects, prerequisites | (cut ) | , pseudo-polynomial | ||
| Fencing, grid | (cut ) | , pseudo-polynomial |
βοΈ Core Decision Matrix
| Cue in the question | Construction | Answer read-off |
|---|---|---|
| βseveral sources / sinksβ | super , (Β§1) | flow value |
| βeach node can handle at most β | split cap (Β§2) | flow value |
| βpair items from two groups, each used once / timesβ | , quotas on the outer edges (Β§3) | middle edges with flow |
| βexactly per row / per categoryβ | outer edges quotas (Β§3) | feasible quotas |
| βpaths sharing no edge / no vertexβ | unit capacities, split for vertices (Β§4) | flow value path count |
| βassign each item to one of two options, penalty when related items splitβ | , , paired penalty edges (Β§5) | min cut sides, value cost |
| βchoose a subset for max profit, prerequisites must holdβ | profits from , costs to , prerequisite edges (Β§5) | side; profit min cut |
| βfewest vertex-disjoint paths covering a DAGβ | per edge, matching (Β§3) | |
| βat least β on a link, or fixed supplies and needs | Circulation with Demands and Lower Bounds | feasible super-edges saturated |
When It Flips: the question asks how much / how many βΉ read the max-flow value Β· asks which assignment βΉ read the edge flows Β· asks which side / which option βΉ read the min cut.
π Exam Execution Trace & Applied Exercises
Applied Exercise β matrix, feasible and infeasible
Problem: (i) the lecturerβs drill , Β· (ii) , . Decide each by max flow.
Final Extracted Output: (i) feasible β every and saturated, matrix read off the middle edges (other max flows give other valid matrices) Β· (ii) infeasible β column needs two s but only row has any, and a cell holds at most one ; the unsaturated is the evidence.
Applied Exercise β supercomputer network (W11 applied P4, the lecturerβs diagram)
Problem: , , (computer-s costs) Β· , , (computer-t costs) Β· and at (split penalty). Find the minimum cost and the assignment, then say how changes it.
Final Extracted Output: minimum cost Β· , on computer-t () Β· on computer-s () Β· split penalty Β· saturation agrees: , , are the full terminal edges.
When It Flips: keeps and apart (cost ) Β· forces them together β both on computer-t () or both on computer-s (), either way βΉ total Β· ties Β· stays on computer-t for every , since and it has no penalty edge.
β οΈ Common Mistakes
- π‘ Stopping at βrun max flowβ β feasibility questions need the test β quotasβ and the read-off; without them the answer earns half.
- π‘ Job allocation sides swapped β side runs on computer-t: a job in pays through its cut edge.
- π‘ One edge per related pair β penalties then charge only one direction of split; use two opposite edges.
- π‘ Vertex-disjoint without the split β unit edge capacities alone still let several paths share a vertex.
- π‘ Project selection: min cut reported as the profit β the cut is what you lose; profit .
- π‘ Prerequisite edge reversed β β is a prerequisite of β is (doing forces ), never .
π§ Active Recall
Why does the matching / -matrix reduction need FF's integrality, and what goes wrong without it?
Answer
- Short answer: the answer is read off individual edge flows, which must be or ; FF on integer capacities guarantees integer flows.
- Why: A max flow value alone is not a matrix β needs each middle edge to carry a whole unit. Integer capacities βΉ integer bottlenecks βΉ integer flows β every augment adds a whole number, so every edge stays integral (Ford-Fulkerson Method Β§5). A fractional flow β of the same value could split across two cells and correspond to no matrix.
How many edge-disjoint β paths, and in what time? (applied P6)
- Hint: what caps the flow out of ?
Answer
- Short answer: unit capacities, max flow path count, .
- Why: Flow paths β each unit of integral flow follows its own capacity- edges from to . β the cut has capacity . FF β with that .
Why "transform the input" instead of modifying Ford-Fulkerson for vertex capacities?
Answer
- Short answer: the transformation keeps FF a black box, so its correctness proof transfers; a modified FF would need a new proof.
- Why: One obligation instead of two β show the split networkβs max flow equals the originalβs β every unit through crosses , so the vertex limit is exactly an edge limit. Same move as BFSβs super source β State-Space Graph Modelling Β§5.
Project selection (W12 P3): why do the edges enforce prerequisites, and how is profit recovered from the cut?
Answer
- Short answer: an edge never crosses in a min cut, so a chosen projectβs prerequisites are chosen too; profit .
- Why: cap β , would cost , never minimal βΉ . The cut charges exactly the losses β forced unprofitable projects cut their , abandoned profitable projects cut their . Min cut min loss β subtracted from the best case it leaves the max profit.