Introduction To Linear Programming
Introduction To Linear Programming
Introduction to linear
programming
Linear programming
• Overview
– Mathematical and linear programs
p g
– Linear programming and resolution methods;
– Modeling in (integer) linear programming;
• Scheduling problems;
• Optimization problems in logistics and transportation
• Examples, exercises.
– Integer linear programming: arborescent methods,
methods
examples, exercises.
1
31/03/2012
A linear program
• A mathematical program is an optimization problem with an objective
(or optimization) function of n‐variables satisfying m constraints. If at
least one constraint or the objective function are not linear, it is called a
non‐linear program, otherwise it is a linear program.
A linear program
• There can be distinguished:
– Decision variables
– Objective (or optimization) function
– Constraints;
– Domain of variables;
2
31/03/2012
A linear program
General case
Suppose that a linear program is composed of :
‐ The objective function of n variables xj (maximization) ;
‐ All variables take positive values.
‐ The constraints are linear functions bounded by some constant
n
Max z c j x j
That is :
Interpretation : j 1
Geometrical interpretation
max: Z = 2x1 + x2
Subject to: x1+2x2 7
x1+x2 5
x1 1
x1 4
xi 0
3
31/03/2012
Introduction to linear
programming
Linear programming (LP) is a technique for optimization of a linear
objective function of variables x1, x2, …xn, subject to linear equality and
linear inequality constraints.
– Alternative methods :
• the ellipsoid method by Leonid Khachiyan in 1979
• In 1984, N. Karmarkar proposed a new interior point projective method
for linear programming. (Karmarkar's algorithm)
The simplex method explores extreme points and improves the value of
optimization function in each step.
Advantages :
Efficiency
Effi i (
(not polynomial
l i l but
b polynomial‐time
l i l i in
i average).
)
Nice theoretical properties (duality).
4
31/03/2012
Transformation rules :
Take the transposed matrix A,
the right hand terms become coefficients of the objective function… etc.
Economic interpretation:
‐ Estimate the cost/price of resources…
‐ Estimate the profit increasing when changing the right hand terms;
Sensibility analysis
5
31/03/2012
Cutting Packing
Necessary time to produce 1 unity of A 2 hours 3 hours
Necessary time to produce 1 unity of B 2 hours 1 hours
Availability in working hours 200 hours 100 hours
Economic interpretation :
a will give the cost/price of one hour for the cutting process and b
the price for the packing one.
6
31/03/2012
– “multiplicative”
multiplicative functions
• Min 1/x => Max x;
• y=ax, where x binary variable and a [0, .., M].
– y <= a; y <= Mx; y >= a + (x‐1)M.
– how to do when both binary variables ?
7
31/03/2012
– Proportion constraints
• a, b and c give all, and a is exactly 30%: a = 0,3 (a+b+c)
LP modeling techniques
N x j
j j
Min
D x j
j j
s.t. A x
j
ij j Ri i
1
Set : d ; y j d x j;
j
D jxj
Ob . Function
Obj Min N j
j yj
s .t . Dj
j y j 1;
Aj
j y j dR i ;
8
31/03/2012
9
31/03/2012
10
31/03/2012
Scheduling problems
Problem formalization:
Data: tasks (ready time, processing time, due time), number of machines,
precedence
d constraints,
t i t preemption,
ti etc
t …
Problem modeling
– data: ri (ready time), pi (processing time), di (due time);
– Decision variables : ti (start date of execution), xij (execution order
between i and j), ci (completion execution time).
– Precedence/conjunctive constraints: task i before task j : ti + pi <= tj:
– Disjunctive constraints: ti + pi <= tj or tj + pj <= ti :
ti + pi <= tj + M(1‐b) ; tj + pj <= ti + Mb ; b {0,1}
21
11
31/03/2012
2
3
Examples in LP modeling
Problem. Computer production planning
The company ORDI produces laptops. Selling previsions (in thousands of unities)
for the next six months are reported in the following table. The production
capacity
it off the
th company isi 30000 per month.th It is
i possible
ibl to
t produce
d more att
higher cost, 300 Euros per piece instead of 250.
30 15 15 25 33 40 45
Selling previsions for the next six months
There are 2000 laptops in stock. The storing cost is of 25 Euros per unity for
what is in stock at the end of the month. We suppose that the stocking capacities
are unlimited. We begin at the 1st January. What is the production plan for the
next six months such that all demands are satisfied and the cost is minimized.
2
4
LP model
Decision variables :
xi : quantity produced with nominal tariff during month i ;
yi : quantity produced with secondary tariff during month i ;
si : stock of month i, and s0 initial stock (=2000) ;
Objective function:
Min (i xi*250 + i yi*300 + i si*25).
12
31/03/2012
13
31/03/2012
Partitioning, covering
• Partitioning problems ask whether is possible to split a given set in subsets
satisfying some criteria.
– (bi)partition problem : the problem is to decide whether a given a set of
integers can be partitioned into two "halves" that have the same sum.
• Covering problems ask whether a certain combinatorial structure 'covers'
another, or how large the structure has to be to do that.
– A cover of a set X is a collection of sets such that X is a subset of the union of
sets in the collection. An exact cover is a subcollection such that each element
in X is contained in exactly one subset in it.
– The vertex cover problem : a vertex cover of a graph is a set of vertices such
that each edge of the graph is incident to at least one vertex of the set.
• Propose an ILP model for the vertex cover problem.
Covering problems
total cover
‐ Data:
n candidate sites (indexed by i)
m demands (indexed by j)
Dc maximum cover (reaching) distance.
constants (0,1) noted as aij indicating if j can be covered by i.
ci installation cost of i.
dij distances between any i and j.
Goal: compute which sites will be open such that all clients are covered at
minimal installation cost of sites.
PL01 Formulation:
Min c x
i
i i
a x 1
i, j i j
x i 0 ,1 i .
i
14
31/03/2012
maximal cover
‐ It occurs when one wants to maximize the area/demand covered
when the number of allowed sites is bounded.
additional coefficients and variables:
p maximum number of sites allowed to be installed;
dj demand j (known data)
zj binary variable indicating if some j is covered.
PL01 formulation:
Max d z j
j j
z a x
j i, j i j
i
x p
i
i
x i 0 ,1 i
z j 0 ,1 j .
“p-center” problems
Goal:
– Where placing sites in order to minimize the maximal distance;
– Example : placing firestations, etc.
“p-median” problems
Goal:
– Minimize the average distance
– Example : distribution centers...
15
31/03/2012
p‐center problem
LP model:
Min z
y
i
i, j 1; j
x p;
i
i
yi, j xi , i,j
d
i
y z,
i, j i, j j,
p‐median problem
LP model:
Mi
Min q d
j
j
i
y
i, j i, j
y
i
i, j 1; j
x p;
i qj -> quantity of demand j;
yi, j xi , i,j xi -> site i;
i
16
31/03/2012
A transportation program
The transportation problem deals with sources where a supply of some commodity
is available, and destinations where the commodity is demanded.
g
Garages Shops 1 2 3 Supply
1 3 5 3 12
2 2 7 1 8
Demand 8 7 5
33
LP model
Minimize 3x1,1 + 5x1,2 +3x1,3 + 2x2,1 +7x2,2 + x2,3
Subject to:
x1,1 + x2,1 ≥ 8;
x1,2
1 2 + x2,2
2 2 ≥ 77;
x1,3 + x2,3 ≥ 5;
x1,1 + x1,2 + x1,3 ≤ 12;
x2,1 + x2,2 + x2,3 ≤ 8;
xi,j Z+;
34
17
31/03/2012
Transportation program
transport unitary cost matrix supply
demand
Min c
i, j
x
i, j i, j
x j
i, j ai i 1, ... , m
x i
i, j bj j 1, ... , n
xi , j 0 i, j.
Min w i
x
i , j i, j
(! ) x
j succ i
i, j x ;
j prec i
j ,i i, j X , i, j s , t.
(!! ) x
j succ s
s, j x
j prec t
j ,t 1;
xi , j 0,1 i , j. Min w x i, j i, j
x x
i
(!) i, j j ,i ; i , j X .
The directed cycle with minimum j succ i j prec i
weight/length is called the minimum
cycle mean.
(!! ) x
all ( i , j )
i, j 1;
The LP formulation :
xi , j 0,1 i , j.
18
31/03/2012
Exercise
Employment planning for a restaurant
19
31/03/2012
END
20