Week 1 Lecture 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Operations Research

1
Energy plant problem
I Two kinds of black coal, A and B, are pulverized and burned
I Which mix of A and B maximizes the energy production under
constraints?
I 1 ton produces. . .
Product Power (Watts) Soot (kg) Sulfur particles per million
A 240 000 0.5 1 800
B 200 000 1 3 800
Restrictions:
1. Supply by train restricted to 20 tons/hour (A and B together)
2. Pulverizing capacity of the plant is 16 ton/hour if only A is pulverized
and 24 ton/hour if only B is pulverized (any mix is possible)
3. Exhaust of soot is restricted to 12 kg per hour
4. Exhaust of sulfur is restricted to 3 000 particles per million

2
Energy plant problem LP
Define decision variables x1 as the number of tons burned per hour of
coal type A and x2 as the number of tons burned per hour of coal type
B. Then the maximization problem can be modelled by the following
LP formulation.

max 24x1 + 20x2


s.t. x1 + x2 ≤ 20 train constraint
1 1
x
16 1 + 24 x2 ≤ 1 pulver constraint
0.5x1 + x2 ≤ 12 soot constraint
3x1 − 2x2 ≥ 0 sulfur constraint

x1 ≥ 0, x2 ≥ 0.

3
Geometry

4
Inventory production planning
I Demand and unit production cost of commodity over the next 5
weeks:
1 2 3 4 5
Di 150 300 250 375 125
ci 15 20 20 10 25
I On time delivery: produce item for week i in or before week i
I Holding cost e 4 for every unit in stock at the end of the week (same
for all i)
I Goal: Minimize the sum of total production and inventory cost

5
Variables and objective
I Decision variables: xi is production in week i, i = 1, 2, 3, 4, 5.
I Auxiliary variables: Ii is inventory end of week i, i = 1, 2, 3, 4, 5.

P5 P5
I Objective: Minimize j=1 cj xj +4 j=1 Ij .

6
Constraints
I i = 1 : x1 = D1 + I1 → x1 − I1 = 150.
I i = 2, 3, 4, 5 : xi + Ii−1 = Di + Ii → xi − Ii + Ii−1 = Di .
I All variables xi and Ii are nonnegative.

7
LP formulation

5
X
min 15x1 + 20x2 + 20x3 + 10x4 + 25x5 + 4 Ij
j=1

s.t. x1 − I1 = 150
x2 + I1 − I2 = 300
x3 + I2 − I3 = 250
x4 + I3 − I4 = 375
x5 + I4 − I5 = 125
Ij ≥ 0 j = 1, 2, . . . , 5
xj ≥ 0 j = 1, 2, . . . , 5

8
Zero-sum games
Let M be some m × n matrix
E.g.,  

1 −1
M=


−1 1 


−2 0

9
Zero-sum games
Let M be some m × n matrix
E.g.,  

1 −1
M=


−1 1 


−2 0

I Alice and Bob play a game: Alice picks a row i, and Bob a column j.
I After these pickings Bob (the column player) has to pay Alice (the
row player) Mij euro.
I If Mij < 0 then this means that Alice pays Bob −Mij euro.

9
Rock-paper-scissors
Q: What matrix corresponds to the game of rock-paper-scissors, with a
bet of e 1?

10
Mixed strategies
Q: What is a good strategy for rock-paper-scissors?
 

0 −1 1 
M=


1 0 −1

−1 1 0

11
Mixed strategies
Q: What is a good strategy for rock-paper-scissors?
 

0 −1 1 
M=


1 0 −1

−1 1 0

Mixed strategy: Alice plays row i with probability xi .


For example: Choose x1 = 13 , x2 = 31 , x3 = 1
3 which turns out to be
optimal (as you might have guessed).

11
Best mixed strategy as an LP

 
1 −1
Given payoff matrix M, what is Alice’s best
M = −1 1 
 
mixed strategy?
−2 0

I Assume best play by Bob, given he knows


Alice’s mixed strategy

12
Mathematical model
I Decision variables: xi is probability to play strategy (row) i for
i = 1, 2, 3
Pm
I Constraints: 0 ≤ xi ≤ 1 for i = 1, 2, . . . , 3 and i=1 xi = 1.
I Objective: Maximize
min(x1 · 1 + x2 · (−1) + x3 · (−2), x1 · (−1) + x2 (1) + x3 · 0)
I This objective function is not linear!

13
Trick to obtain an LP
Introduce auxiliary variable z.

max z
s.t. z ≤ x1 − x2 − 2x3
z ≤ −x1 + x2
x1 + x2 + x3 = 1
xi ≥ 0 i = 1, 2, 3

14
LP (for general zero-sum game according to matrix M)

max z
m
X
s.t. z≤ Mij xi j = 1, 2, . . . , n
i=1
m
X
xi = 1
i=1
xi ≥ 0 i = 1, 2, . . . , m

15
Broader context: nonlinear programming

Nonlinear program

max f (x)
gi (x) ≤ bi , i = 1, . . . , m

with f , g1 , . . . , gm : Rn → R

I Linear programming is a special case of nonlinear programming


where f , g1 , . . . , gm are all linear

A function f : Rn → R is linear if for any x, y ∈ Rn , α ∈ R,

f (αx) = αf (x) and f (x + y) = f (x) + f (y)

16
Implications of linearity
I Divisibility: Variables can have fractional (non-integer) values

Consider a profit objective

max Z = f (x)
|{z}
Pn
cx
j=1 j j

I Additivity: Total profit is a sum of profits attributable to each variable


xj
I Proportionality: the profit attributable to xj is proportional to the the
amount xj : an increase of xj by 1 unit always increases Z by the
same amount cj .

17
Example of a problem that can’t be modelled as an LP

FakeDoors.com sells doors and windows. They can produce at


most 500 units of doors and windows together. Their revenue for
each door is e 100 and√for each window is e 50. But their cost to
produce x doors is 100 x, and the cost to produce x windows is
x − (x/20)2 .
How can they maximize their profit?

18
Example of a problem that can’t be modelled as an LP

FakeDoors.com sells doors and windows. They can produce at


most 500 units of doors and windows together. Their revenue for
each door is e 100 and√for each window is e 50. But their cost to
produce x doors is 100 x, and the cost to produce x windows is
x − (x/20)2 .
How can they maximize their profit?

Mathematical formulation of this problem:


max 100x1 + 50x2 − 100 x1 − (x2 − (x2 /20)2 )
s.t. x1 + x2 ≤ 500
x1 , x2 ≥ 0

18
Geometry of linear programming
2

10
31 + 22 = 18
8
1 = 4

6 22 = 12

2
1
0 2 4 6 8 10
Feasible region: Set of points x ∈ Rn that satisfy all constraints
19
Geometry of linear programming
2

10
31 + 22 = 18
8
1 = 4

6 22 = 12

2
1
0 2 4 6 8 10
Feasible region: Set of points x ∈ Rn that satisfy all constraints
19
Geometry of linear programming
2

10
31 + 22 = 18
8
1 = 4

6 22 = 12

2
1
0 2 4 6 8 10
Feasible region: Set of points x ∈ Rn that satisfy all constraints
19
Geometry of linear programming

A hyperplane in Rn is a set of the form


n
H = {x = (x1 , x2 , . . . , xn )T ∈ Rn : p T x(=
X
pj xj ) = b}
j=1

for some p ∈ Rn , b ∈ R.

20
Geometry of linear programming

A hyperplane in Rn is a set of the form


n
H = {x = (x1 , x2 , . . . , xn )T ∈ Rn : p T x(=
X
pj xj ) = b}
j=1

for some p ∈ Rn , b ∈ R.

Every hyperplane H as above divides Rn into two halfspaces:

H1 := {x ∈ Rn : p T x ≤ b}
H2 := {x ∈ Rn : p T x ≥ b}

20
Geometry of linear programming
Feasible region of an LP
P = {x ∈ Rn : all constraints satisfied},
is a polyhedron

A polyhedron is the intersection of a finite number of halfspaces.


A polytope is a polyhedron that is also bounded.

21
Is this a polytope?

22
Is this a polytope?

Answer: No, because polyhedrons and polytopes are always convex!

22

You might also like