Transpo rtation Models 39 9
x
1,1
+ x
1,2
+ x
1,3
+ x
1,4
= 1 (M1)
x
2,1
+ x
2,2
+ x
2,3
+ x
2,4
= 1 (M2)
x
3,1
+ x
3,2
+ x
3,3
+ x
3,4
= 1 (M3)
x
4,1
+ x
4,2
+ x
4,3
+ x
4,4
= 1 (M4)
There are four job constraints, each representing the possible as signments
of the machines to it.
x
1,1
+ x
2,1
+ x
3,1
+ x
4,1
= 1 (T1)
x
1,2
+ x
2,2
+ x
3,2
+ x
4,2
= 1 (T2)
x
1,3
+ x
2,3
+ x
3,3
+ x
4,3
= 1 (T3)
x
1,4
+ x
2,4
+ x
3,4
+ x
4,4
= 1 (T4)
The decision variables x
i,j
have the constraint x
i,j
= 0 or x
i,j
= 1, for
i = 1, . . . , 4 and j = 1, . . . , 4.
23.9.1 Formulation with the Pyomo Modeler
The following listing shows the Python script with the model using Pyomo
and stored in file assign1.py. As with the previous models, it was necessary
to introduce artificial variables.
"""
Python Formulation for the Pyomo Modeler
Assignment ...