Optimización - TEMA 1 - LP - Modeling
Optimización - TEMA 1 - LP - Modeling
e e rin
g in
En
Mathematical Modeling
t ems ón
S y s L e
Dr. Vincent A. L. Boyer in/ Dr. M. AngélicaueSalazar vo A.
ra m e N
r o gProgram a d (PISIS)
P
Graduate
m
in Systems Engineering
u a te Facultad u t ó o de Nuevo
de Ingenierı́anMecánica y Eléctrica
ra d Universidad Autónoma
dA
León
G
rs ida
ive
Un
g
e e rin
n
E ngi
1 Introduction to Linear Programming
t ems ón
Sy s L e
in o
2 Examples of Optimization Problems
m N uev
r o gra a de
P m
óno
3 Modeling
u a te ut
d A
Gra s i d ad
iv er
Un
Agenda
g
e e rin
n
E ngi
1 Introduction to Linear Programming
t ems ón
Sy s L e
in o
2 Examples of Optimization Problems
m N uev
r o gra a de
P m
óno
3 Modeling
u a te ut
d A
Gra s i d ad
iv er
Un
g
e e rin
gin
n decisions to be
Ethe
Decision variables: these are used to described
s
made tem ón
ys Le
in S of the decision
Objective function: it is a function
u e o
vvariables, it
Definitions
g
e e rin
in
A function f (x1 , x2 , ..., xn ) of x1 , x2 , ..., xn is a E ng function if and
linear
s
only if for some set of constants c1 , c2 , ...,
emcn ,
f (x1 , x2 , ..., xn ) = c1 x1 + c2 x2 + ...y+sctn xn .
n
S Leó
in
For example, f (x1 , x2 ) = 2x1 + x2 is a linear function
u evoof x1 and x2 , but
o g ram
f (x1 , x2 ) = x 2 1 x2 is not a linear function of xN
1 and x2 .
de
e Pr nom
a
at function f (x1 ,uxt2ó, ..., xn ) and any number b, the
For anyulinear
d
r a A
inequalities
G i d adxn ) ≤ b and f (x1 , x2 , ..., xn ) ≥ b are linear
f (x1 , x2 , ...,
inequalities. ers
iv
Un
Definitions
e r ing
A linear programming problem (LP) is an optimization i e for which
nproblem
g
we do the following: s En
1We attempt to maximize (or minimize)
y s teamlinear functionLeofónthe
in Sthat is to be maximized
decision variables. This function
u e vo or minimized
o g ram
is called objective function
d eN
The values of ther decision variables must
ma satisfy a set of constraints.
2
e Pmust be a linearnequation
o
d u at
Each constraint
u tó or linear inequality
3
G d a d A with each decision variable. For any
a restriction is associated
A rsign
i
s restriction specifies either that xi must be
variable xi , the sign
er
ivi ≥ 0) or that xi may be unrestricted in sign.
nonnegativen(x
U
Definitions
The fact that the objective function for an LP must be a linear function has
two implications:
e r ing
1 Proportionality assumption: The contribution to the
g i neobjective
En to the value of the
function for each decision variable is proportional
s
decision variable
y s tem L e ón
S
2 Additivity assumption: The contribution to the objective
o function
in of the values of uthe
for any variable in independent evother decision
variables. o g ram d eN
Analogously, theefactPrtha each LP constraint
n o ma must be a linear inequality or
a d uathas two implications:
linear equation A utó
r d
1 G
Proportionality
r ida
assumption:
s
The contribution of each variable to
the left-handiv e of each constraint is proportional to the value of
side
Un
the variable
2 Additivity assumption: The contribution of a variable to the
Definitions
g
e e rin
n
E ngi
1
e
The feasible region for an LP is the tset mif sall points satisfying
n all the
ys restrictions. o Leó
LP’s constraints and all the LP’sSsign
inan optimal solution uevto an LP is a point
2 For a maximization problem,m
a the largest objective N
o
in the feasible region
r grwith ad
e function value.
P m
no an optimal solution is a point in
u a tea minimizationuproblem,
Similarly, for
t ó
d region withdtheA smallest objective function value.
the feasible
Gra sid
a
iv er
Un
Types of solutions
g
e e rin
n
E ngi
t emsfor an LP. ón
Sythes feasible solutions
Feasible solution: it satisfies all constraints
Le
1
2
i
Optimal solution: it is the bestn of e v o for an LP,
m N u
r o gra function. a de
according to the objective
e P it does nottósatisfy
Infeasible solution:
nom
at least one constraint of the
3
LP. uat
r a d d Au
G a
rsid
n ive
U
Types of LPs
g
e e rin
n
E ngi
1 Some LPs have a unique optimal solution
t ems ón
Some LPs have an infinite number y s
S of optimal solutions L e
(alternative or
evo
2
Agenda
g
e e rin
n
E ngi
1 Introduction to Linear Programming
t ems ón
Sy s L e
in o
2 Examples of Optimization Problems
m N uev
r o gra a de
P m
óno
3 Modeling
u a te ut
d A
Gra s i d ad
iv er
Un
e r i ng
g i ne besites
The facility location problem consists of a set of potential facility where
a facility can be opened, and a set of customers that n must serviced.
The goal is to pick a subset of facilities tomopen, s E in order to minimize
s
the operative cost (transportation cost,ycost te of opening/building
L e óna facility,
S o
distance to customers, ...). in uev
m N
Decision: Facility o
r gra
Localization
ad
e
P m
u a e
Objective: tMinimize
u t ónocost
the operative
d
Constraints:
dA
GraAll customers smust
ida be served
ve
Locationiconstraint
r
n
U of the facility
Capacity
e r ing
e of customers
The fleet sizing problem consists of a set of vehicles and anset
i
g
that must be serviced. The goal is to pick a subset
s En of the vehicles (fleet
size), in order to minimize the operative costm
s t e (transportationecost,
ó n leasing
cost, customer satisfaction, ...).
n Sy v oL
i e
ra m
Decision: Number of vehicles
e Nu
Objective: Minimize
P rogthe operative cost
m ad
o
d u ate must be served
Constraints:
u tón
A
Gra
All customers
ad id routes
The set of possible
e rsthe
n iv
Shift length of Driver
U
Vehicle capacity
in a set of g
The shift scheduling problem consists of a set of employeeserand
e
n gin
activities to be fulfilled during a planning horizon (days/week/month). The
E
goal is to assign the activities to the employees,s in order to minimize the
y s tem over or under
operative cost (cost of contracting an employee,
L e n
ócovering an
activity, inactive employees, ...). n S vo
i ue
m N
gra of activities) of ean employee
Decision: Shift (Sequence
o d
Pr the operativenocost
Objective: Minimize
e ma
t utó
dua
Constraints:
A
GraAll the activities
sid
ad be covered
should
i v er have some breaks
Employees should
ShiftU n
length
Employee’s skill
Agenda
g
e e rin
n
E ngi
1 Introduction to Linear Programming
t ems ón
Sy s L e
in o
2 Examples of Optimization Problems
m N uev
r o gra a de
P m
óno
3 Modeling
u a te ut
d A
Gra s i d ad
iv er
Un
g
Objective
e e rin
n
ngi
Min c1 x1 + c2 x2 + ... + cn xn
E
Constraints t ems ón
Sy s L e
s.t. a11 x1 + a12 x2 + ... in+ a1n xn (≤, =, e
u ≥)vo b1
a21 x1 + a22 x2 m
r+a ... + a2n xn (≤, N
e =, ≥) b2
.. .. rog .
.. m ad ..
. .P o .
t e ó n
1 a+ am2 x2 + ...ut+ amn xn
am1 xu (≤, =, ≥) bm
G rad d ad
A
rs i
ive
Nature of the variables
n
xi ≥ 0, U
∀i ∈ {1, ..., n}
ing
Suppose that a carpenter makes tables and chairs and sells all the tables
and chairs he makes in a market. e r
He does not have a steady income and he wishes to optimize g i ne this situation.
So, the carpenter needs to determine how many stables En and chairs he should
m knows that theónincome he
teHe
make in order to maximize his net income. s
Schair sold is $300.vo Le
y
receives per table sold is $500 andnper
The carpenter works 8 hoursaam
i
day from Monday toN ue and takes 2 hours
Friday
gr to make a chair.
to make a table and 1rohour
e
a dAlso, each week he receives
e P
50 units of rawtmaterial, of which ó o m
henrequires 1 unit for each table and 2
u a
d chair he makes. A
units foraeach u t
Gr sid
ad
i ver
How canUnwe fomulate this problem?
g
e e rin
Decision n
Number of tables and chairs to be produced Engi
t ems ón
Objective Sy s L e
in o
uev
ram
Maximize the net income
o g d eN
Constraints e Pr n o ma
t
uaworking utónot exceed the available hours for
r a d
The total time should
d A
Gworking
rs ida
ive of raw material must be used to produce the tables
At most 50nunits
U
and chairs.
g
e e rin
n
E ngi
The optimization model t ems ón
Sy s L e
Max 500tin + 300c = z evo
s.t.ram2t + c
u
≤ N40
e
Prog t + m
d
2c a ≤ 50
o
ate
tócn≥ 0
t ≥ 0,
d u A u
Gra dad rsi
n ive
U
Dorian’s problem
Dorian’s problem
g
e e rin
n
Decision
E ngi
msfootball game to purchase.
Number of 1-minute ads on comedy shows and
e n
S
oyst
L eó
Objective in
uev
m N
r o gra of dollars).a de
Minimize the cost (in thousands
a t eP t ó n om
Constraints u
r a d d Au
G a
At least 28 million ihigh-income women must see the ads.
e r sd
iv high-income men must see the ads.
At least 24 nmillion
U
Dorian’s problem
g
Decision variables
e e rin
x1 : number of 1-minute comedy ads to purchase.
gin
n
sE
x2 : number of 1-minute football ads to purchase.
em n
Objective S
oyst
L eó
in
uev
Min z = 50x1 + 100x2 a
r m
(in N
thousands of dollars)
e
P rog m ad
Constraints ate
u u t óno
d 28 million high-income
A women must see the ads:
Gra7x1 + 2x2 ≥ 28sidad
At least
r
At least 24 n ive high-income men must see the ads:
million
U
2x1 + 12x2 ≥ 24
Nature of the variables: x1 ≥ 0, x2 ≥ 0
g
e e rin
n
E ngi
The optimization model t ems ón
S y s L e
Min 50x1in+ 100x2 evo
m
s.t. ra7x1 + 2x2 N u
g 2x + 12xa de≥ 28
Pr o 1 m2 ≥ 24
e o
n
uat
utó 2
x1 ≥ 0, x ≥0
a d A
Gr ad
rsid
n ive
U