Three junctions are joined by pipes. Junction 1 feeds in 3 units of water per minute, junction 2 draws off 1 unit and junction 3 draws off 2, and water can reach junction 3 either directly or by way of junction 2. Many different splits keep every junction in balance. Which edge flows are possible, how much freedom is left, and which supply patterns can be balanced at all? This lesson writes all the balances as one linear system built from the incidence matrix, reads its kernel as flow around a cycle, and then adds the one-way restrictions that real pipes impose.
Key terms
Directed graph
Definition A directed graph consists of nodes, numbered , and edges, numbered . Each edge joins two different nodes and carries an arrow from one to the other, its reference direction. In a flow network, edge carries a real number , its flow, measured along the arrow, and the flows form a column in . A positive means material moves along the arrow, and a negative means it moves against the arrow at the rate . Whether negative flows are physically possible is a separate modeling decision. The graph is connected when any two nodes are joined by a chain of edges, with the arrows ignored.
In plain words On their own, the arrows are bookkeeping, not traffic rules. They fix which sign means which way, and reversing an arrow only changes the sign of its flow.
Example Take three nodes and the edges , and , numbered in that order, with flows . Tuples such as stand for column vectors on this page. The flow moves 2 units per minute from node 1 to node 2, 1 unit from node 2 to node 3 and 1 unit from node 1 to node 3. A value would mean 2 units per minute moving from node 2 to node 1, the same movement as a flow of on a reversed arrow . This triangle network is connected.
Incidence matrix
Definition The incidence matrix of a directed graph with nodes and edges is the matrix with entries
Rows belong to nodes and columns to edges. Each column has exactly one entry and one entry , so every column sums to zero. As a matrix, maps to , and entry of is the total flow leaving node minus the total flow entering it, with flows counted with their signs. If the graph is connected, then . Indeed, for an edge from to , entry of is . So forces equal values at the two ends of every edge, hence at all nodes of a connected graph. The null space of is therefore the line spanned by the all-ones vector in , and .
In plain words Each column is one edge, recorded as plus one where it starts and minus one where it ends. One unit of flow on that edge moves one unit from its start to its end and creates nothing.
Example For the triangle network,
The column of edge is , the column of is and the column of is . The three rows add to the zero row, so the rank is at most . The first two columns are independent, because the combination has first entry and last entry , so it vanishes only when . Hence .
Conservation at a node
Definition The net supply of node is the rate at which material enters the network from outside at that node. A positive is a source, a negative is consumption, and means the node only passes material on. Assume a steady state, with no storage at the nodes and no loss along the edges. Conservation at node then says that the sum of the flows on edges leaving node , minus the sum of the flows on edges entering it, equals . With the supply vector , the conservation equations at all nodes form the single system
with equations in unknowns. Its solutions are the flows compatible with the supplies. If is one of them, then they are exactly the vectors with in .
In plain words What a node takes in from outside must leave through its edges, and what it consumes must arrive through its edges. Supplies belong to nodes and flows belong to edges, so a negative supply is not a negative flow.
Example With supplies the triangle gives
The flow satisfies all three. Node 2 receives 2 units, consumes 1 and passes 1 on, so its net outflow is , its net supply. To find every solution, set . The second equation gives and the first gives . The third then holds automatically, since its left side is minus the sum of the other two left sides and . So every compatible flow is
for some real number , and the value gives again.
Circulation around a cycle
Definition A cycle is a closed route through the graph that starts and ends at the same node, uses each edge at most once and passes through no node twice apart from its return to the start. The route may use an edge along or against its arrow. Choose a direction of travel. The circulation around the cycle is the vector in with if the route uses edge along its arrow, if it uses edge against its arrow, and if it does not use edge . Then , because at each node of the route the edge used to arrive contributes and the edge used to leave contributes , whichever way their arrows point. Hence has the same net supplies as for every real . For a connected graph, rank-nullity gives
and is spanned by circulations around cycles.
In plain words Pushing one extra unit around a loop, in the direction of travel, brings one more unit into each node of the loop and takes one more unit out of it. The routes change and every node balance stays as it was. Edges that the loop uses against their arrows lose flow, which is why a circulation can have negative entries.
Example In the triangle, travel . The route uses edges and along their arrows and edge against its arrow, so , the direction vector of the solution family above. Directly,
Raising by sends one more unit along the route through node 2 and one unit less along the direct edge. Here , so any two compatible flows differ by a multiple of . If the direct edge is removed, the remaining columns and are independent, the kernel is , and node 1 and node 2 force the unique flows and . Removing the only cycle removed the freedom.
Nonnegative flow constraint
Definition If each edge can carry material only along its arrow, as in a one-way pipe or street, the model adds the inequalities for every edge , written . A flow is feasible when it satisfies both and . The inequalities are an extra requirement of the model, not a consequence of the linear system. The feasible set is the part of the solution set of in which every entry is nonnegative. If and are feasible, so is every flow with between them, but the feasible set is a subspace only in the trivial case where it is . When it does not contain , and when it contains a nonzero it does not contain , which has a negative entry. It can be a single point, a bounded segment, an unbounded set, or empty even when has solutions.
In plain words The equations say which flows balance, and the inequalities say which flows the pipes allow. A flow can pass every node check and still be ruled out because one of its entries is negative.
Example In the triangle with , the conditions , and together give
The infinite line of signed solutions shrinks to a closed segment. At the flow is and edge is idle. At it is and the direct edge is idle. The value gives , which balances every node but sends one unit backward along edge , so it is not feasible.
Total supply condition
Definition Every column of sums to zero, so . For every flow the entries of therefore add to , and the system can have a solution only if
For a connected graph with signed flows the condition is also sufficient. A vector lies in exactly when it is orthogonal to , and that null space is spanned by . If the graph splits into several connected pieces with no edges between them, the supplies must add to zero on each piece separately. Under the constraint the condition is still necessary but no longer sufficient in general, as the example below shows.
In plain words Edges only move material around inside the network, so the total put in must equal the total taken out. If it does not, then the data or the model is wrong, for example because a node stores material or an outlet is missing, and no choice of routes can repair that.
Example The supplies add to , so no flow on the triangle is compatible with them. For any supplies with , the flow works. Node 1 gets net outflow , node 2 gets and node 3 gets . The supplies add to zero, and this construction gives the signed solution . With one-way edges, however, node 1 would need with and , which is impossible. Node 1 has only outgoing arrows, so it cannot absorb material.
Check yourself
- On the triangle network of this page, which of the supply vectors and can be balanced by signed flows? Give one balancing flow.
Show the answer
The first vector adds to , so it fails the total supply condition and no flow balances it. The second adds to and the triangle is connected, so signed solutions exist. The construction gives . At node 1 the net outflow is , at node 2 it is and at node 3 it is , matching the supplies. Every other balancing flow is .
- Four nodes are joined by the edges , , and , numbered in that order, and the supplies are . Write the incidence matrix and find every signed flow. There are four equations in four unknowns, so is the flow unique? Which flows remain when every edge is one-way?
Show the answer
The incidence matrix is
Set . Node 2 gives , so . Node 1 gives , so , and node 3 gives . Node 4 then holds, since . So
The flow is not unique, although the counts match. The rows of add to the zero row and the graph is connected, so and the kernel has dimension . The direction is the circulation around the cycle , which uses the last two edges against their arrows. With one-way edges the conditions and give , from everything through node 3 at to everything through node 2 at .
- In the network of question 2 the supplies change to . Do signed flows exist? Do flows exist when every edge is one-way?
Show the answer
The supplies add to zero and the graph is connected, so signed flows exist. The same steps with give . For instance gives , which moves 2 units from node 4 back to node 1 through node 2. Check node 4, where . Nonnegativity needs and , that is , and no does both. The feasible set is empty even though the total supply condition holds. The reason is visible at node 1, which has only outgoing edges, so its net outflow cannot be when both flows are nonnegative.