0% found this document useful (0 votes)
77 views20 pages

Min-Cost Flow Problems and Network Simplex Algorithm

This document discusses minimum-cost flow problems and the network simplex algorithm. It begins by defining minimum-cost flow problems as determining the most economical way to transport goods through a network given production/consumption amounts at nodes and arc transportation costs. It describes how this can be modeled as a linear program (LP) with constraints ensuring flow is balanced at each node. The network simplex method is then introduced as an adaptation of the simplex method tailored to the structure of flow networks to efficiently solve the resulting minimum-cost flow LP.

Uploaded by

Adolf NAibaho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views20 pages

Min-Cost Flow Problems and Network Simplex Algorithm

This document discusses minimum-cost flow problems and the network simplex algorithm. It begins by defining minimum-cost flow problems as determining the most economical way to transport goods through a network given production/consumption amounts at nodes and arc transportation costs. It describes how this can be modeled as a linear program (LP) with constraints ensuring flow is balanced at each node. The network simplex method is then introduced as an adaptation of the simplex method tailored to the structure of flow networks to efficiently solve the resulting minimum-cost flow LP.

Uploaded by

Adolf NAibaho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Min-cost flow problems and network simplex

algorithm ∗

The particular structure of some LP problems can be sometimes used for the design
of solution techniques more efficient than the simplex algorithm. The most relevant
case occurs in min-cost flow problems. In fact, the particular structure of minimum-
cost network flow problems allows for strong simplifications in the simplex method. The
following notes assume the reader has basic LP notions, such as the concept of basic
feasible solution, the optimality criterion and complementary slackness conditions. The
method obtained adapting the simplex method to the structure of flow networks is the
network simplex method.

1 Min-cost flow problems


The min-cost flow problem consists in determining the most economic way to transport a
certain amount of good (e.g. oil, oranges, cars ...) from one or more production facilities
to one or more consumption facilities, through a given transportation network (e.g. a
hydraulic network, a distribution network, a road network etc.). It should be emphasized
from the outset that the mathematical model lends itself to represent a variety of problems
that have nothing to do with the shipment of goods, and therefore we use the more abstract
notion of flow.
As usual, the nodes of the network may be associated with physical places (cities,
warehouses, industrial facilities, stations ...), and the arcs to one-way communication
links (road sections, railways ...) among these places. Note that one does not lose of
generality considering the arcs oriented (i.e., one-way) rather than unoriented (i.e., two-
way). In fact, each two-way arc can be represented by means of a pair of arcs pointing
in opposite directions between the same two nodes. In what follows, given a network
G(N, A), we use n = |N | to denote the number of nodes in the network and m = |A| to
denote the number of arcs, so for the graph in Figure 1, n = 5 and m = 8.

based on teaching material by Dario Pacciarelli (Dipartimento di Ingegneria, Università di Roma
Tre), rearranged by Alessandro Agnetis and Marco Pranzo (Dipartimento di Ingegneria dell’Informazione
e Scienze Matematiche, Università di Siena).

1
1 2

4 5

Figure 1: A flow network.

Network topology is only one part of the model. Fundamental information concerns:

• the amount of flow produced or consumed at each node;

• transportation costs between two nodes;

• possibly, an upper limit on maximum flow on each arc (i.e., capacity).

We first assume that there are no capacity constraints on arcs, or, in other words, that
each arc has infinite capacity. Afterwards (Section 6), we generalize the method to the
capacitated case.
For each node i, i = 1, . . . , n, an (integer) number bi is given, representing the amount
of flow produced (if bi > 0) or consumed (if bi < 0) at i. The nodes that produce flow are
sometimes referred to as sources, and bi as supply. Nodes that consume flow are called
sinks, and |bi | as demand. If bi = 0, node i does not consume nor produce flow, i.e.,
it is a transit node. Note that this classification into three types of nodes is completely
independent of the structure of the network, but it is defined only by the values of supply
and demand. For the example in Figure 1, assume there is a demand of 6 units at node
4 and of 8 units at node 5, while there is a supply of 10 units at node 1, and 4 units at
node 2, i.e.:
   
b1 10
   
 b2   4 
   
b=
 b3 =
  0 
 (1)
   
 b4   −6 
b5 −8
Notice that nodes 4 and 5 are sinks, nodes 1 and 2 are sources and node 3 is a transit
node.
We assume that the following assumption is always valid:

2
Assumption 1.1 Total supply equals total demand.

At very first glance, this assumption appears rather unrealistic in practice: it would
actually be surprising that the total demand for oranges perfectly matches the supply
to the market. The key issue is that this assumption does not limit the applicability of
the theoretical results. In fact, Assumption 1.1 can always be met by adding appropriate
nodes and arcs, having the same role of slack and surplus variables used to write LP
problems in standard form. On the other hand, Assumption 1.1 simplifies theoretical
developments.
As for the transportation cost from one location to another, it is assumed that each
arc (i, j) of the network has an associated unit transport cost cij . Therefore, for each unit
of flow sent from a source to a destination, a cost is incurred equal to the sum of unit
transport costs of all the arcs traversed. The min-cost flow problem consists in finding
a solution that minimizes the total cost while meeting the demand of all nodes in the
network. For the example of Figure 1, a possible cost vector is the following:
   
c12 10
   
 c13   8 
   
 c14   1 
   
 c23   2 
   
c=

=
 


(2)
 c34   1 
 c35   4 
   
   
 c45   12 
c52 −7

1 2
6 4

4 3

2 8

4 5

Figure 2: A feasible flow.

In a min-cost flow problem, a solution is defined by specifying the flow xij in each
arc (i, j) of the network. A solution can then be represented by a vector x having m
components. A solution is feasible if and only if:

3
(i) for each transit node, total incoming flow equals total outgoing flow.

(ii) for each sink, the total incoming flow equals node demand plus total outgoing flow.

(iii) For each source, the total outgoing flow equals node supply plus total incoming flow.

(iv) All arc flows are non-negative.


Conditions (i)–(iii) are encompassed by the following constraints, for each node i:
∑ ∑
xij − xji = bi
(i,j)∈δ + (i) (j,i)∈δ − (i)

For example, one can easily check that for the problem in Figure 1 and the vector b given
in (1), a feasible flow is:
   
x12 0
   
 x13   6 
   
 x14   4 
   
 x23   4 
   
x= =  (3)
 x25   0 
   
 x34   2 
   
   
 x35   8 
x45 0
The problem consists in determining a flow vector x that minimizes cost cT x among all
feasible solutions. These conditions, together with the objective function of the problem,
can be expressed as:
min cT x
Ax = b (4)
x≥0
where A is the incidence matrix of the network. Matrix A has size n × m, hence (4) is an
LP with m variables and n constraints. For the example in Figure 1, matrix A and the
min-cost flow LP are:
 
1 1 1
 
 −1 1 −1 
 
A=  −1 −1 1 1 
 (5)
 
 −1 −1 1 
−1 −1 1
min 10x12 + 8x13 + x14 + 2x23 + x34 + 4x35 + 12x45 − 7x52
x12 +x13 +x14 = 10
−x12 +x23 −x52 = 4
−x13 −x23 +x34 +x35 = 0 (6)
−x14 −x34 +x45 = −6
−x35 −x45 +x52 = −8
x≥0

4
Note that A is not full-rank: adding all rows one obtains the null vector, i.e., the
rows of A are not linearly independent. Assumption 1.1 ensures that the problem does
have solution, since rank[A] = rank[A b]. Hence, in a min-cost flow problem, one of the
equations can be canceled.
For the sake of simplicity, when representing a feasible solution, we often depict only
the arcs (i, j) for which xij > 0, omitting the arcs (i, j) such that xij = 0. The flow
specified by (3) can therefore be represented as in Figure 2.
In the following sections 2–5we show how the simplex method can be specialized to
solve uncapacitated min-cost flow problems. In Section 6 we generalize it to the capaci-
tated case.

2 Basic solutions and spanning trees


Since we know that the matrix A is not full-rank, a basis of A consists of only n − 1
linearly independent columns of A. These columns correspond to a collection of arcs of
the flow network. We want to show that, if the network is connected (as we will always
suppose), all the bases of A are associated with spanning trees. By spanning tree here
we mean a set of n − 1 arcs such that each node of the network is adjacent to at least
one of them (it coincides with the classical notion of spanning tree if one disregards arc
orientation). Also, throughout these notes we always use the term cycle to refer to a set
of arcs forming a closed path (i.e., a path in which the first and the last node of the path
coincide) when ignoring their orientation. Figure 3 shows an example of a spanning tree
for the graph of Figure 1.

1 2

4 5

Figure 3: A spanning tree.

First of all let us prove the following lemma:

5
Lemma 1 Let T ⊂ A be a set of columns of A such that the corresponding arcs form a
spanning tree. Then, the columns of T are linearly independent.

Proof – We begin by observing that every tree has the following properties: regardless of
how an initial node v0 is labeled, the remaining nodes can be numbered v1 , v2 , .., vn−1 in
such a way that, for each i ≥ 1, there is exactly one arc with one endpoint equal to vi
and the other endpoint equal to one of the previously labeled nodes v0 , v1 , .., vi−1 . To this
aim, it is sufficient to visit the tree and label the nodes (from v0 to vn−1 ) and the arcs
(from 1 to n − 1) in the order in which they are visited. If we order the n − 1 columns of
the spanning tree and the n rows of A following the above ordering, we obtain a matrix
n × (n − 1). If we discard the first row of such matrix (associated with the label v0 ), we
are left with a submatrix of A of size (n − 1) × (n − 1) which, by construction, is upper
triangular and has all nonzero elements on the main diagonal. Hence, the determinant
of this submatrix is different from zero, which implies that the matrix A has rank n − 1,
and that the columns associated with a spanning tree are always linearly independent.
This demonstrates that the columns of A associated with a spanning tree of the network
of flow are always bases of A.
As an example, for the spanning tree of Figure 3, visiting the nodes in the or-
der 1, 4, 3, 2, 5, and hence the arcs in the order (1, 4), (3, 4), (2, 3), (3, 5), we obtain the
new numbering of Figure 4. The corresponding incidence matrix, re-ordering rows and
columns, is:

label arcs
(1, 4)(3, 4)(2, 3)(3, 5)
v0 1
 
v1  −1 −1  (7)
 
v2  1 −1 1 
 
 
v3  1 
v4 −1

In the remainder of this section, we want to show that the viceversa of Lemma 1 also
holds:

Lemma 2 If a subset T of columns of A is a basis, then the corresponding arc set is a


spanning tree.

Proof – A basis of A necessarily contains n − 1 columns, and an arc set consisting of n − 1


arcs that does not correspond to a spanning tree must necessarily contain a cycle. For
our purposes, it is therefore sufficient to show that the columns of A associated with a
cycle are linearly dependent, i.e., that there is a linear combination of the columns, with

6
v0 v3
1 2

3
v2
1
3
2
4

4 5
v1 v4

Figure 4: A labeled tree.

coefficients not all zero, yielding the null vector. Given a cycle, the coefficients of the
linear combination can be simply obtained as follows. Arbitrarily choose one direction for
the cycle, and set the coefficient of an arc (i, j) of the cycle as:

• 1 if the arc has the same orientation as the direction chosen;

• -1 if the arc has the opposite orientation as the direction chosen;

It is easy to verify that this linear combination of the columns of A associated yields
the null vector.
As an example, consider the cycle formed by arcs (1, 3), (3, 4) and (1, 4) in Figure 2.
Visiting the cycle in the verse 1, 3, 4, one has that (1, 3) and (3, 4) are oriented like the
visiting verse, while (1, 4) has opposite orientation. The columns of A associated with the
three arcs are:
     
1 0 1
     
 0   0   0 
     
A13 =
 −1 
 A34 =
 1 
 A14 =
 0 

     
 0   −1   −1 
0 0 0

Adding A13 to A34 and subtracting A14 , one gets the null vector, hence showing that
these three columns are linearly dependent, hence not all of them can appear in the same
basis of A.
In conclusion, Lemmas 1 and 2 imply the following fundamental result:

Theorem 1 Given a connected flow network, letting A be its incidence matrix, a subma-
trix B of size (n − 1) × (n − 1) is a basis of A if and only if the arcs associated with the
columns of B form a spanning tree.

7
Solving a min-cost flow problem with the simplex algorithm, one has therefore that
all the basic feasible solutions explored by the algorithm are spanning trees of the flow
network. As it occurs for any LP, also in min-cost flow problems one has feasible, infeasible
and degenerate bases. A basis is feasible if xB = B −1 b ≥ 0. In this case, it can be easily
verified solving the system BxB = b, starting from a leaf of the spanning tree, and verifying
that xB ≥ 0. For instance, one can easily verify that the tree in Figure 3 is not feasible,
since the corresponding basic solution is:
   
x14 10
 x34   −4 
   
xB =  = 
 x23   4 
x35 8

A basic feasible solution is shown in Figure 5, for which one has:


     
x13 b1 10
 x23   b2   4 
     
xB =  = =  (8)
 x34   −b4   6 
x35 −b5 8

1 2

4 5

Figure 5: A basic feasible solution.

3 Optimality criterion
In this section we show how to efficiently check the optimality of a basic feasible solution,
using complementarity slackness conditions. The dual of the min-cost flow problem (4)
is the following:

max bT u
(9)
uT A ≤ cT

8
Actually, as already discussed, the primal problem has a redundant equation, which
could be eliminated without altering the problem. This means that the dual has one
redundant variable, which could be eliminated without altering the problem. For notation
simplicity, we will not explicitly eliminate equations or variables from the primal and dual
problems, but we will account for this observation by arbitrarily setting one of the dual
variables to zero (which is equivalent to deleting it). The dual problem can be conveniently
written in full as:
∑n
max i=1 bi ui
(10)
ui − uj ≤ cij ∀ (i, j) ∈ A

The dual variables u are often called potentials. Consider then a basic feasible solution,
and partition A into two sets B (the arcs of the spanning tree) and F (the other arcs of
the network). If an arc is basic in the optimal solution, the corresponding dual constraint
must be satisfied at equality, i.e.:

ui − uj = cij ∀ (i, j) ∈ B (11)

Equations (11) are n − 1, in n variables. As previously discussed, one variable can be


arbitrarily fixed to zero. One can then easily determine a solution u, and check its dual
feasibility, i.e., the fulfilment of all other constraints:

ui − uj ≤ cij ∀ (i, j) ∈ F (12)

Hence if, given a basic feasible solution x, the values ui obtained through (11) also
respect the (12), x is optimal.
For instance, for the feasible basis in Figure 5, and with the costs in (6), one has:


 u1 − u3 = c13 = 8

 u2 − u3 = c23 = 2
 u3 − u4 = c34 = 1



u3 − u5 = c35 = 4

From this, arbitrarily letting u3 = 0, one has u1 = 8, u2 = −2, u4 = −1, u5 = −4.


Plugging these values into (12), one gets:


 u1 − u2 = 10 ≤ c12 = 10

 u1 − u4 = 9 ̸≤ c14 = 1


 u4 − u5 = 3 ≤ c45 = 12

u5 − u2 = −2 ̸≤ c52 = −7

Hence, the first and third constraint are satisfied, while the second and the fourth are
violated. Therefore, the corresponding basis is not optimal.

9
4 Unboundedness and pivot operation
We now want to show how it is possible to either profitably change the basis or verify
that the problem is unbounded.
If a solution x does not verify the optimality conditions, by (12) there must exist an
arc (i, j) ∈ F such that ui − uj > cij . In other words, the reduced cost of the variable xij ,
letting Aij be the column associated with that variable, is

cij = cij − uT Aij = cij − ui + uj < 0,

and then it will be profitable to bring variable xij into the basis, i.e., activate arc (i, j).
Clearly, arc (i, j) forms a cycle with the arcs of B (the spanning tree). In order to restore
a feasible basis, we must get rid of this cycle, i.e., letting C denote the arcs of the cycle,
the arc that leaves the basis must necessarily be an arc of C. Which arc must then leave
the basis? We can proceed in a completely analogous manner to what is done for the
general simplex method. In fact, since cij < 0, it is profitable to increase the flow on
(i, j). This implies that, in order to maintain the feasibility of the current solution, one
must necessarily alter the value of the flow on all the arcs of C, increasing the flow on
arcs that, in the cycle, have the same orientation as (i, j) (direct arcs), and decreasing
the flow of the arcs having opposite orientation (reverse arcs).
A special situation occurs if all the arcs in C are direct. In this case, one can indefinitely
increase the flow on the arcs of C, while simultaneously decreasing the objective function.
In this case the problem is unbounded. This condition occurs if and only if in the directed
cycle C the sum of the costs of the arcs is negative:

chk < 0.
(h,k)∈C

If we are not in this situation, there is at least one reverse arc. As the flow on (i, j) is
increased, the flow in reverse arcs decreases, and there is at least one arc, say (u, v), such
that its flow reaches zero before all the other arcs, i.e., arc (u, v) leaves the basis. The
maximum feasible value ϑ of the flow in arc (i, j) is therefore:

ϑ = min{xhk : (h, k) ∈ C, (h, k) is a reverse arc}.

The new basic feasible solution is therefore obtained by simply increasing by ϑ the
flow in direct arcs and decreasing by the same amount ϑ the flow in reverse arcs of C.
Still continuing with the Example of Figure 1 and with the basis of Figure 5, a possible
arc entering the basis is (i, j) = (1, 4), which forms cycle C = {(1, 4), (1, 3), (3, 4)}. Arcs
(1, 3) and (3, 4) are reverse arcs (1, 4). The flow in these arcs, given by (8), is x13 = 10 and

10
x34 = 6. Therefore ϑ = 6, the arc leaving the basis is (3, 4) and the new basic variables
are:
     
x̃13 10 − 6 4
 x̃23   4   4 
     
x̃B =  = =  (13)
 x̃14   0+6   6 
x̃35 8 8

The pivot operation is highlighted in Figure 6. We can now proceed with the new
iteration:
Computation of variables u. From complementary slackness conditions one has:


 u1 − u3 = c13 = 8

 u2 − u3 = c23 = 2


 u1 − u4 = c14 = 1

u3 − u5 = c35 = 4
Arbitrarily fixing u1 = 0 one has u3 = −8, u2 = 2 − 8 = −6, u4 = −1, u5 = −12. Dual
feasibility requires:


 u1 − u2 ≤ c12 = 10

 u −u ≤c =1
3 4 34


 u4 − u5 ≤ c 45 = 12

u5 − u2 ≤ c52 = −7
Note that the fourth condition is violated. Hence, arc (5, 2) enters the basis and creates
the cycle C= {(5, 2), (2, 3), (3, 5)}. Since all the arcs of C have the same orientation as
(5, 2), we conclude that the problem is unbounded, and there is no optimal solution. In
fact, the cycle {(5, 2), (2, 3), (3, 5)} has total cost:

c52 + c23 + c35 = 2 + 4 − 7 = −1 < 0

1 2

Arco
entrante 3

Arco
uscente
4 5

Figure 6: Pivot operation.

11
5 Phase 1 of the network simplex method
We have so far neglected the problem of determining a feasible flow to start with. This
problem is taken care by the phase 1 of the network simplex method.
The idea is quite simple. We recall that in phase 1 of the simplex method an artificial
variable is added for each constraint, so that a feasible basis for the artificial problem is
always obtained. In the network simplex method, one can operate in a perfectly analogous
way. This time, variables are associated with the arcs of a flow network, so we have to
add artificial arcs in order to immediately get a feasible solution. The simplest way to
obtain this is to convey all the flow produced by sources into an artificial node via artifical
arcs, and redistribute such flow via other artificial arcs connecting the new node to sinks.
Note that, if there is at least one transit node, artificial arcs are not enough to form a
spanning tree (of the artificial network). To obtain an initial basis one can then add an
arbitrary arc of the original network for each transit node, so that no loops are formed
among them and with the artificial arcs.
Similar to the general simplex method, also in the phase 1 of the network simplex
method the objective is to minimize the flow on artificial arcs, so in the artificial problem
we set the cost of each artificial arc equal to 1 and the cost of all other arcs to 0.
Once the optimal solution to the artificial problem has been determined, a feasible
flow (if it exists) for the original problem can be easily obtained. Notice that if, in the
optimal solution of the artificial problem, some artificial arc has nonzero flow, the original
problem is infeasible. If the flow in all the artificial arcs is zero, these can be simply
removed (along with the artificial node), since the flow in the original arcs is a feasible
flow for the original problem. Possibly, some (empty) arc may need to be added to the
basis to restore a spanning tree, and start phase 2. In the latter case, the initial basis is
degenerate.
For example, consider the network in Figure 7 and the demand vector (14).
   
b1 2
   


b2 



−6 

d=
 b3 =
  0 
 (14)
   
 b4   8 
b5 −4

Phase 1 is set up adding an artificial node 6, two artificial arcs (1, 6) and (4, 6) from
the two sources to the artificial node, and two artificial arcs (6, 2) and (6, 5) from the
artificial node to the two sinks, as in Figure 8. To obtain an initial basis for the problem,
it is necessary to add another arc to connect the transit node 3 to the rest of the tree,
e.g., arc (3, 5). The objective function is to minimize the sum of the flows on the artificial

12
1 2

4 5

Figure 7: Example of transportation network.

arcs. The cost vector is given by (2), along with the initial basic solution. The initial
spanning tree is reported in Figure 9.

1 2

4 5

Figure 8: Artificial network.

   
c12 0
   
 c13   0 
   
 c14   0 
   
         
 c23   0 








x16 |b1 | 2
 c25   0       
    

x46 



|b4 | 



8 

 c35   0 
c= =  xB =
 x62 =
  |b6 | =
  6 
 (15)
 c43   0       
     x65   |b5 |   4 
 c54   0 
   
    x35 0 0
 c16   1 
   
 c46   1 
   
   
 c62   1 
c65 1

13
1 2

4 5

Figure 9: A feasible basis for the artificial problem.

1 2

4 5

Figure 10: An optimal basis for the artificial problem which is infeasible for the original
problem.

14
The reader can verify that, if arc (1, 2) enters the basis, arc (1, 6) leaves. Thereafter, if
we let (4, 3) enter the basis, (6, 5) leaves. At this point, the solution is optimal for phase
1. However, the artificial arcs (4, 6) and (6, 2) remain in basis, having flow x46 = x62 = 4.
Hence, the original problem is impossible. The optimal spanning tree for phase 1 is shown
in Figure 10.
This situation can also be directly interpreted on the network. In fact, if we consider a
dual solution such that u6 = 1, the other nodes of the network are divided into nodes with
dual variable value ui = 2 and nodes with dual variable value uj = 0. If the solution is
optimal for phase 1, there cannot exist an arc (i, j) in the network that goes from one node
with dual value 2 to a node with dual value 0, since this would violate the dual feasibility
ui − uj ≤ 0). However, the sum of the demands of the nodes with dual value 0 is strictly
negative, while the sum of the demands of the nodes with dual value 2 is strictly positive.
In other words, there is an overall flow produced by nodes with dual value 0, which can
not reach the nodes with dual value 2, and this determines the impossibility to solve the
problem. In the example of Figure 7 one can see that node 2 (sink) is unreachable from
node 4 (source), and node 1 is unable to satisfy all the demand of node 2.

6 Capacitated networks
In this section we illustrate how to extend the network simplex algorithm to capacitated
networks, i.e., when there are capacities associated with arcs on the network. The case of
capacitated networks is fairly frequent in the applications, since there is typically a limit
to the amount of flow in an arc.
Let kij denote the capacity of arc (i, j), i.e., in a feasible flow vector, 0 ≤ xij ≤ kij .
We let k denote the capacity vector. The min-cost flow problem on a capacitated network
can therefore be formulated as follows:
min cT x
Ax = b
(16)
x≤k
x≥0
adding a vector s of slack variables, the problem can be put into standard form:
[ ]
x
min[ c 0 ]
[ ][
s] [ ]
A 0 x b (17)
=
I I s k
x, s ≥ 0

15
10
1 2

7
4
2 3
3

7 12

4 5
5

Figure 11: Capacitated flow network.

Figure 11 shows the network flow of Figure 7, with the addition of arc capacities
(indicated in rectangles). Problem data are:
       
k12 10 c12 10
           
 k13   7   c13   8 
        b1 10
 k14   2   c14   1     
         b2   4 
 k23   4   c23   2     
       
k=

=
 


c=

=
 


b=
 b3 =
  0 
 (18)
 k25   3   c25   7     
         b4   −6 
 k35   12   c35   4 
        b5 −8
 k43   7   c43   1 
k54 5 c54 12
Let us now review all steps of the network simplex algorithm to extend them to the
capacitated case.
In the uncapacitated case, basic solutions correspond to spanning trees, and can be
used to partition the set of arcs A into the two subsets B (basic arcs) and F (nonbasic
arcs). In the capacitated case, the correspondence between trees and spanning trees and
basic solutions must be slightly revised. In particular, given a basic feasible solution x to
the problem, we can partition the arc set into three subsets: the set V of empty arcs (i.e.,
arcs with zero flow), the set S of saturated arcs (i.e., with flow xij = kij ), and the set,
call it B, of arcs that are neither saturated nor empty.

Theorem 2 Given a connected flow network, a basic feasible solution x and the corre-
sponding tripartition (V, S, B) of the arcs, the arcs of B do not form cycles.

Proof – Suppose that the arcs of B form a cycle. Only for ease of exposition, let us refer
to a cycle consisting of five arcs (of course, the conclusions will hold for cycles with any
number of arcs):

(i1 , i2 ), (i2 , i3 ), (i4 , i3 ), (i4 , i5 ), (i1 , i5 )

16
in which, arbitrarily fixing as verse of the cycle that of arc (i1 , i2 ), some arcs (namely
(i1 , i2 ), (i2 , i3 ), (i4 , i5 )) are consistent with the verse of the cycle (direct arcs), while the
others (reverse arcs, such as (i4 , i3 ), (i1 , i5 )) are not.
Referring to formulation (17), variables {xi1 ,i2 , xi2 ,i3 , xi4 ,i5 } are certainly basic, and
hence so are slack variables {si1 ,i2 , si2 ,i3 , si4 ,i5 }, since the arcs in B are not saturated. The
10 columns corresponding to such variables (reporting only the rows of these columns
with nonzero elements) are:
 
xi1 ,i2 xi2 ,i3 xi4 ,i3 xi4 ,i5 xi1 ,i5 si1 ,i2 si2 ,i3 si4 ,i3 si4 ,i5 si1 ,i5
 1 1 
i1  
 
i2 
 −1 1 

i3  −1 −1 
 
 
i4  1 1 
 
i5  −1 −1  (19)
 
 
(i1 , i2 )  1 1 
 
(i2 , i3 )  1 1 
 
(i4 , i3 )  1 1 
 
 
(i4 , i5 )  1 1 
(i1 , i5 ) 1 1
Now perform a linear combination of the columns, using the following coefficients. In the
combination, use coefficient +1 for the columns of variables xij corresponding to direct
arcs and of variables sij corrisponding to reverse arcs, and use coefficient -1 for the columns
of variables xij corrisponding to reverse arcs and of variables sij corresponding to direct
arcs. In this way, we obtain the null column. This shows that the 10 columns indicated
cannot be all in the basis, and hence the 5 corresponding arcs cannot be all in B.
From the above result, it follows that, in a basic solution, at most n−1 arcs can belong
to B, and these arcs cannot form cycles. This fact allows us to continue identifying basic
solutions with spanning trees. However, note that this time more basic solutions may
correspond to the same spanning tree (set B). In fact, we get different basic solutions
for different sets of saturated and empty arcs (V and S). It is quite simple in fact to
verify that, given the sets V and S, the value of the flow in the other arcs is uniquely
determined and can be computed through the same procedure already described for the
uncapacitated case. One should only observe that, if (i, j) ∈ S, it must be taken into
account when calculating the flow on the arcs of B. For example, consider the network
in Figure 11, and let B = {(1, 2), (2, 3), (3, 5), (5, 4)}, while S = {(1, 3), (1, 4), (2, 5)} and
V = {(4, 3)} (Figure 12). Clearly, x43 = 0, x13 = 7, x14 = 1 and x25 = 3. Subsequently
one can compute x12 = 10 − 2 − 7 = 1, x23 = 4 + 1 − 3 = 2, x35 = 8 + 4 − 3 = 9 and
x54 = 9 + 3 − 8 = 4. Note that all these values satisfy capacity constraints, hence the
solution is feasible.

17
1 2

4 5

Figure 12: Sets B (solid line) and S (dashed line).

Moreover, note that – analogously to the uncapacitated case – also in B there can
be saturated or empty arcs. In this case, one has a degenerate basic solution (and a
corresponding degenerate spanning tree). As in the uncapacitated case, saturated or
empty arcs added to complete the basis, are considered exactly as all the arcs belonging
to B.
Let us now extend the optimality criterion to the capacitated case. First, write the
dual of (17) as:
 [ ]

 u

 T T
 max[ d k ]
v
[ ] (20)
 [ ] A 0


 uT v T
 ≤ [cT 0T ]
I I

Completarity slackness conditions are:


( [ ]) [ ]
A 0 x
[c 0 ] − [u v ]
T T T T
=0 (21)
I I s

For each arc (i, j), one has therefore the two conditions:

(cij − ui + uj − vij ) xij = 0 (22)


vij sij = 0 (23)

If (i, j) ∈ B, then xij ̸= 0 and sij ̸= 0, and so (22) and (23) reduce to

cij − ui + uj = 0 (i, j) ∈ B (24)

analogously to (12). These are then n − 1 equations in n variables, one of which, as usual,
can be arbitrarily fixed to 0. The values found must satisfy all dual constraints. Hence,

18
considering an empty arc (i, j) ∈ V, since sij ̸= 0, one has (from (23)) vij = 0 and the
following must hold

ui − uj ≤ cij (i, j) ∈ V (25)

For a saturated arc, from (22) one has:

cij − ui + uj = vij

and therefore, considering that, from (20) one has vij ≤ 0, it must hold

ui − uj ≥ cij (i, j) ∈ S (26)

Summarizing, at each iteration of the network simplex algorithm, the current basis is
optimal if the potentials at nodes ui , computed using (24), satisfy all inequalities (25) and
(26). For the example in Figure 12, the potentials have the following values, obtained by
fixing the potential of node 4 to zero (u4 = 0):
   
u1 28
   
 u2   18 
   
u=
 u3 =
  16 
 (27)
   
 u4   0 
u5 12

In this example, the solution is not optimal, since not all arcs in S ∪ V satisfy the
optimality conditions. In particular, for the saturated arc (2, 5) one has c̄25 = u2 − u5 −
c25 = 18 − 12 − 7 = −1 ̸≥ 0.
If the optimality conditions are not met, any arc (empty or full) that does not meet
its optimality condition may be chosen to enter the basis. Once the arc entering the
basis is selected, one must determine the arc leaving the basis. Generalizing what done
in the uncapacitated case, one must find the maximum flow ϑ circulating in the cycle C
generated by the addition of the arc (i, j). In this case, the maximum circulating flow ϑ
may be limited by the capacity of direct arcs which reach saturation, as well as by reverse
arcs that are emptied.
{ }
xpq : (p, q) ∈ C, (p, q) is a direct arc,
ϑ = min (28)
kpq − xpq : (p, q) ∈ C, (p, q) is a reverse arc

The arc that determines the value ϑ leaves the basis, and is replaced with (i, j).
In particular, tree B is updated exactly as in the uncapacitated case, i.e., by suitably
increasing or decreasing by ϑ the flow on the arcs of C. (Note that, unlike the capacitated
case, if all capacities are finite, it is not possible to have unbounded solutions.) An

19
iteration of the simplex method is called not degenerate if the flow ϑ > 0, while an
iteration is called degenerate if ϑ = 0. Degenerate iterations can happen only if the
spanning tree B is degenerate, i.e., if it contains saturated or empty arcs. With reference
to the network and the basic solution in Figure 12, when arc (1, 4) enters the basis, the
cycle is C = {(2, 3), (3, 5), (2, 5)}. As the flow on (2, 5) decreases, the first arc to leave
B is (2, 3), which becomes saturated, and ϑ = 2. As a consequence, in the new basic
feasible solution, x25 = 2, x23 = 4 and x35 = 11. Hence, the new partition of the arcs is:
B ′ = {(1, 2), (2, 5), (3, 5), (5, 4), S ′ = {(1, 3), (1, 4), (2, 3)} and V ′ = {(4, 3)}. We leave it as
an exercise to verify that the new solution is optimal.
Finally, note that for the computation of an initial feasible solution (phase 1) it is
possible to proceed exactly as with uncapacitated networks (specifying a sufficiently large
capacity for artificial arcs).

20

You might also like