Tutorials › Graph Theory (Undergraduate) › Modeling Capacity-Constrained Flow Networks

Network Flows and the Max-Flow Min-Cut Theorem · Tutorial 209 of 799

Modeling Capacity-Constrained Flow Networks

Model a capacity-constrained system as a directed network, then assign and verify a feasible flow.

Advanced 10 min read

What You'll Learn

  • Define a directed flow network with distinct source and sink.
  • Distinguish a permitted direction of travel from a physical connection that works both ways.
  • Translate routes, capacities and units into vertices, arcs and capacity constraints.
  • Check a proposed flow arc by arc and at each intermediate vertex.
  • Recognize when a capacity assumption cannot be represented by independent arc limits.
  • Prove that zero flows and convex combinations of feasible flows are feasible.

From a Physical System to a Directed Network

A network model separates two questions: which movements are permitted, and how much can move along each permitted route. Vertices represent locations or states where flow can enter, leave or be transferred. Directed arcs represent allowed movements. A capacity on an arc gives its maximum permitted flow. The model is useful only when its directions, units and capacity assumptions match the system being described.

For example, a one-way delivery route should be represented by one directed arc, not by an undirected edge. A route available in both directions can be represented by two oppositely directed arcs if the capacity limit applies separately in each direction. If the two directions share one combined capacity, independent arc limits do not express that assumption; the model must include an additional shared constraint or use a different representation.

Definition: A directed flow network is a finite directed graph \(G=(V,A)\), two distinct vertices \(s,t\in V\) called the source and sink, and a capacity function \(c:A\to[0,\infty)\). Each arc \(a\in A\) has a specified direction and a nonnegative capacity \(c(a)\). A flow is a function \(f:A\to[0,\infty)\) satisfying \(f(a)\le c(a)\) for every arc \(a\), and satisfying flow conservation at every vertex \(v\in V\setminus\{s,t\}\): the sum of the flows on arcs entering \(v\) equals the sum on arcs leaving \(v\). No conservation condition is imposed at \(s\) or \(t\).

Capacities and flows must use compatible units. If capacity is measured in packages per hour, every value \(f(a)\) is also a rate in packages per hour. A capacity is an upper bound, not a requirement that the arc carry that amount. Capacity zero means that no positive flow can use the arc. An arc absent from the graph is not an allowed movement at all.

To build a model, first choose the system boundary and identify its source and sink. Then represent the intermediate locations or transfer points by vertices, and add an arc for each permitted direction of movement. Finally, assign each arc a capacity and state what that capacity means. Check that the units agree and that the conservation condition fits the system: it assumes that intermediate vertices do not create, destroy or store flow during the modeled period.

Reading the Definition

The directed graph specifies the network’s structure; the capacity function specifies its limits. If an arc \(uv\) is present, flow may go from \(u\) to \(v\), up to \(c(uv)\). That fact alone says nothing about movement from \(v\) to \(u\): reverse movement requires a separate arc \(vu\). Separate arcs can have different capacities, including capacity zero in one direction.

At a vertex other than \(s\) and \(t\), conservation says that the amount arriving equals the amount departing. It does not say that each incoming arc must be paired with a particular outgoing arc. The flow is an assignment to arcs, constrained by their capacities and by the sum of incoming and outgoing amounts at each intermediate vertex.

The source and sink are designated as the endpoints of the overall transfer. Their net supply and receipt are not needed to define whether an assignment is a flow. In particular, this tutorial does not optimize a flow or compare it with a cut; here the task is to build the network correctly and check assignments against its definition.

Worked Example: Deliveries Through Two Warehouses

A depot \(s\) ships packages through warehouses \(A\) and \(B\) to a destination \(t\). The route \(A\to B\) is permitted, but there is no route \(B\to A\). Let \(V=\{s,A,B,t\}\) and let the arc set be \(A_G=\{sA,sB,AB,At,Bt\}\). The capacities, measured in packages per hour, are \(c(sA)=8\), \(c(sB)=5\), \(c(AB)=3\), \(c(At)=6\), and \(c(Bt)=7\).

Consider the assignment \(f(sA)=6\), \(f(sB)=4\), \(f(AB)=2\), \(f(At)=4\), and \(f(Bt)=6\). Check the capacity limits individually: \(6\le8\) on \(sA\), \(4\le5\) on \(sB\), \(2\le3\) on \(AB\), \(4\le6\) on \(At\), and \(6\le7\) on \(Bt\).

At warehouse \(A\), the incoming flow is \(f(sA)=6\), and the outgoing flow is \(f(AB)+f(At)=2+4=6\). At warehouse \(B\), the incoming flow is \(f(sB)+f(AB)=4+2=6\), and the outgoing flow is \(f(Bt)=6\). Both intermediate vertices conserve flow, so this is a feasible flow under the stated capacities.

Check: all five assigned values are nonnegative and satisfy their respective upper bounds, and the incoming and outgoing totals agree at both warehouses. The model includes \(A\to B\) but not \(B\to A\), matching the stated one-way route.

Modeling Communication Links

In a communication network, direction is especially important: a link that transmits data from \(x\) to \(y\) need not transmit data in the reverse direction. The capacity might represent the maximum data rate available on that directed link. If the real system has shared bandwidth, a modeling choice is needed to say whether the limit applies per direction or to both directions together.

Worked Example: A Directed Communication Network

Let \(V=\{p,x,y,q\}\), with source \(p\), sink \(q\), and arc set \(A_G=\{px,py,xy,xq,yq\}\). There is no arc \(yx\). The capacities, in megabits per second, are \(c(px)=4\), \(c(py)=3\), \(c(xy)=2\), \(c(xq)=3\), and \(c(yq)=4\).

Assign \(f(px)=3\), \(f(py)=2\), \(f(xy)=1\), \(f(xq)=2\), and \(f(yq)=3\). The capacity checks are \(3\le4\), \(2\le3\), \(1\le2\), \(2\le3\), and \(3\le4\), respectively. At \(x\), the incoming total is \(3\), and the outgoing total is \(1+2=3\). At \(y\), the incoming total is \(2+1=3\), and the outgoing total is \(3\). Thus the assignment is feasible.

Check: the flow on \(xy\) is allowed because the arc \(xy\) is present; the same assignment cannot send flow from \(y\) to \(x\), because \(yx\) is not an arc. The values at \(x\) and \(y\) each balance, and every arc value is within capacity.

Modeling Production Through a Transfer Point

A vertex can represent any intermediate stage where material is transferred, not just a geographic location. For instance, an assembly station may receive components from one process and send them to several later processes. If the station can hold inventory during the modeled period, the equality of incoming and outgoing flow may not describe the system; conservation is appropriate when the model treats the station as having no net accumulation during that period.

Worked Example: Production with a Transfer Stage

Let \(s\) represent the initial production stage, \(c\) a transfer stage, \(d\) a secondary stage, and \(t\) the completed-product destination. Set \(V=\{s,c,d,t\}\) and \(A_G=\{sc,cd,ct,dt\}\). The capacities, in units per day, are \(c(sc)=5\), \(c(cd)=2\), \(c(ct)=4\), and \(c(dt)=3\).

Set \(f(sc)=4\), \(f(cd)=1\), \(f(ct)=3\), and \(f(dt)=1\). The four capacity checks are \(4\le5\), \(1\le2\), \(3\le4\), and \(1\le3\). At \(c\), the incoming total is \(4\), and the outgoing total is \(1+3=4\). At \(d\), the incoming total is \(1\), and the outgoing total is \(1\). Therefore the assignment satisfies the flow conditions.

Check: each arc carries a nonnegative amount no greater than its capacity, and both intermediate stages balance. The model also makes explicit that flow sent along \(cd\) must continue through \(dt\), since \(d\) has no other outgoing arc.

Two Basic Facts About Feasible Flows

Before analyzing or optimizing flows, it is helpful to know that the definition is consistent and stable under simple operations. These facts also clarify what the constraints permit: zero flow is always an option, and averaging feasible assignments on the same network preserves feasibility.

Proposition: Every directed flow network has a feasible zero flow. If \(f\) is a feasible flow on a network and \(0\le\theta\le1\), then the assignment \(g(a)=\theta f(a)\) is also a feasible flow on that network.

Proof. Define \(f_0(a)=0\) for every arc \(a\). Since each capacity satisfies \(c(a)\ge0\), we have \(0\le f_0(a)\le c(a)\). At every intermediate vertex, both the incoming and outgoing sums are zero, so they are equal. Thus \(f_0\) is feasible. Now let \(f\) be feasible and \(0\le\theta\le1\). For each arc \(a\), \(f(a)\ge0\) implies \(g(a)=\theta f(a)\ge0\), and \(f(a)\le c(a)\) implies \(g(a)\le f(a)\le c(a)\). At any intermediate vertex, multiplying the equality between the incoming and outgoing sums for \(f\) by \(\theta\) gives the corresponding equality for \(g\). Therefore \(g\) is feasible. \(\square\)

Theorem: For a fixed directed flow network, a convex combination of two feasible flows is feasible. That is, if \(f_1\) and \(f_2\) are feasible and \(0\le\theta\le1\), then \(h(a)=\theta f_1(a)+(1-\theta)f_2(a)\) defines a feasible flow.

Proof. Fix any arc \(a\). Both flows are nonnegative, so \(h(a)\ge0\). Since \(f_1(a)\le c(a)\), \(f_2(a)\le c(a)\), and both coefficients are nonnegative, we have \(h(a)\le\theta c(a)+(1-\theta)c(a)=c(a)\). Now fix an intermediate vertex \(v\). For each of \(f_1\) and \(f_2\), the incoming sum equals the outgoing sum at \(v\). Multiplying the first equality by \(\theta\), the second by \(1-\theta\), and adding them shows that the incoming sum for \(h\) equals its outgoing sum. Thus \(h\) satisfies every capacity and conservation condition and is feasible. \(\square\)

The theorem is useful when quantities are divisible or represent average rates: mixing two feasible operating patterns does not violate any capacity or conservation equation. It relies on using the same network and capacity function for both flows. It does not say that adding two feasible flows always gives another feasible flow, because their combined use of an arc could exceed its capacity.

Common Modeling Mistake: A Shared Two-Way Capacity

Suppose a road permits travel in both directions and can carry at most \(10\) vehicles per hour in total. A tempting model adds arcs \(u\to v\) and \(v\to u\), each with capacity \(10\), and assigns \(8\) vehicles per hour to each direction. The individual checks \(8\le10\) pass, but the road would carry \(8+8=16\) vehicles per hour, exceeding its shared limit of \(10\).

The correction is to state what “capacity \(10\)” means before choosing the arcs. If the road has capacity \(10\) in each direction independently, the two arcs each having capacity \(10\) is appropriate. If \(10\) is a combined two-way limit, the two independent arc bounds do not encode the real restriction; the model needs the additional condition \(f(uv)+f(vu)\le10\), or a representation that enforces that shared resource limit.

More generally, an arc capacity constrains one directed movement. It does not automatically constrain a collection of arcs that share a physical resource. A good model records both the physical interpretation of every capacity and the mathematical constraint that represents it.

Check Your Understanding

For each question, write down the network assumptions as well as any numerical checks.

  1. Let \(V=\{s,a,t\}\) and \(A_G=\{sa,at\}\), with capacities \(c(sa)=7\) and \(c(at)=5\). Is the assignment \(f(sa)=5\), \(f(at)=5\) feasible? Check the arc bounds and the intermediate vertex.
  2. A link carries data from \(x\) to \(y\) at a rate of at most \(12\) units per second. What must be added to the graph to permit transmission in the reverse direction?
  3. Explain why the assignment that sends zero units on every arc is feasible, including when some arc capacities are zero.
  4. Two flows on the same network are feasible. Why does their average satisfy the capacity constraints and conservation at every intermediate vertex?
  5. A two-way route has a combined capacity of \(9\) units per hour. Explain why assigning capacity \(9\) independently to each directional arc may give an incorrect model.