You are on page 1of 18

Notes

Slides adopted from Prof. Gesualdo Scutari (SP 2016)

Lesson 2: An Introduction to Optimization Models


IE 335: Operations Research - Optimization

Instructor: Professor Chris Quinn

August 23, 2016

Notes

Announcements
Office Hours: (on syllabus and blackboard)
Monday 2:30pm-4:30pm in 157C (Xueyan)
Tuesday 1:00pm-3:00pm in 157E (Hui)
Wednesday 10:30am-12:30pm in 157E (Xueyan)
Thursday 2:00-4:00pm in 157D (Hui)
Friday 11:30-1:30pm in 386 (Dr. Quinn)
Office hours start this Friday. (so TAs start next week)
Registration: If you are not registered but would like to be, contact Dr.
Pat Brunese (pbrunese@purdue.edu)
Honors contracts, DRC notes, etc.: Email me for an appointment this
week else come to my office hours to speak with me.
2

Notes

Review: The OR approach

The OR model-building process for reaching a decision:


Phase I Model-building process
I Formulate a suitable mathematical model of the concrete
problem
I Analysis of the model (solution analysis, optimality, etc.)
Phase II Algorithmic design
I Compute analytically a solution or
I Use a numerical algorithm to solve the problem (ad-ho
scheme or commercial solver)

Notes

Today

Model-building process
I Illustrate the process of transforming a verbal problem into a
(mathematical) optimization model
Some practical examples

Notes

Art of Modeling
Level of abstractions in model development

Mathematical models are not in general the exact representation of


real situations. The majority of the applications involve (varying
degrees of) approximations

We abstract real world problems by concentrating on the dominant


variables that control the behavior of the real system
We then build a mathematical model of the assumed real world by
expressing in an amenable manner the mathematical functions that
represent the behavior of the assumed real world
No cookbook for Steps 1 and 2
5

Notes

What goes into an optimization model?

Determine the decision variables (what we choose: # of workers


hired, amount of product made)

Write the objective function (and goal) in terms of the decision


variables (the value of our choices, eg the total profit)

Write the constraints in terms of the decision variables


I

Main constraints (limitations, like total amount of material


available, the bare minimum staff needed on each shift)

Variable-type constraints (non-negative, continuous, discrete,


binary)

Notes

What goes into an optimization model?

An optimization problem looks like this:


minimize or maximize
subject to

(objective function)
(main constraints)
(variable-type constraints)

An optimal solution (or design) is the choice of values for decision


variables which gives the best possible objective value (eg most
profit), while satisfying all problem constraints

Notes

Example: James Bond Saves the World


Problem description

The World needs again the secret agent 007: There is an atomic
bomb on a platform in the middle of the sea that is about to go off.
The platform is at 50m from the beach and 007 is at 100m from that
location on the beach (see figure)
There is not too much time left and 007 must reach the bomb asap
007 is a great runner (he runs at 5m/s) and swimmer (his speed in
the water is 2m/s)
Which is the best strategy to reach the bomb asap?
bomb

50m

water
007
100m

beach
8

Notes

Example: James Bond Saves the World


Problem formulation

Assumed real world (approximations/assumptions):


I 007 moves along straight lines (it is faster)
I 007 does not zigzag (otherwise, more distance to travel)

Mathematical model
I Determine the decision variables
I Write the objective function
I Write the constraints

Notes

Step 1: Determine the decision (aka optimization)


variables
The decision variables in an optimization model represent the
decisions to be taken
One possible choice is: x = running distance
I x = 0 only swimming
I x = 100 running 100m and swimming 50m
I 0 < x < 100 running < 100m and swimming > 50m

10

Notes

Step 2: Write the objective function

The objective function quantifies the quality of the decisions


described by the decision variables
Our choice: overall traveling time
T = running time + swimming time
T is a function of the optimization variable x
p
(100 x)2 + 502
x
T (x) = +
5
2

11

Notes

Step 3: Write the constraints - Constraints


Main constraints specify the restrictions and interactions that limit
the values that decision variables can take
I 007 can run at most for 100m 0 x 100
Variable-type constraints specify the domain of the decision
variables
x R (real number)

12

Notes

007s Optimization Model


Putting this all together...
x
minimize T (x) = +
x
5
subject to 0 x 100,
xR

p
(100 x)2 + 502
2

(objective function)
(constraint)
(nature of the variable)

In words: compute among all the x between 0 and 100, the one that
minimizes T (x)
A bit of terminology:
I A feasible point: a choice of values for the optimization
variables (here x) that satisfies all the constraints (eg. 32.447)
I

The feasible set: the set of all feasible points (here [0, 100])

Optimal solution: a feasible point (x) at which the objective


function (T ) achieves its minimum (or maximum) value
13

Notes

007s Optimization Model


Computing the solution graphically

Matlab script:
x = [0 : 0.001 : 100];
x sqrt ((100 x).2 + 502)
+
;
5
2
plot(x, T );
T =

(val, pos) = min(T );


xmin = x(pos)

14

Notes

007s Optimization Model


Computing the solution graphically

15

Notes

007s Optimization Model


Remarks

We made some reasonable assumptions based on the common sense


For instance, we assumed that 007 moves toward the bomb and does
not zigzag or go toward x < 0
Also, we constrained x to [0, 100]
What about if we formulate the problem without that constraint?

16

Notes

007s Optimization Model

Alternative formulation
|x|
minimize T (x) =
+
x
5
subject to x R

p
(100 x)2 + 502
2

This is an example of unconstrained optimization problem


Tradeoff:
I no constraints (simpler than the previous formulation)
I Nondifferentiable objective function (more difficult to minimize)
Both formulations are valid

17

Notes

007s Optimization Model


Is the solution of the second formulation the same of the first one?

18

Notes

Example: The Anteater-Bugs Corporation


Adapted from MIT 15.053, Spring 2007

The Anteater-Bugs Corporation


has two main brands of beer:
Bugwheezer and Bug-Lite
Each of these products contains
two main ingredients: malt and
hops
Beer production also requires
some labor
Ann Anteater is in charge of
beer production for October

19

Notes

The Anteater-Bugs Corporation: Data (Input Parameters)

For October:
Ingredient / Beer
Malt (grams/bottle)
Hops (grams/bottle)
Labor (hours/bottle)
Profit ($/bottle)

Bugwheezer
10
20
3
1

Bug-Lite
3
12
3
2

Total available
1000
2000
1500

20

Notes

What goes into an optimization model?

Determine the decision variables

Write the objective function (and goal) in terms of the decision


variables

Write the constraints in terms of the decision variables


I

Main constraints

Variable-type constraints

21

Notes

Step 1: Determine the decision variables

Ann needs to determine the Anteater-Bugss October production


quantities of Bugwheezer and Bug-Lite
I
I

Let W = # bottles of Bugwheezer to produce in October


Let L = # bottles of Bug-Lite to produce in October

22

Notes

Step 2: Write the objective function


The Anteater-Bugs Corporation wants to maximize profits
Assume all bottles produced are sold
If W bottles of Bugwheezer and L bottles of Bug-Lite are produced,
what is the profit?
1W + 2L

Objective function (to be maximized)


f (W, L) = 1W + 2L

23

Notes

Step 3: Write the constraints - Main constraints


If W bottles of Bugwheezer and L bottles of Bug-Lite are produced,
how much malt is used?
10W + 3L

This quantity needs to be less than 1000. This constraint can be then
written as
10W + 3L 1000
Similar constraint for hops:
20W + 12L 2000
Also, similar constraint for labor:
3W + 3L 1500
24

Notes

Step 3: Write the constraints - Variable-type constraints


Variable-type constraints specify the domain of the decision
variables
Can we produce a negative number of beer bottles?
Can we produce a fractional number of beer bottles?
Nonnegativity:
W 0
L0

Integrality:
W integer
L integer
25

Notes

Anteater-Bugss Optimization Problem


Putting this all together...
maximize
subject to

1W + 2L

(total profit)

10W + 3L 1000

(malt capacity)

3W + 3L 1500

(labor capacity)

20W + 12L 2000

(hops capacity)

W 0

(nonnegativity)

W integer

(integrality)

L0

L integer
This is an instance of integer programming
Are the following pairs (W, L) feasible ?
I (W, L) = (50, 40), (W, L) = (0, 0), (50.2, 38.1), and (0, 400) .
26

Notes

Try to help Ann


1

After solving this model, Ann realized that she forgot to consider the
available machine time (m.t.)
I To produce a bottle of either beer requires one hour of m.t.
I There are 4000 hours of m.t. available
I How should Ann modify the optimization model?

After solving this model, Ann receives a memo from the marketing
department regarding projected demand for October:
I

the demand for Bugwheezer is 3000

the demand for Bug-Lite is 2000

Every unit produced above these quantities will be unsold and


not contribute to the profit

How should Ann modify the optimization model?

How should Ann modify the optimization model?


Give it a try
27

Notes

Summary
Building an optimization model:
1

Determine the decision variables

Write the objective function (and goal) in terms of the decision


variables

Write the constraints in terms of the decision variables


F

Main constraints

Variable-type constraints

Feasible solution, feasible set


Optimal solution, optimal value

28

Notes

29

Notes

Sprite Communications

Sprite Communications is planning to build a new cellular tower to


provide coverage to four cities: Bedrock, Quahog, Shelbyville, and
Springfield
This tower will have a 40-mile transmission radius, and so must be
within 40 miles of each city
Quality of service to each of the cities diminishes as the distance
between the city and the tower increases

30

Notes

Sprite Communications

Bedrock (5,45)

New tower (?,?)

Springfield (52,30)

Quahog (5,21)

Shelbyville (17,5)

31

Notes

Step 1: Determine the decision variables

Need to encode where exactly the new tower should be placed


Let x = the x-coordinate of the new tower
Let y = the y-coordinate of the new tower

32

Notes

Step 2: Write the objective function


We want to minimize the sum of the distances from the cities to the
new tower
The distance from Bedrock to the new tower is:
p
(x 5)2 + (y 45)2
Similar for Quahog, Shelbyville and Springfield
Objective (to minimize) :
p
p
(x 5)2 + (y 45)2 + (x 5)2 + (y 21)2
p
p
+ (x 17)2 + (y 5)2 + (x 52)2 + (y 30)2

33

Notes

Step 3: Write the constraints - Main constraints


The new tower must be within 40 miles of each city
Bedrock:
p

(x 5)2 + (y 45)2 40

(x 5)2 + (y 21)2 40

(x 17)2 + (y 5)2 40

Quahog:

Shelbyville:

Springfield:
p
(x 52)2 + (y 30)2 40
34

Notes

Step 3: Write the constraints - Variable-type constraints

Nonnegativity?
I

Nonnegativity is not an issue here since we are using x-y


coordinates

Integrality?
I

The tower location can take on non-integer values

35

Notes

Sprites optimization model

minimize

p
p
(x 5)2 + (y 45)2 + (x 5)2 + (y 21)2
p
p
+ (x 17)2 + (y 5)2 + (x 52)2 + (y 30)2
(total distance)

subject to
p
(x 5)2 + (y 45)2
p
(x 5)2 + (y 21)2
p
(x 17)2 + (y 5)2
p
(x 52)2 + (y 30)2

x, y R

40
40

40

40

(distance to Bedrock)
(distance to Quahog)
(distance to Shelbyville)
(distance to Springfield)

36

You might also like