Vous êtes sur la page 1sur 56

Lecture

on
Linear Programming

By

Dr. D. B. Naik (Ph.D. - Mech. Engg.),
Professor & Head,
Training & Placement Section,
Sardar Vallabhbhai National Institute
of Technology, Surat, Gujarat, India
Linear Programming
(An Optimization Technique)
General Optimization Problem Involves :
1. Decision Variables
2. Objective Criterion (Max/Min)
3. Constraints: (i) Equality (ii) Inequality

Linear Programming(LP) :
It is one of the important Optimization
Techniques.
Most Versatile, powerful & useful technique.
Developed in 1947 by George B. Dantzig during
World War II to solve military problems, while
working with US Air Force.
(1) x c Min.)Z or (Max. Optimize
n
1 j
j j
=
=
The word Linear in LP indicates -
relationship among variables both in objective
function and constraints.
while Programming means - Systematic
Mathematical technique.
General Linear Programming Problem (LPP)
with n variables and m constraints can be stated
as follows:
) 2 ( ... 2 , 1 ; ) , , (
1
m i b x a
i
n
j
j ij
= > = s

=
) 3 ( ... 2 , 1 ; 0 n j x
j
= >
Types of Variables
Decision Variables : x
j
are decision variables
Slack Variables
m i b w x a
i
n
j
i j ij
... 2 , 1 ;
1
= = +

=
b x a
n
j
i j ij
1
s

=
w
i
are slack variables.
Artificial Variables :
Required for solution methodology
Surplus Variables
b x a
n
j
i j ij
1
>

=
m i b s x a
i
n
j
i j ij
... 2 , 1 ;
1
= =

=
s
i
are surplus variables
Components of LPP :

The three important components of LPP
are as follows:

(a) Decision Variables
(b) Objective Function - Max. or Min.
(c) Constraints-limitations.
1. Certainty:c
j
, a
ij
, b
i
are known & constants.
2. Divisibility: Values of decision variable
can be integer or fractional.
3. Additivity: Total contribution = Sum of
contribution of all variables
4. Linearity: Relationship among variables both
in objective function & constraints.
Assumptions of LP

Formulation of LPP :
Steps to be followed.
1. To decide (define) decision variables.
2. To formulate objective function.
3. To formulate constraints.
CASE - 1 Data for LP Formulation.
Factory: Two products P1 & P2
Profit/piece of P1 = Rs.3/-
Profit/piece of P2 = Rs.5/-
Time Constraint:
Time required/piece of P1 = 3 hrs.
Time required/piece of P2 = 2 hrs.
Max. time available = 18 hrs.
Material Constraint:
Max. Material available for P1 = 4 pieces.
Max. Material available for P2 = 6 pieces.
CASE - 1 Formulation of LPP :
Let decision variable x1 = no of pieces of P1
x2 = no of pieces of P2
Max. Z = 3x1 + 5x2 Objective Equation
Constraint Time I x x ) ( 18 2 2 1 3 s +
Constraint Material II x ) ( 4 1 s
Conditions negativity Non x x > 0 2 , 1
Constraint Material III x ) ( 6 2 s
CASE - 2
If Time Constraint is modified to:
Time available is not less than 18 hours.
Max. Z = 3x1 + 5x2 Objective Equation
Constraint Time I x x ) ( 18 2 2 1 3 > +
Constraint Material II x ) ( 4 1 s
Conditions negativity Non x x > 0 2 , 1
Constraint Material III x ) ( 6 2 s
CASE - 3
If Time Constraint is modified to:
Time available is exactly 18 hours.
Max. Z = 3x1 + 5x2 Objective Equation
Constraint Time I x x ) ( 18 2 2 1 3 = +
Constraint Material II x ) ( 4 1 s
Conditions negativity Non x x > 0 2 , 1
Constraint Material III x ) ( 6 2 s
1. Feasible Solution: Solution with values of
decision variables(x
j
) which satisfy all
Constrints & Non-negativity condition.
2. Basic Solution: For a set of m equations
in n variables (n>m), basic solution is a
solution obtained by setting (n-m)
variables equal to zero and solving for
remaining m equations in m variables.
Types of Solution
No. of possible Basic solutions = nCm
= n!/(m!.(n-m)!)
(i) Basic Variables : Having values > 0.
(ii) Non-basic Variables :Having values = 0.
3. Basic Feasible Solution : It is a Basic
Solution which satisfies (3).
4. Non-degenerate/degenerate B.F.S
5. Optimal Basic Feasible Solution : It is a
Basic Feasible Solution which optimizes
objective function.
6. Unbounded Solution :
7. Infeasible Solution :
8. Unique/Alternative Optimal Solutions :
Methods to solve LPP :
1. Graphical Method - for only two variables.
2. Simplex Method - Universal method.
3. Assignment Method - Special method.
4. Transportation Method - Special method.

Note : Methods (2), (3) and (4) are iterative
methods.
(1) Graphical Method
( for only two variables)
3
6
9
2 4
6 x1
F.R.
Opt. Pt. (2,6)
Z=0.
Z=15.
Z
opt
= 36.
III
I
II
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
s +
+ =
x x
III x
II x
I x x t s
x x Z Max
Graphical Method
Case 1.
3
6
9
2 4
6 x1
F.R.
Opt. Pt.
(4,6)
Z=15.
Z
opt
= 42
III
I
II
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
> +
+ =
x x
III x
II x
I x x t s
x x Z Max
Graphical Method
Case 2.
3
6
9
2 4
6 x1
F.L.
Opt. Pt.
(2,6)
Z=15.
Z
opt
= 36
III
I
II
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
= +
+ =
x x
III x
II x
I x x t s
x x Z Max
Graphical Method
Case 3.
3
6
9
2 4
6 x1
F.R.
III
I
II
Graphical Method
Special Case.
Alternative Optimal
Solutions
3
6
9
2 4
6 x1
F.R.
(Unbounded)
Opt. Pt.
(Min.)
III
II
I
Graphical
Method
Special Case.
Z line
Opt. Sol. (Max)
(Unbounded)
3
6
9
2 4
6 x1
F.R. Not
possible
Infeasible
Solution
Graphical
Method
Special Case.
4
5
4
5 x1
x2
2 0 -2 -3
2
-1
-1
-2
-3
-4
I
II
III
F.R.
Z=6
Opt. Pt. (0.5,
4.5)
Z
opt
= 12.5
0 2 , 1
) ( 5 2 1
) ( 3 2 1 3
) ( 4 2 1 2 /
2 3 1 2
>
s +
s +
s
+ =
x x
III x x
II x x
I x x t s
x x Z Max
Graphical
Method
Special Case.
Graphical Method to
discuss typical constraints
to identify regions of
constraints.

4
5 x1
x2
0 -2 -3 -1
-1
-3
-2
1
2
3
2 1 3
Typical Case
? 6 2 2 1 3 > + x x plot to How
6 2 2 1 3 = + x x
) , Point( x x When 0 2 2 1 0 2 = =
) Point( x x When 3 , 0 3 2 0 1 = =
2
3
4
5 x1
x2
1 0 -2 -3
1
-1
-1
-2
-3
2 3
Typical Case
? 6 2 2 1 3 s x x plot to How
6 2 2 1 3 = x x
) , Point( x x When 0 2 2 1 0 2 = =
) Point( x x When 3 , 0 3 2 0 1 = =
4
5 x1
x2
0 -2 -3 -1
-1
-3
-2
1
2
3
2 1 3
Typical Case
? 0 2 1 > + x x plot to How
0 2 1 = + x x
2 1 x x =
) Point( x x When 1 , 1 1 2 1 1 = =
arrow For
0 1 0 2 > = x x
Recapitulate
What is LPP ?
Types of variables.
Components of LPP.
Assumptions of LP.
Formulation of LPP.
Types of solutions.
Graphical Method.
Unique & Alternative Optimal Solution,
Unbounded FR, Infeasible solution.
(2) Simplex Method
(Universal method)



Simplex Method to solve
Max. Problem with
All constraints.
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
s +
+ =
x x
III x
II x
I x x t s
x x Z Max
Standard Form:
Max Z = 3x1+5x2+0w1+0w2+0w3
3x1+2x2+w1+0w2+0w3 = 18
x1+0x2+0w1+w2+0w3 = 4
0x1+x2+0w1+0w2+w3 = 6
Simplex Method
Case 1.
c
i
x
i
b
i
x1 x2 w1 w2 w3
I
j
Z = 0 -3 -5 0 0 0
I
j
= (Z
j
-c
j
) = (Ea
ij
.c
i
)-c
j

c
j
3 5 0 0 0
To prepare initial Tableau:
Tableau - I
0 w1 18 3 2 1 0 0
0 w2 4 1 0 0 1 0
0 w3 6 0 1 0 0 1
Interpretation of Tableau
c
i
x
i
b
i
x1 x2 w1 w2 w3
I
j
Z = 0 -3 -5 0 0 0
c
j
3 5 0 0 0
Tableau - I
0 w1 18 3 2 1 0 0
0 w2 4 1 0 0 1 0
0 w3 6 0 1 0 0 1
Ratio
18/2 = 9
4/0 = o
6/1 = 6
Key Column Min I
j
Key Row Min positive ratio.
How to get next tableau ?
.
.) (
.). (
. .
No Key
No Column Key ing Correspond
No Row Key ing Correspond
No Old No New =
Leaving variable : w3
Entering variable : x2
Key no. = 1
For old key row : New No.= Old No./key No.
For other rows:
c
i
x
i
b
i
x1 x2 w1 w2 w3
0 w1 18 3 2 1 0 0
0 w2 4 1 0 0 1 0
0 w3 6 0 1 0 0 1
I
j
Z = 0 -3 -5 0 0 0
Ratio
18/2 = 9
4/0 = o
6/1 = 6
c
j
3 5 0 0 0
Tableau - I
18
.
.) (
.). (
. .
No Key
No Column Key ing Correspond
No Row Key ing Correspond
No Old No New =
5
18 - (6*2)/1 = 6
I(w3) = 0
0 - [1*(-5)]/1 =
0 w1 6 3 0 1 0 -2
0 w2 4 1 0 0 1 0
I
j
Z = 30 -3 0 0 0 5
Ratio
6/3 = 2
4/1 = 4
6/0 = o
c
j
3 5 0 0 0
Key Column Min I
j
Key Row Min positive ratio.
Tableau - II
5 x2 6 0 1 0 0 1
c
i
x
i
b
i
x1 x2 w1 w2 w3
3 x1 2 1 0 1/3 0 -2/3
I
j
Z = 36 0 0 1 0 3
c
j
3 5 0 0 0
Tableau - III
5 x2 6 0 1 0 0 1
This is the final Tableau.
The Optimal Solution is x1 = 2, x2 = 6
giving Z = 36
c
i
x
i
b
i
x1 x2 w1 w2 w3
0 w2 2 0 0 -1/3 1 2/3
Simplex Method to
Standard Maximization
Problem :
Shortcuts and key points
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
s +
+ =
x x
III x
II x
I x x t s
x x Z Max
Standard Form :
Max Z = 3x1+5x2+0w1+0w2+0w3
3x1+2x2+w1+0w2+0w3 = 18
x1+0x2+0w1+w2+0w3 = 4
0x1+x2+0w1+0w2+w3 = 6
Simplex Method
c
i
x
i
b
i
x1 x2 w1 w2 w3
0 w1 18 3 2 1 0 0
0 w2 4 1 0 0 1 0
0 w3 6 0 1 0 0 1
I
j
Z = 0 -3 -5 0 0 0
Ratio
18/2 = 9
4/0 = o
6/1 = 6
c
j
3 5 0 0 0
Tableau - I
18 18 - (6*2)/1= 6
I
(w3)
= 0 0 - [1*(-5)]/1 = 5
.
.) (
.). (
. .
No Key
No Column Key ing Correspond
No Row Key ing Correspond
No Old No New =
I
j
Z = 30
Ratio
6/3 = 2
4/1 = 4
6/0 = o
c
j
3 5 0 0 0
Key Column Min I
j
Key Row Min positive ratio.
Tableau - II

b
i
x1 x2 w1 w2 w3
c
i
x
i

0 w1
0 w2
5 x2
1
0
0
0
1
0
0
0
1
0 1
3
1
-2
0
6
4
6
0 0 0 -3 5
I
j
Z = 36
c
j
3 5 0 0 0
Tableau - III

b
i
x1 x2 w1 w2 w3
c
i
x
i

3 x1
0 w2
5 x2

0 0 3 1 0
6
2
2
Hence, Optimal Solution is
x1=2, x2=6 giving Z = 36.


Interpretation of
Simplex Method through
Graphical method.

3
6
9
2 4
6 x1
F.R.
Opt. Pt. (2,6)
Z=15.
Z
opt
= 36.
III
I
II
0 2 , 1
) ( 6 2
) ( 4 1
) ( 18 2 2 1 3 /
2 5 1 3
>
s
s
s +
+ =
x x
III x
II x
I x x t s
x x Z Max
Interpretation of Simplex Method
Through Graphical Method
T1
T3
T2
GATE - 2002
(1)
A furniture manufacture produces Chairs & Tables.
The wood working department is capable of producing
200 chairs or 100 tables or any proportionate
combinations of these per week. The weekly demand
for chairs and tables is limited to 150 and 80 units
respectively.The profit from a chair is Rs. 100 and that
from a table is Rs. 300.
Set up the problem as a Linear Program.
Determine optimal product mix and optimal value
of objective function.
If a profit of each table drops to Rs. 200 per unit,
what is the product mix and profit ?
(a)
(b)
(c)
GATE - 2002
MaxZ = 100x
1

+ 300x
2

S/t
1
100
2
200
1
s +
x x
x
1

s 150
x
2

s 80
x
1,
x
2

> 0

Formulation (a)
(40, 80) Z = 28000
Z = 15000
100
200
150
50
80
x
2

x
1

(b) Optimal Solution
(40, 80) Z = 20000
Z = 15000
100
200
150
50
80
x
2

x
1

75
Opt. Line
(c) Multiple Optimal Solutions
GATE - 2003
(1)
A manufacture produces two types of products, 1 and
2, at production levels of x
1
and x
2
respectively. The
profit is given 2x
1
+ 5x
2
. The production constraints
are :
The maximum profit which can meet the constraint is
(A) (D) (C) (B) 29 38 44 75
x
1
+ 3x
2
s 40
3x
1
+ x
2
s 24
x
1
+ x
2
s 10
x
1
> 0, x
2
> 0
40
x
2

x
1

10
10
20
Z = 50
Opt. Pt. (0,10) Z = 50
Ans. = (C) 44
25
GATE - 2000
Max Z = 4x
1

+ 6x
2
+ x
3

S/t
x
1,
x
2,
x
3

> 0
2x
1

+ x
2
+ 3x
3
s 5
Solve :
If x
2
s 2 is added then what will be the
solution ?
GATE - 2000
Solution :
x
1
= 0, x
2
= 5, x
3
= 0 giving z = 30
Through Simplex Method, in
two iterations the solution of
basic problem is :
If x
2
s 2 is added then the solution through
Simplex Method, in three iterations will be :
x
1
= 3/2, x
2
= 2, x
3
= 0 giving z = 18
GATE - 2008
Max Z = 4x
1

+ 6x
2

x
1,
x
2
> 0
3x
1

+ 2x
2
s 6
2x
1

+ 3x
2
s 6
Q.1 After introducing slack variables w
1
and w
2
, the initial
feasible solution is represented by the tableau below.
c
i
x
i
b
i
x
1
x
2
w
1
w
2

I
j
0 -4 -6 0 0
c
j
4 6 0 0
0 w
1
6 3 2 1 0
0 w
2
6 2 3 0 1
GATE - 2008
After some Simplex interactions, the following tableau is obtained.
c
i
x
i
b
i
x
1
x
2
w
1
w
2

I
j
12 0 0 0 2
c
j
4 6 0 0
0 w
1
2 5/3 0 1 -1/3
6 x
2
2 2/3 1 0 1/3
GATE - 2008
Q.2 The dual for given LP is :
(A) Min Z = 6u + 6v
S/t 3u + 2v > 4
2u + 3v > 6
u , v > 0
(B) Max Z = 6u + 6v
S/t 3u + 2v s 4
2u + 3v s 6
u , v > 0
(C) Max Z = 4u + 6v
S/t 3u + 2v > 6
2u + 3v > 6
u , v > 0
(D) Min Z = 4u + 6v
S/t 3u + 2v s 6
2u + 3v s 6
u , v > 0
Thank you
For any Query or suggestion :
Contact :
Dr. D. B. Naik
Professor, Training & Placement
Sardar Vallabhbhai National Institute
of Technology, Surat
Ichchhanath, Surat 395 007

Email : dbnaik_svr@yahoo.com
Phone No. 0261-2255225 (O)

Vous aimerez peut-être aussi