Why Directed Routes Need Balancing
For an undirected network, the Chinese postman problem is to find a least-cost closed route that traverses every edge at least once. In a directed network, each arc has a prescribed direction, so a route that duplicates arcs in the wrong direction can make the imbalance worse. The key is to measure, at each vertex, how many more arcs leave than enter. The extra route must correct that difference, and finding the least-cost correction is a minimum-cost flow problem.
Throughout, consider a finite directed graph whose arcs have positive costs. The graph is strongly connected on the vertices incident with arcs: for each ordered pair of such vertices, there is a directed path from the first to the second. Isolated vertices do not affect a route and may be ignored. This connectivity assumption ensures that a closed route covering all arcs is possible after the degrees are balanced. Repeated traversals are treated as extra copies of arcs, even though the original directed graph is simple.
The total imbalance is zero: each original arc contributes one to an outdegree and one to an indegree, so \(\sum_{v\in V}b(v)=0\). Consequently, total excess outdegree equals total excess indegree. Vertices with excess indegree must send out extra route; vertices with excess outdegree must receive extra route. This direction is important.
The Minimum-Cost Flow Formulation
Let \(c(e)>0\) be the cost of traversing arc \(e\). For each arc \(e\), let \(x_e\) be the nonnegative integer number of extra copies of that arc. The integer condition matters: a route can duplicate an arc only a whole number of times. The extra copies have net outdegree minus indegree \(d^-(v)-d^+(v)\) at each vertex exactly when
Among all such choices, minimize \(\sum_{e\in E}c(e)x_e\). There are no upper capacities: any original arc can be copied as often as needed. The original traversal cost \(\sum_{e\in E}c(e)\) is fixed, so minimizing the extra cost also minimizes the total route cost.
There is also a useful path-based version. Set \(s(v)=d^-(v)-d^+(v)\). Vertices with \(s(v)>0\) are supplies of extra route, and vertices with \(s(v)<0\) are demands. For a supply vertex \(u\) and demand vertex \(v\), let \(D(u,v)\) be the cost of a cheapest directed path from \(u\) to \(v\). The path-based problem sends integer amounts \(y_{uv}\) from supplies to demands, with each supply sending \(s(u)\) units and each demand receiving \(-s(v)\) units, at cost \(\sum_{u,v}D(u,v)y_{uv}\).
Why can the arc-flow and path-based formulations be used interchangeably? A feasible integer arc flow can be decomposed into directed paths from supply vertices to demand vertices, together with directed cycles. One way to see this is to add a temporary source with \(s(u)\) outgoing units to each supply vertex, and a temporary sink receiving \(-s(v)\) units from each demand vertex. At every original vertex the resulting flow is conserved. Trace positive-flow arcs from the temporary source: conservation lets the trace continue until it reaches the sink, after removing any cycle encountered along the way. Subtract one unit along that source-to-sink path and repeat. Any remaining positive flow is balanced and can be removed as directed cycles. Since every arc cost is positive, removing these cycles cannot increase cost. Each supply-to-demand path costs at least \(D(u,v)\). Conversely, sending \(y_{uv}\) units along a cheapest path for each pair gives a feasible arc flow of exactly the path-based cost. Thus the minimum costs agree.
Why the Flow Gives a Postman Route
Proof. First take any closed route traversing every original arc at least once, and let \(x_e\) count its extra traversals of arc \(e\). In a closed route, every vertex is entered as many times as it is left. Therefore the augmented outdegree equals the augmented indegree at each vertex. Subtracting the original degrees gives the balance equation, so these extra traversals form a feasible integer balancing flow. Their cost is the route’s extra cost. The minimum flow cost is therefore no greater than the extra cost of any postman route.
Conversely, take any feasible integer balancing flow and add \(x_e\) copies of each arc \(e\). The balance equation makes the augmented indegree and outdegree equal at every vertex. The augmented directed graph remains strongly connected on its vertices incident with arcs, because it contains the original strongly connected graph. By the directed Euler circuit characterization established in the earlier material on directed Euler circuits, a strongly connected directed graph with equal indegrees and outdegrees has a circuit using every arc exactly once. Apply that result to the augmented graph. Its Euler circuit is a closed postman route, and its extra cost is \(\sum_{e\in E}c(e)x_e\). A minimum-cost flow therefore produces a route of minimum extra cost, proving the equality. \(\square\)
This characterization also gives a practical workflow: compute the degree imbalances, send route from excess-indegree vertices to excess-outdegree vertices along directed paths, and choose the least-cost feasible flow. Then add the corresponding arc copies and use a directed Euler-circuit construction to list the route.
Worked Example: One Unit of Imbalance
Let \(V=\{a,b,c\}\), with directed arcs \(a\to b\), \(b\to c\), \(c\to a\), and \(a\to c\). Their respective costs are \(2,1,3,4\). The graph is strongly connected: the directed cycle \(a\to b\to c\to a\) already reaches all three vertices.
At \(a\), the outdegree is \(2\) and the indegree is \(1\), so \(b(a)=2-1=1\) and \(s(a)=-1\). At \(b\), the outdegree and indegree are both \(1\), so \(b(b)=0\) and \(s(b)=0\). At \(c\), the outdegree is \(1\) and the indegree is \(2\), so \(b(c)=1-2=-1\) and \(s(c)=1\). Thus one unit must travel from \(c\) to \(a\).
The direct path \(c\to a\) costs \(3\). It is the only outgoing arc from \(c\), so every directed path from \(c\) to \(a\) begins with it; because costs are positive, adding a detour cannot be cheaper. Duplicate \(c\to a\) once. The added cost is \(3\), while the original cost is \(2+1+3+4=10\), so the total route cost is \(10+3=13\).
Check: after duplication, \(a\) has outdegree \(2\) and indegree \(2\), \(b\) has outdegree \(1\) and indegree \(1\), and \(c\) has outdegree \(2\) and indegree \(2\). A circuit using every copy is \(a,b,c,a,c,a\); its arc costs sum to \(2+1+3+4+3=13\), as required.
Worked Example: Two Supplies and Two Demands
Let \(V=\{a,b,c,d\}\), with arcs \(a\to b\), \(b\to c\), \(c\to d\), \(d\to a\), \(a\to c\), and \(b\to d\), of respective costs \(2,5,1,1,1,10\). The directed four-cycle makes the graph strongly connected.
Vertex \(a\) has outdegree \(2\) and indegree \(1\), so \(s(a)=-1\). Vertex \(b\) has outdegree \(2\) and indegree \(1\), so \(s(b)=-1\). Vertex \(c\) has outdegree \(1\) and indegree \(2\), so \(s(c)=1\). Vertex \(d\) has outdegree \(1\) and indegree \(2\), so \(s(d)=1\). Hence \(c,d\) each supply one unit, while \(a,b\) each demand one.
The cheapest path costs are \(D(c,a)=2\), using \(c\to d\to a\); \(D(c,b)=4\), using \(c\to d\to a\to b\); \(D(d,a)=1\), using \(d\to a\); and \(D(d,b)=3\), using \(d\to a\to b\). For example, from \(c\) the only first step is \(c\to d\), and from \(d\) the only first step is \(d\to a\); the remaining choices from \(a\) make the stated cheapest paths. Sending \(c\) to \(a\) and \(d\) to \(b\) costs \(2+3=5\). The crossed assignment, \(c\) to \(b\) and \(d\) to \(a\), costs \(4+1=5\) as well. Since each supply and demand is one unit, these are the two possible assignments, so the minimum is \(5\).
For the first assignment, the duplicated paths add one copy of \(c\to d\), two copies of \(d\to a\), and one copy of \(a\to b\). Their cost is \(1+2(1)+2=5\). The original cost is \(2+5+1+1+1+10=20\), giving total cost \(20+5=25\).
Check: the augmented degrees at \(a,b,c,d\) are respectively \(3\) out and \(3\) in; \(2\) out and \(2\) in; \(2\) out and \(2\) in; and \(3\) out and \(3\) in. Every vertex is balanced. The alternative assignment uses the same duplicated arc counts, so it also gives cost \(25\).
Worked Example: Two Units Sent to One Demand
Let \(V=\{1,2,3,4\}\), with arcs \(1\to2\), \(2\to3\), \(3\to4\), \(4\to1\), \(1\to3\), and \(1\to4\), of respective costs \(1,1,4,2,1,1\). The directed four-cycle ensures strong connectivity.
Vertex \(1\) has outdegree \(3\) and indegree \(1\), giving \(s(1)=-2\). Vertex \(2\) has indegree and outdegree \(1\), giving \(s(2)=0\). Vertex \(3\) has indegree \(2\) and outdegree \(1\), giving \(s(3)=1\). Vertex \(4\) has indegree \(2\) and outdegree \(1\), giving \(s(4)=1\). Thus two units must reach vertex \(1\), one from each of \(3\) and \(4\).
From \(3\), the only outgoing arc is \(3\to4\), after which the direct arc \(4\to1\) costs \(2\). The cheapest path from \(3\) to \(1\) therefore costs \(4+2=6\). From \(4\), the direct path \(4\to1\) costs \(2\). The total extra cost is \(6+2=8\), achieved by duplicating \(3\to4\) once and \(4\to1\) twice. The original cost is \(1+1+4+2+1+1=10\), so the total route cost is \(10+8=18\).
Check: after these duplications, vertex \(1\) has outdegree \(3\) and indegree \(3\), vertex \(2\) has \(1\) and \(1\), vertex \(3\) has \(2\) and \(2\), and vertex \(4\) has \(3\) and \(3\). One Euler circuit is \(1,2,3,4,1,3,4,1,4,1\). Its nine arc traversals have costs \(1,1,4,2,1,4,2,1,2\), which sum to \(18\).
A Sign Error to Avoid
Common mistake: sending extra route from a vertex with excess outdegree toward a vertex with excess indegree. In the first example, this would mean duplicating \(a\to c\), which costs \(4\). But \(a\) already has one more outgoing arc than incoming arc, and the extra \(a\to c\) increases that difference to \(2\). At \(c\), it increases the excess indegree from \(1\) to \(2\). The correction is to send route from the excess-indegree vertex \(c\) back to the excess-outdegree vertex \(a\), duplicating \(c\to a\) at cost \(3\). Check the sign by writing the balance equation at each vertex before choosing paths.
The flow formulation is useful because it separates two tasks: degree balance determines how much extra route each vertex needs to send or receive, while arc costs determine which directed paths should carry that route. A path that is cheap in the undirected network may be unavailable or expensive in the directed one; only directed paths from supplies to demands are valid.
Check Your Understanding
For each question, use the balance equation and keep the direction of every arc explicit.
- If a vertex has outdegree \(5\) and indegree \(2\), how many net extra arrivals does it require?
- In the second worked example, what is the cost of sending \(c\) to \(b\) and \(d\) to \(a\)?
- Explain why a directed cycle of extra copies can be removed when every arc cost is positive.
- Suppose a feasible integer balancing flow is found. Which graph property allows it to be converted into a closed route covering every arc copy?
- Why does the integer condition on each \(x_e\) reflect the route problem?