Network Models 417
x
i,j
≤ c
i,j
.
These are shown as the value of the ar cs in Figure 24.2. There are six arcs
in the graph, therefore there are six capacity constra ints.
x
1,2
≤ 7
x
2,3
≤ 4
x
2,4
≤ 3
x
3,4
≤ 6
x
3,5
≤ 3
x
4,5
≤ 4
The decision variables x
i,j
have the sign constraint x
i,j
≥ 0, for i = 1, . . . , 5
and j = 1, . . . , 5.
24.5.1 Formulation Using the Pyomo Modeler
The following listing shows the formulation of the model using the Pyomo
modeler and is s tored in file maxflow1.py. Note that this is a maximization
model and the artificial variables ar e used with a + sign and the right-hand
side of the respective constraints are <= 0. This is shown in line 36 and in
lines 54–58.
1 """
2 Python Formulation using Pyomo Modeler
3 Network problem, maximum flow. File: network1 ...