You are on page 1of 20

Slides adopted from Prof.

Gesualdo Scutari (SP 2016)

Lesson 11: Linear Programming Models II


IE 335: Operations Research - Optimization

Instructor: Professor Chris Quinn

September 7, 2016

Today...

Theme: not obvious decision variables


Examples:
I

Scheduling postal workers

Inventory management

Scheduling postal workers

Each postal worker works for 5 consecutive days, followed by 2 days


off, repeated weekly
Demand for workers for each day of the week
di = demand for workers on day i
I

for i = 1, . . . , 7

Indices: Monday = 1, Tuesday = 2, ... , Sunday = 7

We want to minimize the number of total workers used


I

For now, lets assume that fractional workers are allowed

Scheduling postal workers


Step 1: How should we define the decision variables?
I

My answer: let
xi = number of workers who work on
days i, i + 1, i + 2, i + 3, i + 4 (mod 7)
for i = 1, . . . , 7

For example,
x1 = number of workers who start work on Monday
and work through Friday
x4 = number of workers who start work on Thursday
and work through Monday
x7 = number of workers who start work on Sunday
and work through Thursday
4

Scheduling postal workers

Step 2: Write the objective function


I

We want to minimize the total number of workers

Total number of workers = Add up the number of workers who


work in each type of shift

Objective:
minimize

7
X

xi

i=1

Scheduling postal workers


Step 3: Write the constraints
I

Day i needs di workers

Who works on Monday (i = 1)?

Workers on the Monday-Friday shift (x1 )

Workers on the Thursday-Monday shift (x4 )

Workers on the Friday-Tuesday shift (x5 )

Workers on the Saturday-Wednesday shift (x6 )

Workers on the Sunday-Thursday shift (x7 )

Constraint for meeting demand for workers on Monday:


x1 + x4 + x5 + x6 + x7 d1

Scheduling postal workers

Similar constraints for each day of the week:


+ x4 + x5 + x6 + x7 d1

(Mon)

+ x5 + x6 + x7 d2

(Tue)

+ x6 + x7 d3

(Wed)

+ x7 d4

(Thu)

d5

(Fri)

d6

(Sat)

x3 + x4 + x5 + x6 + x7 d7

(Sun)

x1
x1 + x2
x1 + x2 + x3

x1 + x2 + x3 + x4
x1 + x2 + x3 + x4 + x5
x2 + x3 + x4 + x5 + x6

Scheduling postal workers


The model:
min x1 + x2 + x3 + x4 + x5 + x6 + x7
s.t.

+ x4 + x5 + x6 + x7 d1

(Mon)

+ x5 + x6 + x7 d2

(Tue)

+ x6 + x7 d3

(Wed)

+ x7 d4

(Thu)

d5

(Fri)

d6

(Sat)

x3 + x4 + x5 + x6 + x7 d7

(Sun)

x1
x1 + x2
x1 + x2 + x3

x1 + x2 + x3 + x4
x1 + x2 + x3 + x4 + x5
x2 + x3 + x4 + x5 + x6

xi 0

for i = 1, . . . , 7

Scheduling postal workers

More natural decision variables:


yi = number of workers on day i

for i = 1, . . . , 7

Easy to formulate number of workers on day i is at least di


yi di

for i = 1, . . . , 7

How to formulate each worker works 5 consecutive days followed by


2 consecutive days off?

Things to keep in mind

Sometimes the decision variables incorporate constraints of the


problem
I

Art of optimization

Hard to do this well, but worth keeping in mind

Good integer programming models often require this

10

Inventory management

Global Minimum manufactures ski jackets


Business is highly seasonal
Demand for quarter t is dt (t = 1, 2, 3, 4)
Cost of producing 1 jacket in quarter t is pt (t = 1, 2, 3, 4)
Company can produce up to C jackets per quarter
In order to properly warm up the production line, the total number of
jackets produced in quarters 2 and 3 must be at least twice the
number of jackets produced in quarter 1.

11

Inventory management
Inventory must be built up to meet larger demands
Cost of holding 1 jacket from quarter t to quarter t + 1 is ht
(t = 1, 2, 3)
No initial inventory
Jackets in inventory at the end of quarter 4 are salvaged
Each jacket salvaged reduces total cost by s
Global wants to meet demand while minimizing production and
inventory costs
Assume volume is large, so we can ignore integrality

12

Inventory management

Step 1: Define the decision variables


I

How much to produce in each quarter?

Define
xt = number of jackets produced in quarter t
for i = 1, 2, 3, 4

13

Inventory management

Step 1: Define the decision variables


I

Also want to keep track of how much we have in inventory

Define
zt = number of jackets in inventory at the end of quarter t
for t = 1, 2, 3, 4

Wait... are these decisions that we make?

14

Inventory management

The zt variables do not represent explicit decisions


Sometimes adding auxiliary decision variables helps with modeling
In this case, we can write a correct model without the zt variables,
but is much more cumbersome
Sometimes, you might need/want to go back and add decision
variables once you start building an optimization model

15

Inventory management

Step 2: Write the objective function


I

We want to minimize production and inventory costs

Objective:
minimize

4
X
t=1

p t xt +

3
X

ht zt sz4

t=1

16

Inventory management
Step 3: Write the constraints
I

How are inventory and production levels at different quarters


related?

Inventory at
Amount
the end of + produced
quarter t 1
in quarter t



Inventory at
Demand
=
+ the end of
in quarter t
quarter t

Sometimes referred to as balance constraints

Constraints:
x1 = d1 + z1

z1 + x2 = d2 + z2

z2 + x3 = d3 + z3

z3 + x4 = d4 + z4
17

Inventory management
Step 3: Write the constraints
I

Company can produce up to C jackets per quarter

Constraints:
xt C

for t = 1, 2, 3, 4

Number of jackets produced in quarters 2 and 3 must be at least


twice the number of jackets produced in quarter 1

Constraints:
2x1 x2 + x3

Cannot produce a negative jacket

Constraints:
xt 0 for t = 1, 2, 3, 4
18

Inventory management
The model:
minimize

4
X

p t xt +

t=1

subject to

3
X

ht zt sz4

t=1

x1 = d1 + z1
z1 + x2 = d2 + z2
z2 + x3 = d3 + z3
z3 + x4 = d4 + z4
xt C

for t = 1, 2, 3, 4

2x1 x2 + x3
xt 0

for t = 1, 2, 3, 4

zt 0

for t = 1, 2, 3, 4

19

Recap

Two examples of linear models


Take-home message: choosing the proper optimization variables
may not be trivial

20

You might also like