0% found this document useful (0 votes)
22 views

Introduction To Linear Programming

The document provides an introduction to linear programming, including an overview of linear programs and common resolution methods. It discusses modeling linear programs, including examples for scheduling, logistics, and transportation problems. Integer linear programming and solution methods like the simplex algorithm are also covered.

Uploaded by

Gibbs Ambion
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Introduction To Linear Programming

The document provides an introduction to linear programming, including an overview of linear programs and common resolution methods. It discusses modeling linear programs, including examples for scheduling, logistics, and transportation problems. Integer linear programming and solution methods like the simplex algorithm are also covered.

Uploaded by

Gibbs Ambion
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

31/03/2012

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.

Un program is convex if the optimization function is convex and the domain


defined by the constraints is also convex : then, any local optimum is
also a global optimum and it is achieved at some extreme point of the
domain.
A real‐valued function f(x) defined on an interval is called convex if the
graph of the function lies below the line segment joining any two points
of the graph.

A linear program is a convex 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

n activities, m resources… s.c. A11 x1  A12 x 2 ...  A1n x n  b1 ;


A21 x1  A22 x 2 ...  A2 n x n  b2 ;
...
Am1 x1  Am 2 x 2 ...  Amn x n  bm ;
x1, x2, ..., xn ,  0.

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.

• How to solve linear programming :


– The simplex algorithm (1951, 1963), developed by George Dantzig, solves LP
problems by constructing an admissible solution at a vertex of the polyhedron
and then walking along edges of the polyhedron to vertices with successively
higher values of the objective function until the optimum is reached. (CPLEX,
EXPRESS‐MP, etc.).

– 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)

Simplex algorithm : basics

The domain formed by linear constraints gives a polyhedron


polyhedron, and the
search for optimal solutions can be restricted to extreme points.

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

Simplex algorithm : duality


Primal : Dual :
Max c1x1 + c2x2 i b1y1 + b2y2
Min
s.t.:
s.t.:
A11x1 + A12x2  b1;
A11y1 + A21y2  c1;
A21x1 + A22x2 = b2;
A12y1 + A22x2 = c2;
x1  0 and x2 unsigned;
y1  0; y2 unsigned;

Transformation rules :
Take the transposed matrix A,
the right hand terms become coefficients of the objective function… etc.

Simplex algorithm: duality


Proposition. If x is feasible for the primal (maximum) problem and if y is
feasible for its dual
dual, then cTx ≤ yTb.
yTb
Proof. cTx ≤ yTAx ≤ yTb. The first inequality follows from x ≥ 0 and cT≤ yT.
The second inequality follows from y ≥ 0 and Ax ≤ b.

Economic interpretation:
‐ Estimate the cost/price of resources…
‐ Estimate the profit increasing when changing the right hand terms;

Sensibility analysis

5
31/03/2012

A simple example (I)


Example. Determine the quantities to be produced such that all the production
constraints are satisfied and the benefit is maximized. We suppose that two
products A and B can be produced, each of them passing through cutting
and packing stages, respectively (C) and (P) :

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

The unitary benefits for A et B are respectively 20 € and 10 €.

A simple example (II)


Primal PL : Dual :
Max 20A + 10B Min 200a + 100b
Subject to : Subject to :
2A + 2B  200; 2a + 3b  20;
3A + B  100; 2a + b  10;
A  0 et B  0; a  0 et b  0;

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

Linear program modeling


General cases :

lower and upper bounds;

render inequalities to equalities;

express unsigned variables as nonnegative ones;

Linear program modeling


Expressing the objective function:
– maxmin or minmax functions;
• Let be given variables x 1, x2, …, xn. The objective function consists
in maximizing the minimum of them.
– Intro duce a new variable y which is a lower bound of xj;
– The objective function becomes: Max y;

– “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

Linear program modeling


• Expressing constraints :
– Capacity constraints
• Usually they give rise to upper bound constraints;
– Demand constraints
• Usually they give rise to lower bound constraints;

– Mass balance constraints

– 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

Integer Linear Programming

Introduction to integer linear


programming
• Integer Linear Programming (ILP)
– An integer linear program is a linear programming problem
with variables taking values in Z.
– Binary or 0‐1 linear programming problems are a special
case.

• How to solve integer linear programming :


– Cutting planes, Branch and bound methods, branch and
cut…

9
31/03/2012

Modeling by binary variables

Linear programming modeling


Modeling constraints in scheduling problems:
disjunctive
j constraints :
task A before task B or task B before task A;
conjunctive constraints;
task A before task B; or task A before B and C…

Expressing disjunctive constraints:

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}

– Objective function: minimize the completion time (makespan), total


lateness, number of delayed tasks, etc.

21

The one machine scheduling


problem
We consider the n‐job one‐machine scheduling problem with ready time ri,
processing time pi, and due time di for each job i. Preemption is not
allowed, and precedence constraints among jobs are not considered.
• Decision variables:
– xij (boolean variables): task i executed at the j‐th order ;
– tj (>= 0) start time for task placed at order j ;
• LP formulation
f j : Min tn + i xin*pi
f.obj. p ;
s.t. for all i : j xij=1 ;
for all j :i xij=1 ;
for all j : tj >= i xij*ri ;
for all j : tj+1 >= tj + i xij*pi ;
for all j : tj + i xij*pi <= i xij*di ;

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.

january february march april may june july

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) ;

Mass conservation constraints :


For i from 1 to 6 : si-1 + xi + yi = Di + si ;
Capacity constraint:
xi <= 30000 ;
Positivity and integrality constraints:
xi, yi, si >= 0 ; xi, yi, si are integers

Objective function:
Min (i xi*250 + i yi*300 + i si*25).

12
31/03/2012

Modeling optimization problems in


logistics and transportation

Modeling optimization problems in


logistics and transportation
Related problems:
• Partitioning, generalized matching, covering, facility
location problems;
• Lp models for transportation problems:
– Transportation programs,
– Minimal cost flows and multiflows, vehicle routing problems,
etc.
etc

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 and p‐median problems


Data:
- A set of demands/clients to satisfy
- A set of n sites,
sites such that only p are allowed to open
- Distance dij between demands/clients and sites;

“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,

x i  0 ,1 i xi -> site i;


yi,j -> demand j covered by i
y i , j  0 ,1  i ,  j ,
z  0;

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

yi,j -> demand j covered by i


x i  0 ,1 i
y i , j  0 ,1  i ,  j ,

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.

Example. Cars to rent


A company specialized in car’s rent has two garages with respectively 12 et 8 cars in
stock, and three rent shops demanding for respectively 8, 7 and 5 cars. The
unitary costs of transport are given in the following table. What would be the
transport plan of minimal cost ?

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+;

xij : decision variables : number of cars to be sent from i to j.

Exercise : Give the general LP model for the transportation program :


There are a1, a2, ... , am units in the warehouses 1,2 ,..., m. We want
to transport these units to the destinations 1,2 ,..., n where the
requests b1, b2 ,..., bn occur, with Σai = Σbj.

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.

Path problems LP formulations


LP model for the shortest path problem

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

The art gallery problem


• The art gallery or museum problem originates from a real‐
world problem of guarding an art gallery with the minimum
number of guards which together can observe the whole
gallery.

• Propose an ILP model.

Exercise
Employment planning for a restaurant

• The manager of a restaurant needs to ensure permanence


and service in his restaurant on the basis of some
statistics (say for day i (1≤i≤7), are needed ai employees):

• He needs to find the minimal number of employees when any


of them should work 5 consecutive days and next takes two
days of break. Give an LP model for this problem.

19
31/03/2012

END

20

You might also like