Tutorial 1
Tutorial 1
Linear Programming
October 19, 2015
Exercise 1 (Transshipment Problem) In this problem1 , an IT company produces laptops at
two factories A and B. In factory A, sA laptops are produced per year, whereas the output of factory B is sB laptops/year. The company owns the three stores 1, 2 and 3. At store 1, d1 laptops
are sold a year. The corresponding numbers for stores 2 and 3 are d2 and d3 , respectively. The
costs of shipping one laptop from factory i {A, B} to store j {1, 2, 3} is cij pounds. Assume
that sA + sB d1 + d2 + d3 , i.e., the demand of all stores can be satisfied.
1. Assume that (sA , sB ) = (3, 3) and (d1 , d2 , d3 ) = (2, 2, 2). Furthermore, the matrix (cij ) is
given as follows:
1 2 1
,
2 1 2
where the first row corresponds to factory A, the second row to factory B, and the columns
correspond to the different stores. The costs cB2 , for example, are one pound per laptop.
How should the laptops be shipped from the two factories to the three stores such that the
overall shipping costs are minimized?
2. Formulate the optimization model corresponding to the previous question. Use the general
parameters (i.e., sA , d2 , cB3 etc.) instead of concrete values.
3. Imagine the company established a warehouse as shown in the following figure. The company
can either directly serve its stores, resulting in costs cij as before, or ship laptops to the
warehouse (at costs ei per laptop) and subsequently to the stores (at costs fj per laptop).
Moreover, at most xij laptops can be shipped from factory i {A, B} to store j {1, 2, 3},
while the shipments through the warehouse are unrestricted. Formulate the cost minimization
problem, using general parameters as in the previous question.
1 The term transshipment refers to the shipment of goods or containers to an intermediate destination, then to
yet another destination.
Solution
1. We see that factory A can serve stores 1 and 3 at low costs, whereas factory B is better for
serving store 2. Given the particular cost matrix, A solely serves stores 1 and 3 in every
optimal solution, and B satisfies the remaining demands. All such solutions result in total
costs of 7 pounds per year.
2. We introduce variables xij , i {A, B} and j {1, 2, 3} with the meaning that xij laptops
should be shipped from factory i to store j. Then the model becomes:
X
X
min
cij xij
i{A,B} j{1,2,3}
subject to
for j {1, 2, 3}
xAj + xBj = dj
xi1 + xi2 + xi3 si
for i {A, B}
xij 0
The objective function minimizes the overall costs. The first equation makes sure each store
receives exactly the desired amount of laptops. The second constraint ensures that a factory
does not ship more laptops than it actually produces. The last constraint forbids negative
amounts of laptops to be shipped.
3. The model follows exactly the same logic as before. Again we have variables xij with
i {A, B} and j {1, 2, 3} for direct transshipments from factories to stores. Additionally
we introduce variables xiw with i {A, B} for shipments to the warehouse and xwj with
j {1, 2, 3} for shipments from the warehouse. The model then becomes:
X
X
X
X
min
cij xij +
ei xiw +
fj xwj
i{A,B} j{1,2,3}
i{A,B}
j{1,2,3}
subject to
for j {1, 2, 3}
for i {A, B}
xij 0
xiw 0
for i {A, B}
xwj 0
for j {1, 2, 3} .
Note the third constraint, which is often called flow conservation: every laptop that is
shipped to the warehouse must also leave the warehouse to one of the stores.
Exercise 2 Find a solution to the following system of linear equations (if it exists):
x1
3x1
x1
2x1
+
+
x2
x2
4x2
+ x3
+ 2x3
x3
2x3
+ x4
+ 2x4
4x4
+ 3x4
= 6
= 12
= 3
= 8
Solution 1. The rank of A is 4, i.e., there exists a unique solution. This can be directly verified
by Gaussian elimination (check!). The solution to A x = b is found to be:
x1
x2
x3
x4
2. No specific assumption is taken on the bounds of the decision variables. Therefore, the
solution to A x = b found in the previous question, even though it has negative values, would be
in the feasible set. The resulting LP would be feasible, even though a degenerate one, since its
feasible set has a unique point.
3. If the LP is in standard form, one would first need to change the sign of the last equation by
multiplying both sides by 1. After this operation, the solution of the system of linear equations is
the same. However, the assumption of a standard form implies that the decision variables must be
non-negative, therefore (3, 1, 4, 2) would not be anymore in the feasible set. Since this system
has a unique solution, we conclude that the feasible set would be empty.
Exercise 3 Find the basic solutions (BS) of the system of equations:
x1
3x1
+
+
x2
2x2
+
+
x3
4x3
=
=
3
10
Solution Every pair of columns of the matrix of coefficients forms a basis for R2 , thus there are
three basic solutions. Set x1 = 0, obtain as basic solution:
(0, 1, 2),
For x2 = 0, we obtain
(2, 0, 1)
Set x3 = 0, we obtain the following basic solution:
(4, 1, 0)