You are on page 1of 2

OLA 2023 - Midterm 1

1. (The diet problem revisited – 20 pts.)


Recall the diet problem: There are n possible foods and m nutrients. The minimum rec-
ommended amount of nutrient j is Nj (j = 1, . . . , m). The price per serving of food i is ci
(i = 1, . . . , n). The amount of nutrient j that food i provides is aij (i = 1, . . . , n, j = 1, . . . , m). In
addition, there is a servings-per-day limit of Li for each food i = 1, . . . , n. This can be modeled
as an integer optimization problem as follows:
n
X
min ci xi (1)
i=1
s.t. (2)
n
X
aij xi ≥ Nj for all j = 1, . . . , m (3)
i=1
xi ≤ Li for all i = 1, . . . , n (4)
xi ≥ 0 for all i = 1, . . . , n. (5)

The next problems are independent of each other. On each problem you will be asked to
model a modified version of the diet problem.

(a) The original diet problem requires that all m minimum nutrient requirements are sat-
isfied, but perhaps this is asking for too much. Change the model so the requirement is
that, among all m nutrients, at least T minimum nutrient requirements are satisfied where
T < m.
(b) Consider the following situation: If you purchase more than Li /2 of food i, then you
need to pay a cost ci′ > ci for any amount in excess of Li /2 (this could be the case if,
for instance, the cheaper place only have an inventory of Li /2 for food i and you need
to buy the extra food in a more expensive place). Model the diet problem with this
consideration in mind, as an LP (use continuous variables only!).
(c) Consider the following situation: If you purchase (strictly) more than Li /2 of food i,
then there is a bulk discount and the unit price of food i becomes ci′ < ci (every unit can
be purchased at this cheaper price). Model the diet problem with this consideration in
mind, as an MILP.
(d) A set of E incompatible pairs of foods is given. If a pair of foods (i, j) ∈ E, then food i
and food j are incompatible in the sense they cannot be chosen simultaneously in the
menu: either you chooose food i or food j, but not both. Model the diet problem with
this consideration in mind, as an MILP.

2. (A slightly changed problem – 20 pts.) The equations below arise from a maximization
problem with ≥ constraints which was converted to standard form by adding the usual I
of slacks. The original RHS vector is b = (2, 4, 5); the objective function coefficient vector is
c = (8, 6, 3). Find the missing numbers. Be careful: you have to figure out some of the values
before you can find certain other values. Show your work.

z−?x1 +?x2 +?x3 +?x4 +?x5 +?x6 = ?


2x1 +?x2 + x3 + 3x4 +?x5 − x6 = ?
3x1 +?x2 + 0x3 − 7x4 + x5 +?x6 = 10
3x1 + x2 + 0x3 + x4 +?x5 + 2x6 = ?

1
3. (Computational problem: solving the DFJ formulation of the TSP – 20 pts.)

(a) Modify The Algorithm in the notebook midterm1 TSP.ipynb so that at each iteration
of The Algorithm not only the SEC that eliminates the subtour including the city 1 is
added to TSPmodel, but the SECs of all subtours in the current solution are added to the
TSPmodel. For instance, if n = 7 and the current solution has subtours associated to the
subsets of cities S1 = {1, 3}, S2 = {2, 4, 7}, S3 = {5, 6}, then 3 SECs should be added to the
TSPmodel in that particular iteration of the algorithm, the constraints corresponding to
the subsets S1 , S2 and S3 . In The Algorithm, only the constraint for S1 would be added
to the model.
(b) Compare The Algorithm and Your Algorithm from part (a) for the instance dantzig42
in terms of: i) Solution time, ii) Number of iterations of the algorithm (equivalently,
how many MIPs were solved in the loop), and iii) The number of constraints that were
added to the Assignment problem relaxation.
(c) Can Your Algorithm solve the instance a280 in less than 30 mins? If yes, how long does
it take?
Note: In the website https://opensourc.es/blog/mip-tsp/ you can find another ex-
planation of the ideas in the notebook midterm1 TSP.ipynb.

The deadline for the Computational problem is Wednesday June 7, 11:59pm.

You might also like