CH 1-LP
CH 1-LP
Introduction
8/4/2024 1
Introduction
i) Introduction to Optimization
8/4/2024 2
Introduction
i) Introduction to Optimization
Linear Programming is a basic course within the subject
area called Mathematical Programming / Operations
Research / Optimization.
Commonly, we use Optimization for the subject area.
What does optimization mean?
Literally: Among various possibilities, it is to find the
best possible solution of a problem under a set of
constraints.
In Mathematics: To optimize means –
to maximize or minimize a function f(x), where the
values of x have to satisfy a set of prescribed
mathematical relations.
8/4/2024 3
Thus, given a real valued function f of several variable, i.e.,
f : R n R and a set S Rn
a problem of optimization is either of the following types:
● ●
f(x)
min f(x)
xS
x * = x2
x0 x1 S x2
●
x * = x2
f(x*) f(x)
max f(x)
xS
x * = x1 ●
x0 x1 S x2
x* = x1
8/4/2024 5
Examples: Formulate each of the following problems as
an optimization problem (identify its f and set S)
(Max Volume) Find the length, width and height of a box so
that its surface area is 200 m2, base area is at least 30 m2,
and volume is maximum.
Let x1 = length, x2= width & x3 = height of the box
Restrictions:
Surface area: x3
Base area:
Aim:
x2
Volume: Max x1
The Problem is
max x1 x2 x3
s.t 2x1 x2 +2x1 x3 + 2x2 x3 200
x1 x2 30
x1 , x2 ,x 3 0
8/4/2024 6
ii) Basic Definitions and Terminologies
8/4/2024 7
Example (Production Planning): Suppose that two machines
M1 and M2 are used to produce two containers A and B . In
the production of a unit of the containers, A needs M1 for
2 minutes and M2 for 4 minutes. Similarly, B occupies M1
for 8 minutes and M2 for 4 minutes. The machines can be
used for at most 1 hour per day. The net profit for a
container A is 29 and for B is 45. The problem is to find the
number of daily production of each container that
maximizes the net profit per day.
8/4/2024 9
Min problem is equivalent to max problem: i.e.,
x ٭is optimal solution of min f(x) on S
if and only if
x ٭is optimal solution of max - f(x) on S.
8/4/2024 10
If the feasible set S = , then the problem is called infeasible.
Example: Let (P) be max 2 x1 x2
s.t x1 x2 1
x1 x2 1
x1 , x2 0
There is no value for x1 & x2 that satisfy the constraints. i.e.,
S = ( x1 , x2 ) R 2 | x1 x2 1, x1 x2 1, x1 , x2 0
The problem is called infeasible.
The optimization problem is said to be unbounded, if
• f(x) tends to on S for the maximization problem
• f(x) tends to – on S for the minimization problem
8/4/2024 11
Linear Programming (LP):
An optimization problem
max (or min) f(x) s.t xS,
is said to be a linear program (LP) if the objective
function f(x) and the functions involving in the
description of S are all linear functions.
That is, if all involved functions (the objective and the
constraints) are linear, then the problem is called a Linear
Programming (LP) or a Linear Optimization
8/4/2024 12
A common form of an LP Problem:
max c1 x1 c2 x2 ... cn xn
s.t. a11 x1 a12 x2 ... a1n xn b1
a21 x1 a22 x2 ... a2 n xn b2
Constraints
Iron 25 30 15 50 165 g
Copper 30 40 50 15 270 g
Zink 55 20 35 35 275 g
Profit /unit 30 20 25 15
8/4/2024 14
• Decision variables: xi = units of Ai to be produced,
i = 1, …, 4
• Constraints:
Iron: 25x1 30 x2 +15x3 +50x4 165
Copper: 30x1 40 x2 +50x3 +15x4 270
Zinc: 55x1 20 x2 +35x3 +35x4 270
Non-negativity: x1 ,..., x4 0
8/4/2024 16
Formulation:
Fruit Daily
Vitamins mango Orange Apple Requirement
s of Vitamins
A 0.5 0 0.5 5
B 1 2 3 20
C 1 3 1 15
Cost/unit 0.75 0.50 1.25
8/4/2024 17
• Constraints: Daily requirement of Vitamins:
A: 0.5x1 + 0.5x3 5
B: x1 2 x2 +3x3 20
C: x1 3x2 + x3 15
Non-negativity: x1 , x2 , x3 0
• Objective function: 0.75x1 0.50 x2 +1.25x3 Min
Thus the LP formulation of the problem is :
8/4/2024 20
A) Slack Variables:
The “ ” constraint, say
ai1 x1 ai 2 x2 + +ain xn bi ,
can be transformed into equality by introducing a
variable s, called slack variable, where
s bi (ai1 x1 ai 2 x2 + +ain xn )
Observe that, s 0.
Hence, the given inequality is equivalent to
ai1 x1 ai 2 x2 + +ain xn s bi , s 0.
For instance, x1 2 x2 +3x3 10
is equivalent to x1 2 x2 +3x3 x4 10,
x4 0.
( x4 is slack variable)
8/4/2024 21
B) Surplus Variables:
The “ ” constraint, say
ai1 x1 ai 2 x2 + +ain xn bi ,
can be transformed into equality by introducing a
variable s, called surplus variable, where
s ai1 x1 ai 2 x2 + +ain xn bi
Observe that, s 0.
Hence, the given inequality is equivalent to
ai1 x1 ai 2 x2 + +ain xn s bi , s 0.
For instance, x1 2 x2 +3x3 10
is equivalent to x1 2 x2 +3x3 x4 10,
x4 0.
( x4 is slack variable)
8/4/2024 22
3. If a decision variable, say, xj is unrestricted in sign we
can replace it by the difference of two nonnegative
variables
x j : x1 j x2 j , x1 j , x2 j 0
in order to change the problem into standard
Thus, any LP problem can be written in the standard form.
8/4/2024 23
Exercise: Write the following LP in the standard form.
min 3x1 5 x2 x3
s.t 2 x1 3x2 x3 5
4x1 3x2 +5x3 15
x1 x2 + x3 4
x1 , x2 0, x3 R
8/4/2024 24
Graphical Solution Methods for LP
In this section we consider the case when an LP problem
involves only two decision variables. Thus, we consider
S
a x a x ( or )b
m1 1 m2 2 m
x 1 , x2 0
8/4/2024 25
• The graphical solution method uses level lines of f
• Level line (contour) of f is a set of all points where f has
equal (a constant) value.
That is, a level line of f is a line given by
c1x1 + c2x2 = z , where z is a constant.
• Recall from calculus that the gradient , f = (c1, c2)T , is
orthogonal (perpendicular) to the level line of f.
Recall:
f points toward the direction of maximum rate of
increase of f ; and
–f towards minimum rate of decrease of f .
8/4/2024 26
Thus, to solve LP, take any point (x1, x2)S,
- determine a level line l of f through this point,
- and use the fact that
f increases if we move from (x1, x2) to any other point in
S in the direction of f (for maximization).
l
• f = z3 , z3 z2
l
f
f = z1 l
f
S f = z2 , z2 z1
(x1,•x2)
8/4/2024 28
Example: we consider maximizing/minimizing
f (x1, x2) = c1x1 + c2x2 on S, where S is given by the
following system of inequalities.
2 x1 x 2 3
x1 2 x 2 9
x2 6
3 x x 21 3x1 +x2 =21
1 2 x2
3 x1 x 2 15
x1 , x 2 0. 7
x2=6 (3,6) (5,6)
6
First draw the feasible (1,5)
5
set S as shown here:
4
3 S: feasible set (6,3)
S is a polyhedral Set
2
of all points satisfying
1
all linear constraints
x1
1 2 3 4 5 6
8/4/2024 29
• Now let, f(x1,x2) = x1 + x2 and maximize f on S
Level line x1 + x2 = z , z a constant.
Optimal
z=11
z=9 x* =(5,6)
z* =11
z=6 7
(3,6) (5,6)
6
(1,5)
z=3 5
z=1 4
3 S (6,3)
z=f(X0)=1 2
X0=(0,1) 1
1 2 3 4 5 6
Increasing
direction:
f=(1,1)
x + x2=1
Berhanu G (Dr) 1 30
8/4/2024
Next let f(x1,x2) = –5x1 + x2 and minimize f on S.
• level line: –5x1 + x2 = z, and f = ( –5, 1).
Optimal
x2 X*=(6,3)
z=1 z=-9 z= -19 z*= – 27
7
(3,6) (5,6)
6
(1,5) z=-27
5
4
S
3 (6,3)
2
1
-1 1 2 3 4 5 6 x1
decreasing
-5x1 + x2=1 direction: –f = ( 5, –1).
8/4/2024 31
Note:
• For the above examples, optimal solutions occurred at the
boundary of the polyhedral feasible sets , particularly at a
vertex.
• This is always the case for LP since f is a nonzero
constant vector and f keeps increasing in the direction of
f (or keeps decreasing in the direction of –f ) unless the
progress is stopped by the boundary of the feasible set.
• In fact, the farthest (outermost) boundary point of a
polyhedral in a direction of improvement is a vertex (corner
point) of the polyhedral.
• Hence, both maximum and minimum of a linear objective
function (if exist) occur at a vertex (corner point) of the
feasible polyhedral
• If the polyhedral set is unbounded in the direction of
improvement, then the LP is unbounded.
8/4/2024 32
Example: Consider max x1 x2
s.t 2 x1 x2 3
x1 2 x2 3
x1 , x2 0.
• 1st Draw the feasible set S.
• The zigzag at a side of the
polyhedral S indicates the
polyhedral is unbounded in
that side.
• The objective function of
this problem keeps S
increasing in S with no 4
bound. 3
• Hence, this LP is 2
unbounded. 1
X0=(0,1)
1 2 3 4
Increasing
direction: x1 + x2=1
f=(1,1)
8/4/2024 33
Basic Solutions`
8/4/2024 34
The m linearly independent columns of A forms an mxm
invertible sub-matrix, called basic submatrix and denoted by B.
The remaining non-basic columns form an mx(n–m) submatrix
denoted by N.
xB , x N
T
Also, partition x asx
8/4/2024 35
Hence, x is a solution of Ax = b
x = (xB , xN)T is a solution of BxB +NxN = b
xB B 1 NxN B 1b
xB B 1b B 1 NxN
The last equation is called the basic representation w.r.t B.
Hence, for any choice of values of xN , the values of xB is
uniquely determined so that
x = ( xB , xN )T is a solution of Ax = b.
n n!
n
Cm
m m !(n m)!
3. Hence, the number of basic solutions of the system is
at most equal to nCm ( So, it is finite).
8/4/2024 37
Example 1: Find all basic solutions (BS) of
8 x1 4 x2 6 x3 16 x4 12
3x1 5 x2 4 x3 6 x4 8
(and also identify basic feasible solutions (BFS) )
Solution: The coefficient matrix is A = (A1, A2, A3, A4), where
4 2 3 8 6
A1 , A2 , A3 , A4 , & b
3 5 4 6 8
A has 6 sub-matrices of order 2:
B1 A1 , A2 , B2 A1 , A3 , B3 A1 , A4 ,
B4 A2 , A3 , B5 A2 , A4 , B6 A3 , A4
and det( B1 ) 14, det( B2 ) 7, det( B3 ) 0
det( B4 ) 7, det( B5 ) 28, det( B6 ) 14
5 basic sub-matrices: B1, B2, B4, B5, B6
8/4/2024 38
So, there can be 5 basic solutions w.r.t each of the basic
sub-matrices. In Particular,
1
• W.r.t 1 1 2 xB B b x1 1, x2 1
B A , A , 1
1
1 1
2
2
0 x2 1 x2 2 x3
xB4 = , xB5 = , xB6 =
2 x3 1/ 2 x4 0 x4
Hence, the BS, w.r.t B4, & B6 are also BFS. They give
the same BS: ( x1 , x2 , x3 , x4 ) (0, 0, 2, 0)
However , the BS w.r.t B5, ( x1 , x2 , x3 , x4 ) (0,1,0, 1/ 2)
is not BFS since x4 < 0 .
8/4/2024 39