Professional Documents
Culture Documents
IS 231
Operation Research
Dr. Yasser ALHABIBI
E-mail: yasser.alhabibi@must.edu.eg
Misr University for Science and Technology
Faculty of Information Technology
Fall-2023
List of References
Course notes
Available (handed to students' part by part).
Recommended books
Other books that are related to Operation Research
Course Outline
Introduction to Operation Research
Linear Programming
Solving LP Linear Programming using Simplex
Method
The Transportation problem
The Assignment Problem
Project Scheduling ( PCM & PERT ).
Operation Research
WKS
01 Introduction to Operation Research
02 Introduction to Linear Programming
03 The Fundamental Theorem of Linear Programming Geometry in Rn
Basic Linear Algebra, Definitions and theorems
04 Solving Linear Programming Problem (Graphical Solution)
05 Solving Linear Programming Problem ( The Simplex Method)
06 QUIZ 01
07 Solving Linear Programming Problem Two phases of the Simplex Method
08 Duality
09 Complementary Slackness Theorem
10 Application of Linear Programming ( Transportation Problem)
Alternative Criteria for Finding Initial BF Solution
11 Application of Linear Programming ( Transportation Problem) Optimal Solution
12 QUIZ 02
13 Application of Linear Programming (Assignment Problem)
Alternative Criteria for Finding Initial BF Solution
14 4 Project Scheduling ( PCM & PERT ). LAB Final Exam
15 FINAL EXAM
Course Objectives
8
The Simplex Method
Algorithm for solving LPPs in Standard Form
Min cT x
s.t. A x = b
and x ≥ 0
Basic steps:
Phase I: Pivot to obtain feasible solution
Phase II: Pivot to optimal solution
9
Standard Form
Since simplex method requires standard form, we must be able to convert any
LPP:
1. Eliminate inequalities:
A i x bi Ai x bi
A i x s i b A i x s i b
si 0 si 0
slack surplus
)Murty uses “slack” for both( Slack is the difference
between the left- and
2. convert max to min: right-hand sides of a
max cTx = - min -cTx constraint when the
optimal solution is
3. Eliminate unrestricted variables: i.e., 0, +ve or -ve substituted for the
variables.
x i x i x i
.xi unr x , x 0
i i
10
Simplex Algorithm
The objective of the simplex algorithm is to find a vector X ≥ 0, which
minimizes the function f(X) and satisfies the equations:
1 . x1 + 0 . x2 + … + 0 . xm + a"1,m+1 . xm+1 + … + a"1,n . xn = b"1
0 . x1 + 1 . x2 + … + 0 . xm + a"2,m+1 . xm+1 + … + a"2,n . xn = b"2
……………………………………………………………………. (1)
0 . x1 + 0 . x2 + … + 1 . xm + a"m,m+1 . xm+1 + … + a"m,n . xn = b"m
0 . x1 + 0 . x2 + … + 0 . xm - f + c"m+1 . xm+1 + … + c"n . xn = -f"0
where a"ij , c"j , b"i and f"0 are constants.
Notice that: (-f) is treated as a basic variable in the form (1) which is called a
canonical form.
The basic solution which can be deduced from equations (1) is:
(the first m-equations are m-equations in m-basic variables xi , i=1,2,…,m)
xi = b"i , i = 1,2,…,m
f = f"0 (2)
xi = 0 , i = m+1, m+2,…,n
For this basic solution to be feasible, xi = b"i , i = 1,2,…,m.
11
Theorem
A basic feasible solution is an optimal solution with a
minimum objective function with value f"0 if all the cost
coefficients c“j, j = m+1, m+2,…,n in equation (1) are
nonnegative.
Proof
From last row of equations (1) , we have
f = f"0 + c"m+1 . xm+1 + … + c"n . xn (3)
xi, i= m+1, m+2, … ,n are (now) non-basic variables with
zero values, and will be nonnegative if it becomes basic.
Hence if all the cost coefficients c"j , j = m+1, m+2,…,n
are nonnegative , f cannot be decreased , and its present
value is the required minimum.#
12
Special cases
1) If all c"i > 0 for i = m+1, m+2, … , k-1, k+1, …, n
and c"k = 0 for some non-basic variable xk.
Then if the constraints allow that variable to be made
positive (from its present value of zero), no change in
f results, and there are multiple optimal (infinite
number of solutions).
13
Improving a non-optimal basic
feasible solution
From last row of equations (1) , we have
m n
f = f 0'' + ci'' x i x jc ''j (4)
i 1 j m 1
15
Improving a non-optimal basic
feasible solution
4) If all the coefficients a"is ≤ 0, i = 1, 2, …, m.
On making xs a basic variable, we obtain:
x1 = b"1 – a"1s xs , ≥ b“1,
x2 = b"2 – a"2s xs , ≥ b“2,
……………………………... (6)
xm = b"m – a"ms xs , ≥ b“m,
x1 - x 2 + 3 x3 ≤ 9
:Solution: First, convert it to the standard form, We add slacks to get
and x 1 , x 2 , x3 ≥ 0
- Min -z = -2 x1 - x2 - 3 x3
S.t.
x1 + 3 x2 +2 x3 + s1 =6
x1 - x 2 + 3 x3 + s2 = 9
Where:
and S1 and S2 arex1 slack
, x2 , svariables.
1 , s2 ≥ 0 .
We solve by the simplex tableau as follows:
19
Departing Variable Min. Ratio
Interning Variable
B.V X1 X2 X3 S1 S2 -Z R.H.S θ
S1 1 3 2 1 0 0 6 6/2=3
S2 1 -1 3 0 1 0 9 9/3=3
CN - ZN -2 -1 -3 0 0 1 0 B.F.S.=(0,0,0,6,9)
X1 1 3 2 1 0 0 6
S2 0 -4 1 -1 1 0 3
CN - ZN 0 5 1 2 0 1 12 B.F.S.=(6,0,0,0,3)
:Optimal Solution
z 12 at x 1 6, x 2 0, x 3 0.
20
Example 2
:Solve the following L.P.P
Min z = x1 - 3 x2 + 3 x3
Subject to
3x1 - x2 +2 x3 ≤ 7
2x1 + 4 x2 ≥ -12
-4x1 + 3 x2 +8x3 ≤ 10
:Solution
and positive:
- Make all the bi ’s (R.H.S) x 1 , x 2 , x3 ≥ 0
2x1 + 4 x2 ≥ -12
Multiplying the second constraint throughout by (-1).
- 2x1 - 4 x2 ≤ 12
21
Example 2 : Solution
:Solution: First, convert it to the standard form, We add slacks to get
Min z = x1 - 3 x2 + 3 x3
Subject to
3x1 - x2 + 2 x3 + S1 = 7
-2x1 - 4 x2 + S2 = 12
-4x1 + 3 x2 +8x3 + S3 = 10
Where: S1 , S2 , S3 are slack variables. We solve by the simplex tableau
as follows: and x1 , x2 , x3 , S1 , S2 , S3 ≥0
- So we can use S1 , S2 ,and S3 as the initial basis (Basic Feasible
Solution).
m=3, n=6, m-n=6-3=3.
- The initial basis: BFS
x1 x2 x3 s1 s2 s3
, z 0
0 0 0 7 12 10
22
B. V. x1 x2 x3 S1 S2 S3 -Z R.H.S θ (Ratio)
-
S1 3 -1 2 1 0 0 0 7
S2 -2 -4 0 0 1 0 0 12 -
S3 -4 (3) 8 0 0 1 0 10 10/3
B.F.S.=(0,0,0,7,12,10)
CN - ZN 1 -3 3 0 0 0 1 0
CN - ZN -3 0 11 0 0 1 1 -10 B.F.S.=(0,10/3,0,31/3,76/3,0)
3x1 - 2x2 ≤ 6
24
Example 3
Solution (Unbounded solution )
θ
B. V. x1 x2 S1 S2 -Z R.H.S
1
S1 (1) -1 1 0 0 1
2
s2 3 -2 0 1 0 6
CN - ZN -3 -2 0 0 1 0
-
x1 1 -1 1 0 0 1
3
s2 0 (1) -3 1 0 3
CN - ZN 0 -5 3 0 1 3
-
x1 1 0 -2 1 0 4
-
x2 0 1 -3 1 0 3
CN - ZN 0 0 -12 5 1 18
Since c"3 = -12 is the most negative cost coefficient, all a"i3 ≤ 0, we have
an unbounded solution.
25
Example 4
Infinite number of solutions
:Solve the following L.P.P
Min Z = -40 x1 -100 x2
Subject to 10 x1 + 5 x2 ≤ 2500
4x1 + 10 x2 ≤ 2000
2x1 + 3 x2 ≤ 900
:Solution: First, convert it to the standard form, We add slacks to get
and x
Min Z = -40 x1 -100 x 1 , x2 ≥ 0 .
2
s.t. 10 x1 + 5 x2 + S1 = 2500,
4x1 + 10 x2 + S2 = 2000
2x1 + 3 x2 + S3 = 900
and x1 , x2 , s1 , s2 , s3 ≥ 0 .
S1 500
10 5 1 0 0 0 2500
S2 200
4 (10) 0 1 0 0 2000
S3 300
2 3 0 0 1 0 900
CN - ZN -40 -100 0 0 0 1 0
S1 8 0 1 -1/2 0 0 1500
CN - ZN 0 0 0 10 0 1 20000
Since all c"i ≥ 0 , the present solution is optimum and is given by:
x2 = 200, S1 = 1500, S3 = 300, … basic variables, x1 = S2 = 0 , … non-
basic variables, Zmin = -20000.
Since the cost coefficient corresponding to the non-basic variable x 1 is
c" =0, we have an infinite number of solutions. 27
Example 5
Solve the following L.P.P
Min Z 4 x 1 x 2 30 x 3 11x 4 3x 5 3x 6
s .t 2x 1 6x3 2x 4 3x 6 x 7 20
4x 1 x 2 7 x 3 x 4 x6 10
5 x 3 3x 4 x 5 x 6 60
and x i 0, i 1, 2,..., 7
:Solution
- We see that x2 , x5 and x7 are Basic Variable.
x 2 10 4x 1 7x3 x 4 x6
x 5 60 5 x 3 3x 4 x6
x 7 20 2x 1 6x 3 2x 4 3x 6
- We know that the objective function given in terms of non-basic variables.
So we eliminate B.V. from O.F. So, Sub by x2 , x5 and x7 in O.F.
Z 4 x 1 10 4x 1 7 x 3 x 4 x 6 30 x 3 11x 4
3 60 5 x 3 3x 4 x 6 3x 6 13x 3 6x 4 2x 6 110
28
B. V. x1 x2 x3 x4 x5 x6 x7 -Z R.H.S θ (Ratio)
x7 -2 0 6 2 0 -3 1 0 20 10
x2 -4 1 7 (1) 0 -1 0 0 10 10
x5 0 0 -5 3 1 -1 0 0 60 20
CN - ZN 0 0 13 -6 0 2 0 1 110 B.F.S.=(0,10,0,0,60,0,20)
x7 (6) -2 -8 0 0 -1 1 0 0 0
x4 -4 1 7 1 0 -1 0 0 10 -
x5 12 -3 -26 0 1 2 0 0 30 30/12
CN - ZN -24 6 55 0 1 -4 0 1 170 B.F.S.=(0,0,0,10,0,0,30)
x1 1 -1/3 -4/3 0 0 -1/6 1/6 0 0 -
x4 0 -1/3 5/3 1 0 -5/3 4/6 0 10 -
x5 0 1 -10 0 1 (4) -2 0 30 30/4
CN - ZN 0 -2 23 0 0 -8 4 1 170 B.F.S.=(0,0,0,10,0,0,30)
Min Z 5 x 1 14x 2 7 5 x 1 2 x 2 x 4 9x 4
12x 1 2x 4 35
30
Unbounded solution : Example 6
Min Z 5 x 1 14x 2 7 x 3 9x 4
s .t x 1 2x 2 x 3 x 4 5
x1 3x 2 5x 4 s1 10
2x 1 2 x 2 4x 4 s 2 10
and x 1 , x 2 , x 3 , x 4 , s 1 , s 2 , 0
31
θ (Ratio)
B. V. x1 x2 x3 x4 s1 s2 -Z R.H.S
x3 (1) -2 1 1 0 0 0 5 5
s1 -1 -3 0 5 1 0 0 10 -
s2 2 2 0 -4 0 1 0 10 5
CN - ZN -12 0 0 2 0 0 1 -35 B.F.S.=(0,0,5,0,10,10)
x1 1 -2 1 1 0 0 0 5 -
s1 0 -5 1 6 1 0 0 15 -
s2 0 (6) -2 -6 0 1 0 0 0
CN - ZN 0 -24 12 14 0 0 1 25 B.F.S.=(5,0,0,0,0,15,0)
x1 1 0 1/3 -1 0 1/3 0 5 -
s1 0 0 -2/3 (1) 1 5/6 0 15 15
x2 0 1 -1/3 -1 0 1/6 0 0 -
CN - ZN 0 0 4 -10 0 4 1 25 B.F.S.=(5,0,0,0,15,0)
x1 1 0 -1/3 0 1 7/6 0 20 -
x4 0 0 -2/3 1 1 5/6 0 15 -
x2 0 1 -1 0 1 1 0 15 -
Since c"3 = -8/3 is the most negative cost coefficient, all a" i3 ≤ 0, we
have an unbounded solution.
32
33