Ford-Fulkerson Method

Context: FIT2004_MOC · the W11 max-flow engine — repeatedly find an path in the residual network by DFS and push its bottleneck · proved optimal by the Min-Cut Max-Flow Theorem · reused unmodified by every reduction · PT-03: run max-flow/min-cut by hand, from a blank or a mid-stage network Parent Framework: Graph

Quick Revision

  • 🎯 Objective: ➔ while the residual network has an path, push its bottleneck and update both edge directions ➔ no path left ⟹ the flow is maximum.
  • 📦 Core Components: flow network (capacities two constraints) | residual network (forward spare, backward cancellable) | augmenting path ( BFS/DFS) | iterations ⟹ .
  • ⚡ Key Constraint: the backward edge is the whole method — pushing only along unused capacity sticks at on the lecture graph; cancelling units on reaches . And is pseudo-polynomial: is a value, not an input size.

📝 How It Works

1. The Flow Network and Its Two Constraints

  • Flow network ➔ directed graph, every edge weighted by a non-negative capacity · source has no incoming edges · target has no outgoing edges.
  • Flow ➔ , drawn f/c on the edge; an edge carrying nothing may be drawn as bare .
  • Capacity constraint ➔ — “you can’t overload”.
  • Flow conservation ➔ every : · lecture check at : in , out .
  • Value ➔ net flow out of net flow into (equal by Min-Cut Max-Flow Theorem §2, applied P1).
  • Max-flow problem ➔ find a valid maximising · the value is unique, the assignment is not (the lecture’s run and MUA’s slides both reach with different edge flows).

2. The Residual Network (a.k.a. potential network)

  • Same vertices, edges re-derived from the current flow ➔ for each in :
    • forward / residual edge of capacity ➔ room still unused.
    • backward / reversible edge of capacity ➔ flow already sent that may be cancelled.
  • Drop zeros ➔ a saturated edge has no forward edge; an empty edge has no backward edge.
  • Merge parallels ➔ is simple: (, ) and (, ) give , .
  • Self-check ➔ — the slide’s “sum of the edges between 2 vertices same as the edge capacity”.
  • Reading back off ➔ flow backward weight · capacity forward backward (the W11 sanity-check sheet writes “flow forward” — a slip; forward is ).
  • Size ➔ at most edges ⟹ built in .

3. Path Augmentation

  • Augmenting path ➔ any path in , found by BFS or DFS (BFS “is the best”) · forward and backward edges are traversed alike — “no discrimination”; they differ only at update time.
  • Bottleneck ➔ residual capacity along the path — the most that fits through every edge.
  • Augment ➔ each path edge: forward ⟹ · backward ⟹ ➔ ➔ refresh both residual directions · per edge — each residual edge holds a pointer to its twin, so no search (§Core Implementation).
  • What a backward edge means in ➔ re-routing, not reverse flow. Lecture, from : path () uses backward ⟹ drops , sends those to instead, and () refills ‘s lost inflow ⟹ .
  • Why a greedy push fails ➔ the direct route needs (already ) — “we can’t, over capacity”; only the cancellation finds the extra .

4. The Method

  • Loop ➔ build ➔ while an augmenting path exists: take it, add its bottleneck to the flow, augment ➔ return the flow (lecture ford_fulkerson, slide 120).
  • Invariant ➔ both constraints hold after every augment — the bottleneck never exceeds any residual capacity, and each interior path vertex gains and loses exactly .
  • “Method”, not “algorithm” ➔ path choice is left open; BFS vs DFS changes the iteration count, never the final value (§6).

5. Termination and Correctness

  • Precondition ➔ every capacity is an integer.
  • Termination ➔ integer residuals ⟹ ⟹ rises by per iteration · is bounded (by the capacity out of , or any cut) ⟹ at most iterations.
  • Optimality ➔ termination alone does not prove maximum; that needs the Min-Cut Max-Flow Theorem — the vertices still reachable from form a cut whose capacity equals ➔ its §Proof Blueprint.
  • W3 shape ➔ correctness termination a property at exit, exactly as in Invariant.
  • Integrality bonus ➔ integer capacities ⟹ FF returns an integer flow on every edge — what lets reductions read matchings and entries straight off the flow.

6. Choosing the Path (slides flag as FIT3155 optimisation)

  • Why path choice matters ➔ each iteration adds between and ; increments finish far sooner than
  • Fewest edges ➔ BFS ⟹ Edmonds–Karp ⟹ , independent of (proof in FIT3155) · fewer edges, lower chance of a small capacity on the path.
  • Largest bottleneck ➔ the lecture’s route is a maximum spanning tree — the bottleneck idea from Minimum Spanning Tree §4.

⚙️ Core Implementation

🔹 Ford-Fulkerson with BFS (applied P8) — paired residual edges

⚖️ Complexity

Step / variantTimeAux spaceWhy
Build residual edges
One iterationone BFS/DFS two path walks
Iterations—integer capacities ⟹
FF, any path (DFS) once every vertex lies on an – path
FF with BFS (Edmonds–Karp) is D/HD-level (sketch: §6 🔭)
Unit capacities (Network Flow Reductions §4)
  • Pseudo-polynomial ➔ is a number in the input; capacities near make exponential in the input’s bit-length (Algorithmic Complexity) even though and are tiny.

📊 Exam Execution Trace & Applied Exercises

Lecture graph: , , , , , , , , , .

Manual Execution Trace — lecture trial run from

IterAugmenting path in Residual caps on pathNewly saturated
none — from every exit is saturated——stop

Final Extracted Output: · · · · · · · · all others . The reached set in iteration is the min cut ➔ Min-Cut Max-Flow Theorem §4.

Applied Exercise — prep P1: warm start, one cancellation per round

Problem: , , , , , , , , ⟹ . Residual (a): · · · (cancel ) · · (cancel ) · · · · · · .

Final Extracted Output: · both augments run through a backward edge (, then ) · other paths give other valid final networks ➔ min cut in Min-Cut Max-Flow Theorem §Applied.

⚠️ Common Mistakes

  • 💡 Bottleneck from original capacities ➔ use residual ones: prep has but residual .
  • 💡 Drawing a backward edge into ➔ a backward edge lives only in ; augmenting along it decreases the flow on the real edge, it never creates a reverse edge.
  • 💡 Calling polynomial ➔ it is pseudo-polynomial; the polynomial bound needs BFS ().
  • 💡 Mid-stage start with forward edges only ➔ a PT-03 network that already carries flow usually needs a backward augment; verify by re-running from blank — the max-flow value must match.
  • 💡 “The max flow” ➔ the value is unique, the edge assignment is not — mark schemes accept any valid final network.

🧠 Active Recall