Directed Graphs and Tournaments
A directed graph (digraph) has a vertex set and a set of arcs, each an ORDERED pair with , also written . The out-degree counts arcs leaving ; the in-degree counts arcs entering . Summing over all vertices,
A tournament on vertices is a digraph whose underlying graph is : between every pair, exactly one of or is present.
Topic 1's handshake lemma said every edge adds to a single running total; here every arc instead adds to two separate totals, one tail and one head, which is why and need not agree at any one vertex even though their grand totals over the whole digraph always do. Topic 1 modeled a round robin as the undirected graph , recording only who played whom; a tournament keeps that same complete underlying graph but orients every edge toward the loser, recording who BEAT whom. The adjacency matrix of a digraph drops the symmetry Topic 1 relied on ( need no longer equal ), but still counts directed walks of length from to by the identical argument.
Let have vertices and arcs , , , , — arcs. Reading off each vertex: (to and ), , , , summing to ; and (from and ), , , , also summing to . Vertex touches arcs in all, leaving and entering.
Four teams play a round robin with results , , , , , (an arrow points from winner to loser). This uses every one of the pairs exactly once, so it is a genuine tournament. The score of a team is its out-degree (wins): , , , . The score sequence sums to , as it must: every game contributes exactly one win.
Does the tournament above have a Hamiltonian path — a directed path visiting all teams, each exactly once, always moving winner-to-loser? Try : it uses the arcs , , , all present, and visits every team exactly once. So yes — and in fact every tournament has a Hamiltonian path, however its games fall, unlike a general digraph (contrast Topic 6's search for Hamiltonian cycles in undirected graphs, which can fail outright).
A high score tempts you to assume that team beats everyone, but tournaments need not be transitive. Three teams with , , form a -cycle: every team has score , tied for the lead, yet no team beats both of the others — beats but loses to . A perfect round robin can still have no team that beat everybody.
In the -team tournament above, a fifth team joins and loses to everyone: it adds the arcs and nothing else. What is now, and what is the new score sequence's sum?
Show the answerHide the answer
Team 's old wins over and still stand, and it now also beats , so . The new tournament has games, so every valid score sequence on teams sums to .
Strong Connectivity
Vertices of a digraph are mutually reachable if has a directed path AND a directed path. is strongly connected if every pair is mutually reachable. Mutual reachability is an equivalence relation on (Topic 3 proved the undirected analogue; the proof is identical with "walk" replaced by "directed walk, both ways"), and its classes are the strongly connected components (SCCs) of . Collapsing each SCC to a single point gives the condensation of , which is always a DAG.
Strong connectivity is strictly more demanding than Topic 3's connectivity: a digraph can be weakly connected — its underlying undirected graph is one piece — while still having no way back from some vertices to others. Because mutual reachability is an equivalence relation, the SCCs still partition with no overlaps, exactly as Topic 3's components partitioned an undirected graph's vertices. The condensation being a DAG is what makes it useful: once every strongly-tangled cluster is shrunk to one node, what is left can be processed in a topological order (Topic 5), cluster by cluster, with nothing left to loop back on.
Let have vertices and arcs , , , , , — a -cycle on feeding into a -cycle on . Inside the -cycle, gives a path from to and the single arc gives one back, so and are mutually reachable, and likewise every pair in ; the same argument makes and mutually reachable via their -cycle. So has (at least) two strongly connected components, and .
Is there a directed path from back to in ? Every arc leaving stays inside ( and are the only arcs with tail in ), so no walk starting at can ever reach , or . Hence is NOT strongly connected, and , really are two separate SCCs, not one — confirming the only arc joining them, , runs one way.
Collapsing to a single vertex and to another leaves exactly one arc between them, (coming from ), and no arc the other way. A digraph on vertices with only one of the two possible arcs present has no directed cycle, so the condensation is a DAG, and is already a valid topological order of it (Topic 5).
Weakly connected does not mean strongly connected. The directed path has a connected underlying undirected graph — you can get from any vertex to any other IGNORING arrows — yet it is not strongly connected: cannot reach at all, since every arc points forward. Here every vertex is its own SCC, components in all, despite the whole digraph being one piece if the arrows are erased.
Find the strongly connected components of the digraph on with arcs , , , .
Show the answerHide the answer
and are mutually reachable ( and ), so they share an SCC; has an arc out to but nothing comes back from to or from to , so and are each alone. The SCCs are — components in all.
Networks and Flows
A flow network is a digraph with a nonnegative capacity on every arc, a source (no arcs enter it) and a sink (no arcs leave it). A flow assigns every arc a number with (i) and (ii) conservation: for every , — inflow equals outflow. The value is the net flow out of , .
A capacity is a pipe width, not a requirement: a flow may use anywhere from up to on each arc, so long as every intermediate vertex passes on exactly what it receives, with nothing created or destroyed partway through the network. Conservation at is the discrete version of "what flows in must flow out" at a junction; only (where flow originates) and (where it is absorbed) are exempt. Because conservation holds everywhere else, the total that leaves cannot vanish into thin air, so it must all arrive at — the next two sections put this single idea to work.
Network has source , sink , and vertices in between, with capacities , , , , , , — arcs in all. This network, and no other, is used for the rest of this topic.
Try , , , , , , . Every value is within its arc's capacity. Check conservation: at , in , out ; at , in , out ; at , in , out . All three balance, so is a valid flow, with value .
A flow need not use every arc: send , , , and . Conservation holds trivially at () and at and ( each), so this is a valid flow too, with value — smaller than the value- flow above. Flows are not unique, which raises the question the next two sections answer: how do you know when a flow is as large as possible?
The value of a flow is the net amount leaving , NOT the sum of every arc's flow. For the value- flow above, adding every entry gives , not — that sum double-counts flow that passes through , and on its way from to . Only the arcs actually leaving the source count toward .
In , is , , , , , , a valid flow? If so, what is its value?
Show the answerHide the answer
Capacities all hold (, , , , , , ). Conservation: at , ; at , ; at , . All balance, so it is a valid flow, with value .
The Max-Flow Min-Cut Theorem
An - cut is a partition with , . Its capacity is
— summing ONLY arcs leaving , never arcs entering it. Weak duality: for every flow and every cut . The max-flow min-cut theorem (Ford-Fulkerson, 1956) sharpens this to equality: the maximum value of a flow equals the minimum capacity of an - cut.
Weak duality is nearly obvious: every unit of flow leaving must eventually cross from to to reach , since it starts in and ends in , so the flow can never exceed the total capacity available for crossing. The theorem's content is that this bound is always tight — not just an upper limit, but a target some flow actually reaches — which is exactly the capacity-weighted generalization of Menger's theorem from Topic 3 (there, every arc had capacity and "flow" meant counting disjoint paths). "Why It Works" below proves both halves in full, including why the easy direction here mirrors the easy direction Topic 3 already proved.
Take , . The only arcs leaving are and , so . By weak duality, NO flow in can have value above — and the flow of value found in the last section meets this bound exactly, so that flow is already maximum, and is a minimum cut.
Take , instead. Arcs , and are internal to and do not count; the arcs leaving are , and , giving — the SAME capacity as the first cut. A minimum cut need not be unique: has (at least) two different cuts, both achieving capacity , matching the max flow value found earlier.
Take , . The arcs leaving are (since ), and , giving . Since , this cut is valid but NOT minimum — weak duality still holds (), it just is not tight for this particular .
Cut capacity counts only arcs from to , never arcs from back into . Take , : the correct crossing arcs are , and , giving . The arc runs from into and must be left out; including its capacity by mistake would give the wrong total .
In , find for , .
Show the answerHide the answer
The only arcs leaving are and (every other arc has both ends inside ), so — above the minimum of , consistent with weak duality.
Augmenting Paths
Given a flow , the residual graph has, for every arc with , a FORWARD residual arc of capacity ; and for every arc with , a BACKWARD residual arc of capacity , which undoes flow already sent. An augmenting path is any - path in . Ford-Fulkerson: while an augmenting path exists, push flow equal to its bottleneck (minimum residual capacity) along it, then repeat.
A forward residual arc is the obvious idea — spare capacity still available on an untouched or partly-used arc — but the backward arc is the crucial second idea: it lets the algorithm reroute flow that an earlier, greedy-looking choice sent the "wrong" way, by treating already-sent flow as something that can be partially refunded and redirected. Without backward arcs, a path search can get stuck short of the maximum, as the sidenote below shows concretely. With them, "Why It Works" proves that stopping only when no augmenting path remains always means the flow found is already maximum.
Network has with every arc capacity : , , , , . Push unit along (bottleneck ): now , each saturated. The residual graph still has (capacity , unused) and (capacity , unused) — but also, since , a BACKWARD arc of residual capacity . The augmenting path uses exactly that backward arc, pushing more unit.
Pushing unit along sets and directly, while traveling the backward arc DECREASES by , from down to . The final flow is , , , , — every arc still within capacity, conservation holds at () and at () — with value . This matches the cut , of capacity , so is in fact the maximum.
Run Ford-Fulkerson on from scratch. Path : bottleneck , pushing . Path : residual is the bottleneck, pushing . Path : residual and give bottleneck , pushing . Path : residual , , give bottleneck , pushing . Every arc is now saturated except ( of ), and no augmenting path remains: 's two arcs are both saturated and nothing enters , so the set reachable from in the residual graph is just . The final value is , exactly the cut 's capacity found earlier.
Searching only FORWARD arcs, never backward residual arcs, can get stuck below the true maximum. In above, after pushing unit along , a forward-only search from reaches (via the unused arc ) but then finds 's only forward arc, , already saturated — a dead end, with unreached. Forward-only search stops at value , missing the backward-arc path that reaches the true maximum of .
In the construction above, after only the first augmenting path (, bottleneck ), what is the next augmenting path and its bottleneck?
Show the answerHide the answer
After that one path, is untouched (residual ), is untouched (residual ), and has residual . The path has bottleneck — matching the second step carried out above.
Why It Works
Fix a flow and a cut . For every vertex , conservation gives ; for this difference is exactly by definition (no arc enters , so the second sum is ). Summing this difference over every therefore collapses to alone, since every other than contributes :
Now expand the right side arc by arc. An arc with both ends in contributes (from 's outflow term) and (from 's inflow term), canceling exactly. An arc from into contributes only (from its head's inflow term, since its tail is not in ). An arc from into contributes only (from its tail's outflow term). An arc with both ends in contributes nothing at all. So
using for the first inequality and for the second.
Let be a flow with NO augmenting path in its residual graph (Ford-Fulkerson has stopped). Let be the set of vertices reachable from in , and . Since no augmenting path exists, , so is a genuine - cut. Take any arc with , : if , the forward residual arc would make reachable from (through ), contradicting ; so every such arc is SATURATED, . Take any arc with , : if , the backward residual arc would make reachable from (through ), contradicting ; so every such arc carries . Plugging both facts into the identity proved above,
Now let be any MAXIMUM flow and any MINIMUM cut. Weak duality gives (this is a flow, this a cut) and also (this a flow, that cut a cut); combined with (f is merely a flow) and (that cut is minimum), the chain
squeezes every term equal. So : itself is already maximum, is already minimum, and both equal the common value — proving the theorem. For integer capacities this also shows Ford-Fulkerson halts: each augmentation raises the integer value by at least , bounded above by the finite number , so only finitely many augmentations are possible before no path remains.
Topic 3 (Walks, Paths and Connectivity) proved only the EASY half of Menger's theorem: that the minimum size of an edge set separating from in an undirected graph is AT LEAST the maximum number of pairwise edge-disjoint - paths. Max-flow min-cut now supplies the missing half. Build a digraph from by replacing every undirected edge with two arcs, and , each of capacity ; this is a flow network with source , sink . Every - cut of has exactly equal to the number of edges of crossing between and : a crossing edge with contributes only its arc to the cut (its reverse arc runs to and is excluded), so it contributes capacity exactly , and no other arcs cross. So the minimum cut capacity in equals the minimum edge-cut size separating in . By the max-flow min-cut theorem, has a flow of value exactly . Since every capacity is the integer , such a flow can be taken integer-valued (the augmenting paths built one at a time in the proof above only ever add or subtract whole units), so on every arc. Peel unit - paths off this flow one at a time: while , some arc leaves with ; walk forward along arcs carrying flow (conservation guarantees each intermediate vertex you enter has some arc of flow still leaving it, since inflow outflow there) until reaching or revisiting a vertex. A repeated vertex marks a directed cycle entirely inside the flow; subtracting from every arc of that cycle leaves a smaller valid flow of the SAME value (a cycle contributes equally to every vertex's in- and out-flow, so removing it never breaks conservation), so discard it and resume walking. Eventually the walk reaches , giving one directed - path along unit-flow arcs; subtract from each of its arcs (now a valid flow of value exactly one less) and repeat. This terminates after extracting exactly directed - paths. If any two of these paths used opposite arcs of the same edge, in one and in another, cancel that pair first (drop both arcs from both paths, splicing the paths' remaining pieces back together where needed) — a standard fact about maximum flows is that no edge needs both directions used at once, since canceling an opposing pair of unit flows preserves every vertex's conservation and never decreases the value, so a value- flow using no edge in both directions always exists. With that preprocessing done, each of the paths uses a distinct set of underlying edges of , so they are pairwise EDGE-DISJOINT - paths in . This exhibits disjoint paths where is the minimum edge-cut size, so the maximum number of edge-disjoint paths is AT LEAST ; combined with Topic 3's easy direction (at most ), the maximum equals exactly — the hard direction of Menger's theorem.
Menger's VERTEX version replaces edge-disjoint paths and edge cuts with INTERNALLY vertex-disjoint paths and vertex cuts (sets of vertices, other than , whose removal separates them). It follows the same way, after one extra construction. Split every vertex into two copies, and , joined by a single internal arc of capacity — this arc is the only way to "use" at all, so saturating it models visiting once. Every original edge becomes arcs and , each of capacity (or any number at least as large as the whole graph, since only the internal arcs are meant to bottleneck anything). A unit flow from to in this network corresponds to a path through that uses each intermediate vertex's internal arc at most once — exactly an internally vertex-disjoint path when many such units are combined — and a minimum cut, which (one can check) is always forced to consist entirely of internal arcs , corresponds exactly to a minimum vertex separator. Running the same max-flow min-cut argument on this split network gives: maximum number of internally vertex-disjoint - paths equals minimum vertex-separator size — Menger's theorem for vertices.