0% found this document useful (0 votes)
180 views31 pages

Discussion 1: August 29: 1.1.1 Info

Berkeley Paint Company wants to maximize profit from producing blue and gold paint using 40 hours of production capacity. An LP is formulated to determine the optimal amounts of each paint to produce. The objective is to maximize total profit, subject to the constraint that total production hours do not exceed 40 hours. Decision variables are amounts of each paint, with upper bounds as maximum demand for each paint. California wants to plan power generation over 50 years to meet demand at minimum cost. An LP is formulated with decision variables for amounts of solar and nuclear plants built each year. The objective is to minimize total plant construction costs. Constraints ensure total available power meets demand each year, based on plant lifetimes and previous builds. New constraints are added

Uploaded by

Nikhil Gupta
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)
180 views31 pages

Discussion 1: August 29: 1.1.1 Info

Berkeley Paint Company wants to maximize profit from producing blue and gold paint using 40 hours of production capacity. An LP is formulated to determine the optimal amounts of each paint to produce. The objective is to maximize total profit, subject to the constraint that total production hours do not exceed 40 hours. Decision variables are amounts of each paint, with upper bounds as maximum demand for each paint. California wants to plan power generation over 50 years to meet demand at minimum cost. An LP is formulated with decision variables for amounts of solar and nuclear plants built each year. The objective is to minimize total plant construction costs. Constraints ensure total available power meets demand each year, based on plant lifetimes and previous builds. New constraints are added

Uploaded by

Nikhil Gupta
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/ 31

IND ENG 240: Optimization Analytics Fall 2017

Discussion 1: August 29
Lecturer: Erik Bertelli Scribes: Umesh Thillaivasan

1.1 Paint Problem

1.1.1 Info:

Table 1.1: Given


Paint Blue Gold
Profit (pi ) 10 15
Production/hour (ri ) 40 30
Maximum Demand (ui ) 1000 860

Berkeley Paint Company has 40 hours of production capacity available to produce paint. Formulate an LP
to help Berkeley Paint Company maximize profit.

1.1.2 LP Formulation

x1 = Blue paint to produce. x2 = Gold paint to produce.

P: max 10x1 + 15x2


s.t. (1/40)x1 + (1/3)x2 40
0 x1 1000
0 x2 860

Symbolically: Berkeley Paint Company has t = 40 hours of production capacity available to produce n
number of paints.

n
X
P: max pi xi
i=1
n
X 1
s.t. xi t
i=1
ri
0 xi ui for i = 1 . . . n

1-1
Lecture 2: September 5 2-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 2: September 5
Lecturer: Erik Bertelli Scribes: Umesh Thillaivasan

2.2 Power Generation

2.2.1 Problem:

The state of California would like to plan its power generation capacity for the next 50 years. We know the
following:

1. There will be a power demand of dt MWs in year t

2. Current power plants will provide e MWs of power in each year

3. The state has the option to build two types of power plants:
Solar arrays, which cost st per MW to build in year t and last for 10 years
Nuclear plants, which cost nt per MW to build in year t and last for 20 years

How can California formulate a linear program to find the cheapest way to meet the demand forecast? You
may assume once the plant is built there are no ongoing upkeep or variable costs.

2.2.2 Decision Variables:

Let: xt = the number of MW of solar arrays to build in year t


yt = the number of MW of solar arrays to build in year t
We need to create new (auxiliary) decision variables to account for the total power available in year t. wt =
the number of MWs from solar arrays available in year t
zt = the number of MWs from nuclear plants available in year t

2.2.3 Equations:

We need to minimize the cost of meeting the power demand forecast.


50
X
st xt + nt yt
t=1

Define wt and zt based on the preceding values of xt and yt .


t
X
wt = xk
k=max(1,(t9))
2-2 Lecture 2: September 5

t
X
zt = yk
k=max(1,(t19))

Demand constraint: wt + zt + e dt

2.2.4 LP Formulation:

50
X
P: min st xt + nt yt
t=1
s.t. wt + zt + e dt t = 1, . . . , 50
t
X
wt = xk t = 1, . . . , 50
k=max(1,(t9))
t
X
zt = yk t = 1, . . . , 50
k=max(1,(t19))

xt , yt , wt , zt 0 t = 1, . . . , 50

2.2.5 New Constraint: Limiting nuclear power

Suppose people in California are afraid of too many nuclear power plants, so the state decides to limit the
total amount of MW that can be made from nuclear at any one time to never exceed 20%. How can you
add this new constraint to the model?
0.8zt 0.2(wt + e)

2.2.6 New Constraint: Shutting down old power plants

Remember that we said there is e power being generated already? Lets assume that this is all being produced
by coal plants that are bad for the environment. Now say that California would get dollars from the federal
government if it shut down all of the coal plants being used, and that it would get the equivalent percentage
if only some of the coal plants were shut down. For instance, if they shut down 10% of the coal plants they
get 10% of dollars. How would you add this to the model? Assume that once the coal plant is shut down
it cannot be used again. Let vt = the percent of MWs of coal plants shut down by year t

wt + zt + (1 vt )e dt 0leqvt 1

2.2.6.1 New Constraint: Prevent Re-opening

How do we prevent the model from reopening closed coal plants? For instance, it could set v1 = 0.1 and
v2 = 0 which should not be allowed.
vt vt+1
This will ensure a shut down plant stays shut down
2.2.7 New LP:

How do we add the benefit from shutting down these plants to the model? Remember, California only gets
the money once.
50
X
v5 0 + st xt + nt yt
t=1

Why is it negative? Because we are minimizing costs, and this is money that the state is getting, not
spending.

2-3
IND ENG 240: Optimization Analytics Fall 2017

Discussion 3: September 12
Lecturer: Erik Bertelli Scribes: Umesh Thillaivasan

Primarily AMPL.

3-1
Lecture 4: September 19 4-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 4: September 19
Lecturer: Alfonso Lobos Scribes: Umesh Thillaivasan

4.3 Absolute Values

P: min |x1 + 5x2 |


s.t. x1 3x2 2
x1 0

4.3.0.1 Form 1:

Convert |x| = max {x, x}. We create a new variable z = |x1 + 5x2 | which is 2 components: z x1 + 5x2
and z (x1 + 5x2 ).
P: min z
s.t. x1 3x2 2
z x1 + 5x2
z (x1 + 5x2 )
x1 0

4.3.0.2 Form 2:

Each number can be divided into the difference between its positive and negative parts: 35 = (35) - (0).
-15 = (0) - (15). In general: x = z + z . In the Objective Function it is z + + z because the absolute
value will take the positive values only in the end, and minimize or maximize appropriately.
P: min z + + z
s.t. x1 3x2 2
z + z = x1 + 5x2
x1 , z + , z 0

4.3.1 Doesnt Always Work:

Can only use absolute value trick when: min +|...| or max |...|

4.4 Arbitrage Example

max( min {S1 , S2 , S3 , . . . , Sn })


4-2 Lecture 4: September 19

Let z = (min {S1 , S2 , S3 , . . . , Sn }). Then


P: max z
s.t. z Si i = 1 . . . n

4.5 Example 1: Find Certificates

When converting from max(x1 + x2 ) min (x1 + x2 )

P: max x1 + x2
s.t. x1 + 2x2 5
2x1 x2 4
x1 0
x2 0

To Symmetric becomes:
P: min (x1 + x2 )
s.t. x1 + 2x2 5
(2x1 x2 ) (4)
x1 0
x2 0

Bounded?
 cj 
1 1
   
1 2 5

2 1 4
aij bi
Check Bounded Certificate. ai jyi cj s are number of rows and you move down
y1 + 2y2 1
2y1 + y2 1
y1 0
y2 0

4.6 Example 2: Find Certificates

P: min 2x1 + x2
s.t. x1 + 2x2 4
3x1 + 2x2 6
x1 0
x2 0
Lecture 4: September 19 4-3

Feasible? Yes, when x1 = 4 and x2 = 0.

 cj 
2 1
   
1 2 4

3 2 6
aij bi

Bounded? Yes, when y1 = y2 = 0, but lets check Unbounded Certificate anyways. Read across matrix rows
for equations 0 and then the top matrix 0.

w1 + 2w2 0
3w1 + 2w2 0
2w1 + w2 < 0

4.7 Certificates

j..n refers to variables.


i..m refers to constraints
So xn and wn are moving left to right, ym and zm move top to bottom.

4.7.1 Misunderstandings
1. Problem Infeasible: Infeasibility certificate holds.

2. Problem bounded: Feasibility + boundedness certificate holds.


3. Problem unbounded: Feasibility + Unboundeness certificate holds.

4.7.1.1 Rules from the Theorems:

1. A LP either satisfies the certificate of feasibility or satisfies the infeasibility certificate. One of the two
certificates always hold.
2. A LP either satisfies the certificate of boundedness or satisfies the unboundedness certificate. One of
the two certificates always hold.

4-4
Lecture 5: September 26 5-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 5: September 26
Lecturer: Alfonso Lobos Scribes: Umesh Thillaivasan

5.8 Comments about Certificates

The way certificates should be thought, is: if I found xs, ys, ws or zs that satisfy the certificate then
something happens.
Lower Bound for the Primal, use the Boundedness Certificate.

5.9 Finding Certificates

5.9.1 Example 1

P: max |x1 | |x2 |


s.t. |x1 x2 | 2


Convert to Symmetric. Let x1 = x+
1 x1 and

P: min |x1 | + |x2 |


s.t. x1 x2 2
(x1 x2 ) 2


Now split x1 = x+ +
1 x1 and x2 = x2 x2 into their positive and negative parts. Multiply by -1 to change
inequality sign.

P: min x+ +
1 + x1 + x2 + x2

s.t. x+ +
1 x1 x2 + x2 2

x+ +
1 + x1 + x2 x2 2

x+ +
1 , x1 , x2 , x2 0

Bounded?
 cj 
1 1 1 1
   
1 1 1 1 2

1 1 1 1 2
aij bi

Feasible? Yes when x+ +
1 = x1 = x2 = x2 = 0. Now, check Bounded Certificate. ai jyi cj s are number of
rows and you move down

y1 + y2 1
y1 y2 1
y1 y2 1
y1 + y2 1
y1 , y2 0
P P
Optimal? Yes, because Feasible and Bounded when ci xi = bi yi

5.9.2 Example 2

P: min 5x1 6x2 + 4x3


s.t. x1 x2 4x3 1
x1 + 3x2 x3 2
x1 , x2 , x3 0

Feasible? Yes, when x1 = 11, x2 = 10, x3 = 0. Could also show that you cannot find an Infeasibility
Certificate.

 cj 
5 6 4
   
1 1 4 1

1 3 1 2
aij bi

Move down columns like You would for Bounded.

z1 z2 0
z1 + 3z2 0
4z1 z2 0
z1 , z2 0
1z1 + 2z2 > 0

Can see a contradiction here. Therefore we cannot find an Infeasibility Certificate.

5-2
Lecture 5: October 3 5-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 5: October 3
Lecturer: Erik Bertelli Scribes: Umesh Thillaivasan

5.10 LP Duality & Sensitivity

5.10.1 Finding the Dual of the Primal

P: min x1 + 2x2 + 3x3 D: max 5y1 + 6y2 + 4y3


s.t. x1 + 3x2 = 5 (y1 ) s.t. y1 + 2y2 1
2x1 x2 + 3x3 6 (y2 ) 3y1 y2 2
x3 4 (y3 ) 3y2 + y3 = 3
x1 0 y1 free
x2 0 y2 0
x3 free y3 0

5.10.2 Finding the Dual of the Dual

The Dual of the Dual is the Primal.

D: min 5y1 6y2 4y3 P: max z1 2z2 3z3


s.t. y1 2y2 1 (z1 ) s.t. z1 3z2 = 5
3y1 + y2 2 (z2 ) 2z1 + z2 3z3 6
3y2 y3 = 3 (z3 ) z3 4
y1 free z1 0
y2 0 z2 0
y3 0 z3 free
5-2 Lecture 5: October 3
Lecture 5: October 3 5-3

5.10.3 Connection to Certificates

5.11 Sensitivity Analysis

5.11.1 General definition

How the uncertainty in the output of a mathematical model or system (numerical or otherwise) can be
apportioned to different sources of uncertainty in its inputs

5.11.2 Linear program

How small
Pn changes in parameter cj , bi , aij affect the current optimal solution x and optimal objective
value i=1 cj xj .

5.11.3 Terminology
Given a feasible solution x1 , . . . , xn :
Decision Variable xj is basic if xj 6= 0
Decision Variable xj is non-basic if xj = 0
Pn Pn
Constraint j=1 aij xj bi is binding if j=1 aij xj = bi
Pn Pn
Constraint j=1 aij xj bi is non-binding if j=1 aij xj > bi

Shadow Price yi :
Change of the objective function from one unit increase in its right-hand side bi . The shadow
price associated with a particular constraint is the change in the optimal value of the objective function
5-4 Lecture 5: October 3

per unit increase in the right hand-side value for that constraint, all other problem data remaining
unchanged.
The dual prices are some of the most interesting values in the solution to a linear program. A
dual price is reported for each constraint. The dual price is only positive when a constraint is binding.
The dual price gives the improvement in the objective function if the constraint is relaxed by one unit.
In the case of a less-than-or-equal constraint, such as a resource constraint, the dual price gives the
value of having one more unit of the resource represented by that constraint. In the case of a greater-
than-or-equal constraint, such as a minimum production level constraint, the dual price gives the cost
of meeting the last unit of the minimum production target. The units of the dual prices are the units
of the objective function divided by the units of the constraint. Knowing the units of the dual prices
can be useful when you are trying to interpret what the dual prices mean.
Reduced Cost rj :
Amount by which the cost coefficient of non-basic variable cj must be lowered for that variable
to becomes basic (=0). The reduced cost associated with the nonnegativity constraint for each variable
is the shadow price of that constraint (i.e., the corresponding change in the objective function per unit
increase in the lower bound of the variable).
Associated with each variable is a reduced cost value. However, the reduced cost value is only
non-zero when the optimal value of a variable is zero. A somewhat intuitive way to think about the
reduced cost variable is to think of it as indicating how much the cost of the activity represented by
the variable must be reduced before any of that activity will be done. More precisely, ... the reduced
cost value indicates how much the objective function coefficient on the corresponding variable must
be improved before the value of the variable will be positive in the optimal solution. In the case of a
minimization problem, improved means reduced. So, in the case of a cost-minimization problem,
where the objective function coefficients represent the per-unit cost of the activities represented by
the variables, the reduced cost coefficients indicate how much each cost coefficient would have to be
reduced before the activity represented by the corresponding variable would be cost-effective. In the
case of a maximization problem, improved means increased. In this case, where, for example, the
objective function coefficient might represent the net profit per unit of the activity, the reduced cost
value indicates how much the profitability of the activity would have to be increased in order for the
activity to occur in the optimal solution. The units of the reduced cost values are the same as the
units of the corresponding objective function coefficients.
If the optimal value of a variable is positive (not zero), then the reduced cost is always zero. If the
optimal value of a variable is zero and the reduced cost corresponding to the variable is also zero, then
there is at least one other corner that is also in the optimal solution. The value of this variable will be
positive at one of the other optimal corners
Allowable Increase/Decrease:
Pn
Optimal solution x and objective
i=1 cj xj may change
Whether a decision variable is basic or non-basic stays unchanged
Whether a constraint is binding or non-binding stays unchanged
If x is optimal for the Primal and y is optimal for the Dual then:
1. rj xj = 0 j = 1 . . . n
2. si yi = 0 i = 1 . . . m
Where rj is the Reduced Cost and sj is the Slack of a Primal constraint.
Slack or Surplus
A slack or surplus value is reported for each of the constraints. The term slack applies to less
than or equal constraints, and the term surplus applies to greater than or equal constraints. If a
constraint is binding, then the corresponding slack or surplus value will equal zero. When a less-than-
or-equal constraint is not binding, then there is some un-utilized, or slack, resource. The slack value is
the amount of the resource, as represented by the less-than-or-equal constraint, that is not being used.
When a greater-than-or-equal constraint is not binding, then the surplus is the extra amount over the
constraint that is being produced or utilized.
The units of the slack or surplus values are the same as the units of the corresponding constraints.

5.11.4 Diet Problem

Variable Sensitivity Analysis. Looking at the bounds, if the price of a Quarter Pounder goes above $1.73, it
might not make sense to include it in the optimal solution.

Constraint Sensitivity Analysis. You have all the Cholesterol you can have in the diet, but have not taken
any Total Fat..

5-5
Lecture 7: October 10 7-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 7: October 10
Lecturer: Erik Bertelli Scribes: Umesh Thillaivasan

7.12 Continuous Knapsack Problem

You want to set up an emergency bag in case of an earthquake. Four items can be packed: gold, water,
pillow, brick, with the following data, and you want to pack at least 5 units of water. Suppose your pack
has the maximum volume of 60 and you can bear at most 100 weight. Find how much each item to pack to
maximize the value.

Table 7.2: Knapsack Problem


Gold Water Pillow Brick
Value 24 5 2 3
Volume 3 8 14 6
Weight 20 10 2 15

This is the LP of the scenario with an optimal solution of x1 = 2.5 and x2 = 5.

P: max 24x1 + 5x2 + 2x3 + 3x4


s.t. 3x1 + 8x2 + 14x3 + 6x4 60
20x1 + 10x2 + 2x3 + 15x4 100
x2 5
x1 0
x2 0
x3 0
x4 0

The Dual is here with an optimal solution of y1 = 0, y2 = 1.2, and y3 = 7.

D: min 60y1 + 100y2 + 5y3


s.t. 3y1 + 20y2 24
8y1 + 10y2 + y3 5
14y1 + 2y2 2
6y1 + 15y2 3
y1 0
y2 0
y3 0
7-2 Lecture 7: October 10

7.12.1 Key Idea

In order for a change to be withing the allowable range, both of these must be true:

Whether a decision variable is basic or non-basic stays unchanged

Whether a constraint is binding or non-binding stays unchanged

Variable Sensitivity Analysis:

Constraints Sensitivity Analysis:

7.12.2 Case 1: Changing RHS bi

7.12.2.1 Case 1A: Changing bi of non-binding () constraint

Shadow price yi = 0 by Complementary Slackness. For example, when looking at changing b1 from
60 to 80 we know that: 1. Allowable Increase is +. 2. Allowable Decrease is si = 12.5. 3. New Optimal
Solution is unchanged. 4. New Optimal Objective Value is unchanged

7.12.2.2 Case 1B: Changing bi of binding (=) constraint

Shadow price yi 6= 0 (yi = 0 for binding constraint means degeneracy). For example, when looking at
changing b2 from 100 to 80 we know that: 1. Allowable Increase is 83.33. 2. Allowable
Pn Decrease is 50. 3.
New Optimal Solution is xnew
1 = 1.5, x new
2 = 5. 4. New Optimal Objective Value is i=1 cj x new
j = 61.

P: max 24x1 + 5x2 + 2x3 + 3x4


s.t. 3x1 + 8x2 + 14x3 + 6x4 60
20x1 + 10x2 + 2x3 + 15x4 100 +
x2 5
x1 0
x2 0
x3 0
x4 0
Lecture 7: October 10 7-3

Reduces to:

P: max 24x1 + 5x2


s.t. 3x1 + 8x2 60 (7.1)
20x1 + 10x2 = 100 + (7.2)
x2 = 5 (7.3)
x1 0 (7.4)
x2 0 (7.5)

From (3) we get x2 = 5, substitute into (2) and we get

5
x1 = +
2 20

. From (4) we get x1 0 50. And from the x1 equation we get 3x1 20 83.33. We see these
values added to 100 in the constraint bounds.

7.12.3 Case 2: Changing Objective Function cj

7.12.3.1 Case 2A: Changing cj of non-basic (=0) variable

Reduced Cost rj 6= 0 (rj = 0 for non-nasic variables means multiple optimal solutions).

m
X
rj = cj aij yi
i=1

Consider c3 which has a reduced cost of r3 = 0.4. This means the allowable increase is rj = 0.4. The
allowable decrease is +.
Now consider changing c3 from 2 to 2.1. The new optimal solution remains unchanged. The new optimal
objective value remains unchanged.

7.12.3.2 Case 2B: Changing cj of basic (6= 0) variable

Reduced Cost rj = 0.
Consider c2 , the allowable increase is 7 and the allowable decrease is +.
Now consider changing c2 from 5 to 10. Then you get the new optimal solution is unchanged. The new
optimal objective value is
n
X n
X
cnew
j xj = cj xj + x2 = 110
j=1 j=1
7-4 Lecture 7: October 10

P: max 24x1 + (5 + )x2 + 2x3 + 3x4


s.t. 3x1 + 8x2 + 14x3 + 6x4 60
20x1 + 10x2 + 2x3 + 15x4 100
x2 5
x1 0
x2 0
x3 0
x4 0

Consider the Dual of the Problem.

D: min 60y1 + 100y2 + 5y3


s.t. 3y1 + 20y2 24
8y1 + 10y2 + y3 5 +
14y1 + 2y2 2
6y1 + 15y2 3
y1 0
y2 0
y3 0

The Optimal Solution is y1 = 0, y2 = 1.2, y3 = 7. Apple Case 1B on the Dual gives:

P: min 100y2 + 5y3


s.t. 20y2 = 24
10y2 + y3 = 5 +
2y2 2
15y2 3
y2 0
y3 0

Solving for gives: 7.

7.12.4 Case 3: Changing aij

7.12.4.1 Case 3A: Changing aij of non-basic (=0) variable

Consider a24 , the allowable increase is + and the allowable decrease is 12.5. Changing a24 from 15 to 3
gives an unchanged new optimal solution and an unchanged new optimal objective value.
Lecture 7: October 10 7-5

P: max 24x1 + 5x2 + 2x3 + 3x4


s.t. 3x1 + 8x2 + 14x3 + 6x4 60
20x1 + 10x2 + 2x3 + (15 + )x4 100
x2 5
x1 0
x2 0
x3 0
x4 0

Ensure the sign of rj is the same as before . For a Maximization problem, if rj 0 before, then rj needs
to also be 0 for the solution to stay optimal. For Minimization, rj 0 before, then rj 0. In this case
r4 = 15 so our new value must also be negative since this is maximization.
r4 0
m
X
c4 ai,4 yi 0 = 3 (6)(0) (15 + )(1.2) (0)(7) 0
i=1
12.5

This brick 12.5 means that we can increase the weight of the brick to + and not care, and if we
decrease the weight of the brick from 15 by more than 12.5, then we might consider taking it and be a part
of the optimal solution, because it would have a positive reduced cost.
Another example: Lets say we found a pillow that for the same weight and value, it uses only 10 of volume
(instead of 14). Would our optimal solution change? Strategy: 1. Remove the whole old column for x3 for
the problem. 2. Enter the updated column again and check the conditions for a new variable (x3 = 0).
Original optimal solution was y1 = 0, y2 = 1.2, y3 = 7. Reduced Cost Check:
r3 = 2 10(y1 ) 2(y2 ) = 2 10(0) 2(1.2) = 0.4 < 0
Given that our original problem is a maximization having a negative reduced cost implies that our original
primal solution continue being optimal.

D: min 60y1 + 100y2 + 5y3


s.t. 3y1 + 20y2 24
8y1 + 10y2 + y3 5
14y1 + 2y2 2
6y1 + 15y2 3
y1 0
y2 0
y3 0

7.12.5 Case 4: Add a New Constraint

Adding a new constraint:


If current solution satisfies the new constraint
New optimal solution: Unchanged
New optimal objective value: Unchanged
If current solution does not satisfy the new constraint
Dual simplex method (ignore for now)

7.12.6 Case 5: Add a New Decision Variable xn+1

When adding a new decision variable xn+1 , assume is it non-basic (6= 0) and check rn+1 .
For example, adding a First Aid Kit with value=20, volume=10, weight=10, we check:
n
X
r5 = c5 aij yi = 20 10(0) 10(1.2) + 0(7) = 8 > 0
i=1

Since this problem is a maximization problem, a positive reduced cost means we need to resolve the
problem. For Minimization we want -ve Reduced Cost to remain Optimal

7-6
Lecture 8: October 17 8-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 8: October 17
Lecturer: Alfonso Lobos Scribes: Umesh Thillaivasan

8.13 General Dual Example

Lets obtain the dual of our max problem without changing to symmetric form. P defined as:

P: max 5x1 + 3x2


s.t. x1 + 2x2 3
x1 x2 1
x1 + 5x2 = 0.5
x1 free
x2 0

8.13.1 Obtaining the Dual for All Possible Cases


1. Now the variable xs and ys can be or leq or free
Pm Pn
2. The rj = cj i=1 aij yi and the si = j=1 aij xj can either be or leq or =0 for all j=1..n and
i=1..m

3. Trick: We require rj xj 0 and si yi 0 for all i and j

8.13.1.1 Primal-Dual Table

8.13.1.2 General rules

1. right hand side (RHS) replace the objective coefficients

2. Obj. coef. replace RHS


8-2 Lecture 8: October 17

3. Equalities implies free and vice versa

4. If going from min to max, P variables change the sign of the D constraints, but P constraints dont
change the sign of D variables

5. From max to min the changes are the opposite.

For Example:

P: max 5x1 + 3x2 D: min 3y1 + y2 + 0.5y3


s.t. x1 + 2x2 3 s.t. y1 + y2 + y3 = 5
x1 x2 1 2y1 y2 + 5y3 3
x1 + 5x2 = 0.5 y1 0
x1 free y2 0
x2 0 y3 free

8.14 Phase 1 Problems

Notice that the phase I problem is always feasible and bounded (its objective function value is always 0).
Then there is an optimal primal and dual solution. Any dual optimal solution is a certificate of infeasibility
if the optimal primal function value is positive.
8-3
Lecture 9: October 24 9-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 9: October 24
Lecturer: Alfonso Lobos Scribes: Umesh Thillaivasan

9.15 Integer Linear Programming

9.15.1 Terminology

ILP stands for Integer Linear Programming. MILP for Mixed Integer Linear Programming (notation may
change depending on the reference). A special case of integer is binary. Notice that x binary can also be
written as 0 x 1
n
X
P: min ci x i
i=1


n
X
s.t. aij xi = bj j = 1 . . . m
i=1
xi integer i = 1 . . . n ILP
xi integer or real i = 1 . . . n MILP

Integer variables, and in particular binary variables, are specially well suited to write logical statements.
Usually we think of x = 0 as false, and x = 1 as true .

Super Important: Your reformulation should express no more and no less than what you are trying to
express. For example, if you are trying to express an implication for one direction, you dont want to also
obligate the implication on the other way or extra implications.

9.15.2 Job Scheduling Problem

We consider the production of a single product over T periods. If we decide to produce at period t, a setup
cost of ct is incurred. For t = 1, . . . , T let dt be the demand for this product in period t, and let pt , be the
unit production and storage cost respectively for period t. Formulate a MILP in order to minimize the total
cost of production, storage, and setup.

9.15.2.1 Variables

zt = binary variable that indicates if we produce in month t


xt = production in month t
It = inventory in month t (Also I = 0 is included)
9-2 Lecture 9: October 24

9.15.2.2 Formulation

T
X
P: min (zt ct + xt pt + It ht
t=1
T
X
s.t. xt zt ( dt ) t = 1 . . . T
t=1
It = It1 + xt dt t = 1 . . . T
I0 = 0
zt binary t = 1 . . . T
xt 0t = 1 . . . T
It 0t = 1 . . . T

Suppose we allow demand to be lost in every period except for period T, at a cost of bt per unit lost of
demand. Show how to modify the model to handle this option.
Solution: We need to add a new variable `t that is the demand lost in period t. We have to take into account
the fact that it may be optimal to not satisfy demand in period t even if we could in order to use the saved
storage for the next period.
T
X T
X 1
P: min (zt ct + xt pt + It ht + `t bt
t=1 t=1
T
X
s.t. xt zt ( dt ) t = 1 . . . T
t=1
It = It1 + xt dt + `t t = 1 . . . T
IT = IT 1 + xT dT
`t dt t = 1 . . . T
I0 = 0
`t 0 t = 1 . . . T
zt binary t = 1 . . . T
xt 0t = 1 . . . T
It 0t = 1 . . . T

Suppose that production capacity can occur in at most five periods, but no two such periods can be consec-
utive. Show how to modify the model to handle this option.
Solution: Add the following constraints
T
X
zt 5
t=1
zj + zj+1 1 t = 1 . . . T

9.15.3 Moving Problem

Suppose you are planning to move your new house. You have n items of size aj , j=1..n that need to be
moved. You have rented a truck that has size Q and you have bought m boxes. Box i has size bi , i=1..m.
Lecture 9: October 24 9-3

Formulate an integer programming problem in order to decide if the move is possible.


Solution: This problem needs extra assumptions, i will assume the following two:
First, lets imagine that the truck deliverers are so good at Tetris that for any combination of boxes with
total volume less than Q they are able load the truck.
Second, we can put as many objects in a box as long we do not surpass its volume (but of course lets imagine
we can not divide the objects).

9.15.3.1 Variables

zi = binary variable that represents if box i (1..m) is taken in the truck or not
xij = binary variable that represents if item j (1..n) is stored in the box i or not

9.15.3.2 Formulation

m
X
P: min zi
i=1
Xm
s.t. xij = 1 j = 1 . . . n also works
i=1
Xn
aj xij zi bi i = 1 . . . m Box Capacity
j=1
Xn
zi bi Q i = 1 . . . m Truck Capacity
j=1

zj binary i = 1 . . . m
xj binary i = 1 . . . m j = 1...n

9.16 Binary Variables

A company has 5 projects to choose from.



1 Project selected
xi =
0 otherwise

9.16.1 If Project 3 selected, then Project 5 cannot be selected

Mutually Exclusive x3 + x5 1 (x3 , x5 ) can be 1,0, 0,1, or 0,0 but not 1,1 (both).
9.16.2 Exactly 1 of Projects 2 and 3 must be selected

Multiple Choice x2 + x3 = 1 (x2 , x3 ) can be 1,0, 0,1, but not 0,0 (neither) or 1,1 (both).

9.16.3 If Project 4 selected, then Project 2 is also selected

Conditional Constraint where x4 depends on x2 . x4 x2 (x4 , x2 ) can be 1,0, 0,1, or 0,0 but not 1,1.

9-4
Lecture 10: October 31 10-1

IND ENG 240: Optimization Analytics Fall 2017

Discussion 10: October 31


Lecturer: Alfonso Lobos Scribes: Umesh Thillaivasan

10.17 Integer Linear Programming

10.17.1 Terminology

See Slides.

10.17.2 Mondo Motorcycles

Mondo motorcycles is determining its production schedule for the next four quarters. Demand for motorcycles
will be as follows: quarter 1-40, quarter 2-70, quarter 3-50, quarter 4-20. Mondo incurs four types of costs, 1.
it costs Mondo $400 to manufacturer each motorcycle. 2. At the end of each quarter, a holding cost of $100
per motorcycle is incurred. 3. Increasing production from one quarter to the next incurs costs for training
employees. It is estimated that a cost of $700 per motorcycle is incurred if production is increased from one
quarter to the next. 4. Decreasing production from one quarter to the next incurs costs for severance pay,
increasing morale, and so forth. It is estimated that a cost of $600 per motorcycle is incurred if production
is decreased from on quarter to the next.
Pt = number of motorcycles produced during quarter t ( t = 1, 2, 3, 4)
it = inventory at end of quarter t ( t = 1, 2, 3, 4)
xt = increase in quarter t production over quarter t - 1 production ( t = 1, 2, 3, 4)
xt = decrease in quarter t production from quarter t - 1 production ( t = 1, 2, 3, 4)
min z = 400P1 + 400P2 + 400P3 +400P4 +100i1 + 100i2 + 100i3 + 100i4 + 700x1 + 700x2 + 700x3 +
700x4 +600x1 + 600x2 + 600x3 + 600x4
s.t.
i1 = 0+P1 - 40
i2 = i1 + P2 - 70
i3 = i2 +P3 - 50
i4 = i3 + P4 - 20
P1 - 50 = x1 - x1
P2 - P1 = x2 - x2
P3 - P2 = x3 - x3
P4 - P3 = x4 - x4
it, Pt, xt, xt = 0 ( t = 1, 2, 3, 4)
Suppose that Mondo no longer must meet demands on time. For each quarter that demand for a motorcycle
is unmet, a penalty or shortage cost of $110 per motorcycle short is assessed. Thus, demand can now be
backlogged. All demands must be met, however, by the end of quarter 4. Modify the formulation of the
Mondo Problem that follows to allow for backlogged demand.
min z = 400P1 + 400P2 + 400P3 +400P4 +100 + (100i1 + 100i1 + 100i2 + 100i2 + 100i3 + 100i3 + 100i4
+ 110i4) + 700x1 + 700x2 + 700x3 + 700x4 +600x1 + 600x2 + 600x3 + 600x4
s.t.
i1-i1 = 0+P1 - 40
10-2 Lecture 10: October 31

i2-i2 = i1 i1 + P2 - 70
i3-i3 = i2 i2 +P3 - 50
i4-i4 = i3 i3 + P4 - 20
P1 - 50 = x1 - x1
P2 - P1 = x2 - x2
P3 - P2 = x3 - x3
P4 - P3 = x4 - x4
it = 0
it =0
i4 = 0
it, Pt, xt, xt = 0 ( t = 1, 2, 3, 4)

You might also like