Exercises
ex-ch21-01
EasyState the max-flow min-cut theorem. What does it say about the capacity of a noiseless network for unicast?
The theorem equates two quantities: the maximum flow and the minimum cut.
Statement
For a directed graph with integer edge capacities, source , and sink : .
For unicast, this means the capacity of the network (the maximum rate of information transfer from to ) equals the capacity of the tightest bottleneck (minimum cut). This is achievable by routing alone.
ex-ch21-02
EasyIn the butterfly network with all unit-capacity edges, what is the multicast capacity (rate to both sinks simultaneously)? What is the maximum rate achievable by routing alone?
Each sink has min-cut 2 from the source.
The bottleneck for routing is the shared edge .
Multicast capacity
symbols per time unit. This is achieved by network coding (XOR at node ).
Routing capacity
With routing, the edge can carry either or but not both. One sink receives both bits, the other receives only one. Routing achieves multicast rate 1 (only one bit delivered to both sinks).
The gap: network coding achieves rate 2, routing achieves only rate 1.
ex-ch21-03
EasyCompute the max-flow from to in the following network:
- : cap 5, : cap 4
- : cap 2, : cap 3
- : cap 6
Try sending flow along the two direct paths first, then look for augmenting paths.
Path enumeration
Path 1: , flow = 3 (limited by ).
Path 2: , flow = 4 (limited by ).
Path 3: . Residual on is . has cap 2. has residual . Flow = 2.
Total: .
Verify with min-cut
Cut : cap = . Cut : cap = . Wait: crosses the cut only if counted correctly. vs : edges (4), (2), (3). Total = 9. Cut : cap = . (Not minimum.) Cut : cap = .
Min-cut = 9 = max-flow.
ex-ch21-04
EasyWhy does network coding not help for unicast (single source, single sink) over noiseless networks?
Think about what the max-flow min-cut theorem says about achievability with routing.
Explanation
The max-flow min-cut theorem says that routing alone achieves the unicast capacity (the min-cut). Since the min-cut is also an upper bound for any scheme (including network coding), routing is already optimal.
Network coding can only help when multiple sinks need the same data (multicast), because coding creates packets that are simultaneously useful to different sinks with different side information. For unicast, there is only one sink and no such diversity benefit.
ex-ch21-05
EasyFor a linear network code over , what is the decodability condition at a sink that observes coded symbols with global coding vectors ?
The sink needs to solve a linear system to recover the source symbols.
Decodability
The sink observes for , which can be written as where is the transfer matrix.
The sink can uniquely recover if and only if is invertible over , i.e., in .
Decoding is by Gaussian elimination: , with complexity field operations.
ex-ch21-06
MediumConsider a network with source , three relay nodes , and two sinks . All edges have unit capacity:
(a) What is the multicast capacity?
(b) Design a linear network code over that achieves it.
Compute and separately.
The bottleneck determines the multicast rate.
Part (a): Multicast capacity
: cut gives cap 3, cut gives cap 2 (edges and , but doesn't help ). Actually: receives from and only, so .
: receives from and only, so .
Multicast capacity .
Part (b): Network code
Source produces .
- : (vector )
- : (vector )
- : (vector )
Each relay forwards its received symbol:
- :
- :
- :
- :
: receives , transfer matrix . Trivially decodable.
: receives , transfer matrix , in . Decodable.
Note: the coding happens at the source, not at intermediate nodes. The relays simply forward. The source "pre-codes" by sending on the third edge.
ex-ch21-07
MediumProve the weak inequality in the max-flow min-cut theorem: for any flow and any - cut , .
Use flow conservation to express as the net flow across the cut.
Bound each term using the capacity constraint.
Express flow as net cut flow
By flow conservation at all nodes in : (only contributes a net positive; all other nodes in cancel).
Splitting edges into those within , those from to , and those from to , the internal edges cancel:
Apply bounds
Since for all edges and :
Since this holds for all cuts: . Since this holds for all flows: .
ex-ch21-08
MediumShow that for random linear network coding over with sinks, the probability that all sinks can decode is at least where is the number of edges.
Each edge independently chooses random coding coefficients.
Use the union bound and the Schwartz–Zippel lemma.
Schwartz–Zippel for each sink
For each sink , the determinant of the transfer matrix is a polynomial of degree at most in the random coding coefficients. By Schwartz–Zippel, for a single random evaluation.
All sinks
More carefully: the product is a polynomial of degree at most in the coding coefficients. By Schwartz–Zippel applied to each edge independently:
For each edge , the conditional probability that choosing 's coefficient creates a zero determinant at some sink is at most . Over all edges:
For and , : .
ex-ch21-09
MediumIn a wireless network, nodes A and B want to exchange messages through a relay R. With traditional routing, this requires 4 time slots. Show that network coding reduces this to 3 time slots, and physical-layer network coding reduces it to 2.
Routing: A→R, R→B, B→R, R→A. Can we combine some transmissions?
Network coding: R broadcasts in one slot.
Traditional routing: 4 slots
Slot 1: A sends to R. Slot 2: R forwards to B. Slot 3: B sends to R. Slot 4: R forwards to A.
Network coding: 3 slots
Slot 1: A sends to R. Slot 2: B sends to R. Slot 3: R broadcasts to both A and B.
A knows , so it computes . B knows , so it computes .
The coding at R (XOR) saves one time slot — a 25% improvement.
Physical-layer network coding: 2 slots
Slot 1: A and B transmit simultaneously. R receives . R decodes from the superimposed signal (using lattice decoding or other techniques).
Slot 2: R broadcasts to both A and B.
A and B decode as before. The simultaneous transmission in slot 1 saves another time slot — a 50% improvement over routing.
ex-ch21-10
MediumConsider an index coding problem with 3 receivers: receiver 1 wants and knows , receiver 2 wants and knows , receiver 3 wants and knows .
(a) Can a single broadcast of satisfy all receivers?
(b) What is the minimum number of broadcasts needed?
Check if each receiver can decode from the broadcast plus its side information.
This is a 3-cycle side information graph.
Part (a): Single broadcast
Broadcast .
Receiver 1 knows : . But receiver 1 does not know ! So it cannot decode.
A single broadcast of does not work.
Part (b): Minimum broadcasts
Try two broadcasts: and .
Receiver 1 (wants , knows ): .
Receiver 2 (wants , knows ): .
Receiver 3 (wants , knows ): .
Two broadcasts suffice. Can we do it with one? No — the 3-cycle requires at least 2 broadcasts (the fractional chromatic number of the complement graph is 3/2, so the optimal rate is 2 broadcasts for 3 messages).
ex-ch21-11
MediumShow that for a single-source multicast with sinks, a linear network code over (binary) always suffices.
With , the Schwartz–Zippel condition requires , but we can do better.
Use the fact that there are only 2 transfer matrices to make invertible simultaneously.
Proof
Let . We need to find coding coefficients such that both and are invertible over .
By Menger's theorem, there exist edge-disjoint paths from to and edge-disjoint paths from to . Assign the identity coding along the paths to : this makes (invertible).
Now consider . By Menger's theorem and the edge-disjoint paths, has rank over (the paths to are linearly independent). For , we can always find binary coding coefficients on the shared edges such that is also invertible over .
The formal proof uses the matroid intersection theorem: the intersection of the two graphic matroids corresponding to the two sets of edge-disjoint paths has a common independent set of size over .
For , this argument fails, and larger fields may be needed.
ex-ch21-12
HardProve that the multicast capacity of a single-source network is at most using an information-theoretic argument (entropy bounds), not a graph-theoretic argument.
The source generates i.i.d. symbols per time unit. Each edge carries at most symbols.
Use entropy to bound the information that can cross a cut.
Setup
The source generates uniformly at random. The multicast rate is bits per time unit.
For any sink and any - cut , the information reaching must pass through the edges crossing the cut.
Entropy bound
Let be the vector of symbols on edges crossing the cut . Since , all information reaching is a function of (no information can bypass the cut):
where the second inequality uses data processing (since is a function of ) and the last uses the fact that each edge symbol has entropy at most bits.
Conclude
Dividing by : . Since this holds for all cuts: . Since this holds for all sinks: .
ex-ch21-13
HardGive an example of a network where the cut-set bound for two-unicast is not tight (i.e., the achievable rate region is strictly smaller than the cut-set bound).
Consider a network where the two unicast sessions share a bottleneck edge.
The key is that network coding cannot help when each receiver wants different information.
Construction
Consider the network:
- Sources , sinks , relay
- Edges: (cap 1), (cap 1), (cap 1), (cap 1)
wants , wants .
Cut-set bound
Individual min-cuts: , .
Sum rate: cut gives cap ; cut gives cap . So the cut-set bound allows and .
Achievable region is smaller
Node has two outgoing edges of capacity 1 each. To deliver to , the edge must carry (a function of) . To deliver to , the edge must carry (a function of) .
But has only 2 incoming units of capacity. If and , receives and (2 symbols) and must route to and to . This requires 2 outgoing capacity, which has. So is achievable.
Now modify: add a third sink wanting , with (cap 1). The edge must also carry . But only has 3 total outgoing capacity. If , , then needs to send to both and (2 edges) and to (1 edge) — this requires the full 3 outgoing edges, leaving no room for coding. Network coding ( on one edge) doesn't help because and want different data.
The achievable sum rate is constrained by the need to route different information to different destinations, which the cut-set bound does not capture.
ex-ch21-14
HardImplement the Ford–Fulkerson algorithm for the following network and trace each augmenting path:
- : 10, : 8
- : 5, : 7
- : 3, : 9
- : 10
Start with the zero flow and find augmenting paths using BFS (Edmonds–Karp).
Update the residual graph after each augmenting path.
Iteration 1
Path: , bottleneck = . Push flow 7. Residual: : 3, : 0, : 3.
Iteration 2
Path: , bottleneck = . Push flow 8. Residual: : 0, : 1.
Iteration 3
Path: , bottleneck = . Push flow 3. Residual: : 0, : 2, : 0, : 0.
Termination
No more augmenting paths from to in the residual graph. Total flow = .
Min-cut verification: , cap = . Also , cap = . And , cap = . Min-cut = 18 at .
ex-ch21-15
HardShow that the Dougherty–Freiling–Zeger (2005) result implies that for some multi-source network coding problems, the achievable rate region over is strictly smaller than the achievable region over larger fields, even with nonlinear coding over .
(This is a proof-by-example exercise: describe the Matroid port construction and explain why it requires .)
The Vámos matroid is not representable over any field, but related constructions give non-linear matroids.
The key insight is that some entropy vectors are achievable over larger fields but not over .
Background
A network coding problem can be associated with a matroid through the entropy function of the edge random variables. The achievable rate region depends on which entropy vectors are realizable over the coding field.
Over , the set of realizable entropy vectors is the set of polymatroidal rank functions of -representable matroids. Over , this set is strictly smaller than over or larger fields.
The Dougherty–Freiling–Zeger example
Dougherty, Freiling, and Zeger constructed a network coding instance where the rate vector for three source-sink pairs is achievable over for but not over , even with nonlinear coding.
The construction uses the Fano matroid, which is representable over but not over fields of characteristic , and its dual, the non-Fano matroid, which is representable over fields of characteristic but not over . A carefully designed network requires both representations simultaneously, forcing .
Implication
This shows that the choice of alphabet (field size) fundamentally affects the achievable rate region for multi-source network coding — unlike single-source multicast, where the alphabet only affects the probability of random codes succeeding. For multi-source problems, some rate tuples are inherently impossible over binary alphabets regardless of the coding scheme.
ex-ch21-16
HardConsider a content distribution network with a server holding files and users, each caching file. During the placement phase (before requests are known), each user caches one distinct file: user caches file .
During the delivery phase, each user requests a different file: user 1 wants , user 2 wants , user 3 wants , user 4 wants .
(a) How many uncoded transmissions are needed?
(b) Show that coded delivery (XOR) reduces the number of transmissions.
Uncoded: serve each request individually.
Coded: XOR requests that can be simultaneously useful to multiple users.
Part (a): Uncoded
Each user needs one file it doesn't have. Without coding: transmit separately — 4 transmissions.
Part (b): Coded delivery
Notice the circular structure: user 1 wants (cached by user 2), user 2 wants (cached by user 3), etc.
Transmission 1: . User 1 (has , wants ): needs — cannot decode yet.
Better approach: Transmission 1: . User 4 (has , wants ): cannot decode. User 1 (has , wants ): .
Transmission 2: . User 2 (has , wants ): cannot decode. User 3 (has , wants ): .
Transmission 3: . User 2 (has , wants ): cannot decode.
Actually, with this demand pattern, we can do: : serves user 1 (knows , gets ) and user 4 needs another coded. : serves user 3 (knows , gets ). : user 2 knows ... doesn't help. : user 2 knows , gets . User 4 still needs . From : needs . From : can get if has ... chain.
The minimum with pairwise XOR: 2 transmissions. and :
- User 1 (has , wants ): gets , but doesn't know . This doesn't work either.
The optimal coded scheme: 2 transmissions using the right XORs. and : User 1: has , wants → from : . User 2: has , wants → from : needs . Doesn't help.
Correct: 3 transmissions minimum for this demand pattern with binary XOR of pairs. The coded caching approach (Chapter 27) achieves 2 transmissions for .
ex-ch21-17
Challenge(Research-flavored) The connection between network coding and index coding (El Rouayheb–Sprintson, 2010) shows that any network coding problem can be reduced to an index coding problem. Explain this reduction for the butterfly network: formulate the butterfly multicast problem as an index coding instance and verify that the optimal index code achieves rate 2.
Each edge in the network corresponds to a 'message' in the index coding instance.
The side information at each receiver corresponds to the edges it can 'observe' in the original network.
Reduction
In the butterfly network, the critical edges are those crossing cuts. The index coding formulation creates one "message" per source symbol and assigns side information based on which other source symbols each sink can receive through non-bottleneck paths.
Specifically: the butterfly has source symbols . Sink can receive directly (via ) but needs . Sink can receive directly (via ) but needs .
The equivalent index coding problem: receiver 1 wants and knows ; receiver 2 wants and knows . The optimal index code: broadcast (1 transmission). Receiver 1: . Receiver 2: .
Verification
The total rate: 2 source symbols delivered using the direct paths (2 uses) plus the index-coded broadcast (1 use on the bottleneck edge ). Each sink recovers both symbols. Multicast rate = 2, matching the network coding solution.
The reduction shows that the bottleneck of the butterfly network is precisely the index coding problem on the shared edge , and the XOR solution is the optimal index code for the resulting side information structure.
ex-ch21-18
Challenge(Open-ended) Discuss the practical impact of network coding after 25 years of research (2000–2025). Consider:
(a) Which applications have adopted network coding in practice?
(b) What are the main barriers to wider adoption?
(c) How does coded caching (Chapter 27) relate to network coding?
(d) Is the gap between theory and practice closing or widening?
Successful deployments: Microsoft RLNC in Windows, Steinwurf's Kodo library, coded caching in edge networks.
Barriers: computational overhead, latency, backward compatibility with existing protocols.
Analysis
(a) Practical adoption:
- Content distribution: Microsoft's Avalanche (2005) demonstrated RLNC in P2P, but BitTorrent remained dominant due to simplicity. Steinwurf's Kodo library provides commercial RLNC for storage and streaming.
- Wireless mesh: COPE (MIT, 2006) showed 2–4x gains in testbeds, but limited deployment due to protocol complexity.
- Distributed storage: Facebook's Warm Storage uses erasure codes (related to network coding) for data redundancy.
- 5G and beyond: Coded caching concepts are influencing edge computing architectures for content delivery.
(b) Barriers:
- Protocol inertia: TCP/IP assumes packet-level operations; integrating coding requires cross-layer design.
- Latency: RLNC adds buffering delay ( packet times for decoding).
- Computational cost: GF(256) operations are cheap per-packet but add CPU load at scale.
- Complexity: network coding requires careful management of coding coefficients, linear independence, and recoding at intermediate nodes.
(c) Coded caching connection: Coded caching (Maddah-Ali–Niesen, 2014) is a form of network coding where the "network" consists of a server, edge caches, and users. The placement phase fills caches with uncoded content; the delivery phase uses coded multicast (XOR-like operations) to serve multiple users simultaneously. The coding gain is a direct consequence of the network coding principle: coded packets are useful to multiple receivers with different side information.
(d) Theory-practice gap: The gap is narrowing in specific domains (coded caching, distributed storage) but remains wide for general wireless network coding. The theoretical gains assume idealized models (noiseless links, perfect synchronization, known topology) that are hard to realize in practice. The most impactful legacy of network coding may be the conceptual shift — the idea that intermediate nodes should process data, not just route it — which now permeates edge computing, in-network computing, and programmable networks.