Operations Research Lectures PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Operations Researches

Lecture 1
Linear Programming:
Transportation Problem
Introduction
Transportation problem is a special kind of Linear Programming Problem (LPP)
in which goods are transported from a set of sources to a set of destinations subject
to the supply and demand of the sources and destination respectively such that the
total cost of transportation is minimized. It is also sometimes called as Hitchcock
problem.

Types of Transportation Problems


There are two types:
• Balanced:
Supply = Demand (Equilibrium)
• Unbalanced:
Supply != Demand (Either Greater or less)

 In this type of problem, either a dummy row or a dummy column is added
according to the requirement to make it a balanced problem. Then it can be
solved similar to the balanced problem.

Methods to Solve
To find the initial basic feasible solution there are three methods:
1. North-West Corner Method
2. Least Cost Method
3. Vogel’s Approximation Method (VAM)

(2)
Basic Structure
→ D1 to D4 are the destinations where the products/goods are to be delivered from
different sources S1 to S4.
→ Si is the supply from the source Oi
→ dj is the demand of the destination Dj
→ Cij is the cost when the product is delivered from source Si to destination Dj.
Important Notes:
→ Objective Function is to minimize the cost and find the optimum cost.

Balanced Transportation Problem


1. North-West Corner Method
S\D A B C D Q. Supplied
S1 10 2 20 11 15
S2 12 7 9 20 25
S3 4 14 16 18 10
Q. Demanded 5 15 15 15 50
Where:
S → Source,
D → Destination (Store)
In this method we will start from the Red Cell until we fulfilled the demand of the
store1 or demander1 and jump to the next Column to fulfill the next store demand
and so on.

Solution
- First check if the demand equal to the supply:
Q. Demanded = 5 + 15 +15 +15 = 50
Q. Supplied = 15 + 25 + 10 = 50
Demand = Supply → Balanced
- Start to fulfill the demand of the store 1 from the sources.
Store1 or A will take all its demand from S1 so we will cross the column of this store
because its demand has fulfilled.

(3)
S\D A B C D Q. Supplied
S1 5 10 10 2 20 11 15 → 10 → 0
S2 12 5 7 15 9 5 20 25 → 20 → 5 → 0
S3 4 14 16 10 18 10 → 0
Q. Demanded 5→0 15 → 5 → 0 15 → 0 15 → 5 → 0 50
Note:
✔ All the demand and supply must finish up to be 0 (because of equilibrium)
✔ In the last remaining cell the demand for the respective columns and rows are
equal
Total cost = 5×10+10×2+5×7+15×9+5×20+10×18 = $520

2. Least Cost Method


According to the Least Cost Cell method, the least cost among all the cells in the
table has to be found.
‫تبدأ باالقل تكلفة ثم األعلى منها وهكذا‬

S\D A B C D Q. Supplied
S1 10 15 2 20 11 15 → 0
S2 12 0 7 15 9 10 20 25 → 10 → 0
S3 5 4 14 16 5 18 10 → 5→ 0
Q. Demanded 5→0 15 → 0 15 → 0 15 →10→ 0 50
Note:
→ If the cell demand = supply then we must cross only its row or column not both.
(like highlighted cell)
Total cost = 15×2+15×9+10×20+5×4 +5×18 = $475
Number of Filled cells = M + N – 1
Total Cells = M * N
Number of Constraints = M + N
Where
M → Number of Rows
N → Number of Columns

(4)
Constraints:
1. Amount that can be supplied form S1 to A, B, C, and D <= 15
2. Amount that can be supplied form S2 to A, B, C, and D <= 25
3. Amount that can be supplied form S3 to A, B, C, and D <= 10
4. Amount A demanded from S1, S2, S3, and S4 <= 5
5. Amount B demanded from S1, S2, S3, and S4 <= 15
6. Amount C demanded from S1, S2, S3, and S4 <= 15
7. Amount D demanded from S1, S2, S3, and S4 <= 15

3. Vogel’s Approximation Method (VAM)


S\D A B C D Q. Penalty
Supplied P1 P2 P3 P4
S1 10 15 2 20 11 15 → 0 8 9 -- --
S2 12 0 7 15 9 10 20 25→10→ 0 2 2 2 11
S3 5 4 14 16 5 18 10→5→ 0 10 2 2 2
Q. Demanded 5→0 15 → 0 15 → 0 15→5→0 50
P1 6 5 7 7
Penalty

P2 -- 5 7 7
P3 -- 7 7 2
P4 -- -- 7 2

First: we calculate the penalty for each row and column


P1 = 10 – 2 = 8,
=9–7 = 2
= 14 – 4 = 10
= 10 – 4 = 6
and so on…
Second: we choose the highest penalty form P1 row and column, in this case the highest penalty
is 10
Third: choose the least cost in the row or the column we choosed previously.
Total Cost = 15 * 2 + 5 * 4 + 15 * 9 + 10 * 20 + 5 * 18 = $475
Which method is best ?
The method that gives least cost of transportation is the best method.

(5)
Exercise:
S\D A B C D Q. Supplied
E 6 8 8 5 30
F 5 11 9 7 40
G 8 9 7 13 50
Q. Demanded 35 28 32 25 120

Which method gives the least cost?

Unbalanced Transportation Problem


Below transportation problem is an unbalanced transportation problem.

Demand < Supply → we will add a new column to balance

(6)
Solution:
In this type of problem, the concept of a dummy row or a dummy column will be
used.
As in this case, since the supply is more than the demand so a dummy demand
column will be added and a demand of (total supply – total demand) will be given
to that column i.e. 117 – 95 = 22 as shown in the image below. If demand were
more than the supply then a dummy supply row would have been added.

Note:
The cost in the new dummy column or row is zero.

Now you can solve the problem as a balanced problem using the three method and
calculate the total cost then choose the method that give the least cost.

Finished :)
(7)
Operations Research
Lecture 2
Linear Programming Model
LP Model
Operations Research (OR): is a scientific approach to the solution of problems
in the management of complex systems that enables decision makers to make
better decisions.
‫هي عبارة عن الطريقة أو االسلوب العلمي المستخدم لحل المشاكل في االدارات واألنظمة الكبيرة‬

The main target is the optimization:


• Profit Maximization Abstraction (Simplification) of the
problems
• Cost Minimization

How To Create LP Model


1. Determining the Decision Variables
2. Determining the Objective Function (Max or Min) and must be of Level 1
3. Determining the Constraints that the governed by Max or Min.
Example 1:
Suppose that there is a company that manufacturing three products A, B, C
and to manufacturing these products it will takes:
A B C Available Resources
Labor 7 3 6 150
Material 4 4 5 200
Profit 4 2 3
The amount of labor and material is restricted to 150 and 200 respectively.

To Create LP Model
First: We determine the decision variables as follows:
X1 → Daily production rate of A,
X2 → Daily production rate of B,
X3 → Daily production rate of C
Second: We determine the Objective Function.
Because we concerned with profit so the objective function is Max.
Max. Z = 4X1 + 2X2 + 3X3

(2)
Third: We determine the constraints that governs the objective function as follows:
Subject To (ST):
7X1 + 3X2 + 6X3 ≤ 150
4X1 + 4X2 + 5X3 ≤ 200
X1 , X2 , X3 ≥ 0
(Non-negative Constraint)
Note:
- We use ≥ in constraints with: (Min, more than, at least, not less than)
- We use ≤ in constraints with: (Max, budget, less than, capacity, at most,
restricted)

The Final Form of LP Model:

Max Z = 4X1 + 2X2 + 3X3


ST
7X1 + 3X2 + 6X3 ≤ 150
4X1 + 4X2 + 5X3 ≤ 200
X1 , X2 , X3 ≥ 0
Example 2:
A company produces three products A, B, and C and these products are
processed through three different machines 1, 2, and 3. It is required to determine
the daily number of units to be manufacturing for each product to maximize the
total profit.
A B C
Machine 1 1 2 1 430
Machine 2 3 0 1 460
Machine 3 1 4 0 420
Profit 3 2 5
The capacity of machines is restricted to the numbers shown in the above table.
Decision Variables:
X → production of A
Y → production of B

(3)
Z → production of C

(4)
Objective Function:
Max. C = 3X + 2Y + 5Z
Subject To (ST):
X + 2Y + Z ≤ 430
3X + Z ≤ 460
X + 4Y ≤ 420
X, Y, Z ≥ 0
(Non-negative Constraint)
→ Don’t forget non-negative constraint.
→ Variable names is optional
→ When you found the word “Profit” so the objective functions is Max, and
when you found the word “Cost” so the objective function is Min.

(5)
Operations Research
Lecture 3
Linear Programming Model:
Graphical Representation
LP Model: Graphical Representation
Previously, we learn how to create a linear programming model and make
the General model. We will solve this model graphically to find the optimal
solution.
Definitions you should know first:
• Solution: Is the set of values of decision variables that satisfy the
constraints of an LP problem.
• Feasible Solution: Is the set of values of decision variables that satisfy all
the constraints and non-negativity conditions of an LP problem
simultaneously.
• Infeasible Solution: Is the set of values of decision variables that do not
satisfy all the constraints and non-negativity conditions of an LP problem
simultaneously.
• Basic Solution: Is any intersect between two lines in a graphical
representation of the constraints.
• Basic Feasible Solution: Is the solution that combine the characteristics of
both Basic and Feasible Solution.
• Optimal Solution: A basic feasible solution that optimizes (maximizes or
minimizes) the objective function value of the given LP problem.
• Unbounded Solution: A solution that can increase or decrease infinitely the
value of the objective function of the LP problem.
Notes:
• A feasible region is a region that combined among all the constraints.
Steps to Solve:
1. Convert constraints from inequality (≤ or ≥) to equality (=),
2. Substitute for variable to 0 and find the another one’s value.
3. Draw the line in the first positive quarter (non-negative constraints)

(2)
4. If constraint has ≤ then the feasible region will be below the line, and if
constraint has ≥ then the feasible region will be above the line.
5. Find the common area among all feasible regions.
6. Find basic points in the shape and substitute by it in the objective function to
find the optimal solution
Example 1:
3X1 + 2X2 = 12
Solution

X1 0 4
X2 6 0

→ Feasible region is all points on the line.


Solution is bounded.

Example 2
X1 + X2 ≤ 8
Solution
Transform to X1 + X2 = 8
X1 0 8
X2 8 0
feasible region is bounded and plotted on the line and
all area below the line.

Note: we just take the positive quarter because the


non-negative constraint.

(3)
Example 3:
4X1 + X2 ≥ 10
Solution
Transform to 4X1 + X2 = 10
X1 0 2.5
X2 10 0
Feasible Region

Solution is unbounded and plotted on the


line and all area above it.
→ Infinity Solutions

Example 4:
2X1 – 3X2 ≤ 12
Transform to 2X1 – 3X2 = 12
X1 0 6 Feasible Region
X2 -4 0

Solution is unbounded and plotted on the


positive part of the line and all area above
the line but not in negative quarter.
→ Infinity Solutions

Example 5:
Max Z = 10X1 + 6X2
ST
5X1 + 3X2 ≤ 30
X1 + 2X2 ≤ 18
X1, X2 ≥ 0
(4)
1. 5X1 + 3X2 = 30
X1 0 6
X2 10 0 B
A

2. X1 + 2X2 = 18
X1 0 18
X2 9 0

Solution is bounded in the area of the Feasible


Region
shape ABCD.
To find the value of the point B we will D C
solve the two equations.
5X1 + 3X2 = 30
X1 + 2X2 = 18 this will be multiplied by 5

5X1 + 3X2 = 30
(-) 5X1 + 10X2 = 90
-------------------------
-7X2 = -60
60 60
X2 = 7
, so we will substitute by X2 = 7
in the first equation.
60 30
X1 = 30 – 3 * 7
= 7

→ To find optimal solution we will substitute by points in objective function:


At point D (X1 = 0, X2 = 0):
Z=0
At point A (X1 = 0, X2 = 9):
Z = 10 * 0 + 6 * 9 = 54

(5)
30 60
At point B (X1 = 7
, X2 = 7
):
30 60
Z = 10 * 7
+6* 7
= 60 (Optimal Solution)

At point C (X1 = 6, X2 = 0):


Z = 10 * 6 + 6 * 0 = 60 (Alternative Solution)
Optimal solution is pointed at B or C and achieve a max profit of 60.

Note: it must be a common region among all constraints and if not there will be an
infeasible solution.

As we see in the above representation, there is no common area among constraints


so the solution is Infeasible Solution.
Exercises:
1) Max Z = 5X1 + 2X2
ST
X1 + X2 ≤ 18
4X1 + X2 ≤ 12
X1 , X2 ≥ 0

Find Optimal Solution Graphically?

(6)
2) Max Z = 40X1 + 100X2
ST
12X1 + 6X2 ≤ 3,000
4X1 + 10X2 ≤ 2,000
2X1 + 3X2 ≤ 900
X1 , X2 ≥ 0
Find Optimal Solution Graphically?

3) Max Z = 3X1 + 2X2


ST
-2X1 + 3X2 ≤ 9
4X1 – 2X2 ≤ –20
X1 , X2 ≥ 0

Finished :)

(7)
Operations Research
Lecture 4
Linear Programming:
Simplex Method
LP: Simplex Method
A linear programming model consists of:
• Objective Function
• Constraints
• Non-negative Constraint
We discussed earlier the graphical solution of a LP model and we are continuing
to know how to solve LP model using Mathematical Methods.
There are two mathematical methods:
• Simplex Method: used when all constraints are ( ≤ )
• Big-M Method (M Technique): used when one or more constraint is (=, ≥).
Steps to Solve:
1. Transform LP model to Standard form
2. All constants in constraints must be positive (+)
3. Check which method will you use (Simplex or Big-M) by checking the sign
in all constraints.
4. Add a slack variable(S) to the constraint which has a ≤ sign and convert the
sign to =
5. Determine the basic variables and non-basic variables:
Basic variable has a value while non-basic variable its value is 0.
6. Always X1 and X2 are non-basic variables
7. calculate the value of slack variables (S).
8. Draw the initial solution table.

S→is the idle power so its equal to (available – used)


‫يمثل المتغير الراكد الطاقة العاطلة الغير مستخدمة‬

(2)
Example P. 47:
Max Z = 3X1 + 2X2
ST
X1 + X2 ≤ 4
X1 – X2 ≤ 2
X1 , X2 ≥ 0
Find optimal solution using mathematical method?

Solution
All constants have ≤, so we will solve using simplex.
First we will convert General LP to Standard LP:
1. X1 + X2 + S1 = 4
2. X1 – X2 + S2 = 2
3. Max Z = 3X1 + 2X2 + 0S1 + 0S2
We have 4 variables in only two equations so we will determine which variables
are basic and which are non-basic.
→ X1, X2 are Non-Basic variables so there value will be 0,
→ S1, S2 are Basic variables.

We then substitute by 0 for X1 and X2 in constants to find the value of S1 and S2


→ S1 = 4,
→ S2 = 2
This is called the initial solution where we start from the origin point (0,0).
Co-eff of Z Ćj 3 2 0 0
Basic Var. CB XB X1 X2 S1 S2
S1 0 4 1 1 1 0

S2 0 2 1 -1 0 1
Z = CB * XB = 0 0 0 0 0
Optimal Test 3 2 0 0
The row before last row calculated by (CB * Xi).
Optimal test row = Co-eff of Z - The row before last row

(3)
To find if this solution is optimal solution or not:
• If the objective function is Max:
Optimal test row values must be negative or 0
• If the objective function is Min:
Optimal test row values must be positive or 0
→ If the solution is not the optimal solution so the solution should be improved
until it’s become optimal solution.

Improve the solution:


First decide the enter variable and then the outer variable:
→ the enter variable (Pivot Column) in max will be highest positive number in
optimal test row,
→ the outer variable can be found by ratio and we choose lowest positive value,
Ratio is calculated by divide XB by Pivot Column (Green column).

Co-eff of Z Ćj 3 2 0 0
Basic Var. CB XB X1 X2 S1 S2 Ratio
S1 0 4 1 1 1 0 4
S2 0 2 1 -1 0 1 2
Z = CB * XB = 0 0 0 0 0
Optimal Test 3 2 0 0

Here the incoming variable is X1, and the outgoing variable is S2


→ the intersection between the pivot column and the outer variable row is called
the pivot element (Red Cell).
Co-eff of Z Ćj 3 2 0 0
Basic Var. CB XB X1 X2 S1 S2
S1 0 2 0 2 1 -1
X1 3 2 1 -1 0 1
Z = CB * XB = 6 3 -3 0 3
Optimal Test 0 5 0 -3

(4)
current pivot row
New pivot row = pivot element

Current pivot row = (2 1 -1 0 1)


pivot element = 1
new pivot row = (2 1 -1 0 1) / 1 = (2 1 -1 0 1)
→ We need now to calculate the values of ٍS1 (R1)
R1 = Current R1 – new pivot row * co-efficient of pivot column
co-efficient of pivot column is the intersection between the current R1 and current
pivot row.
R1 = (4 1 1 1 0) – (2 1 -1 0 1) * 1 = (2 0 2 1 -1)

→ If we look at the previous table we will find that it’s not an optimal solution
because the optimal test row contain positive values so we will improve the
solution.

Co-eff of Z Ćj 3 2 0 0
Basic Var. CB XB X1 X2 S1 S2 Ratio
S1 0 2 0 2 1 0 1
X2 3 2 1 -1 0 1 -2
Z = CB * XB = 3*2 = 6 3 -3 0 3
Optimal Test 0 5 0 -3

Co-eff of Z Ćj 3 2 0 0
Basic Var. CB XB X1 X2 S1 S2
X2 2 1 0 2 1/2 -1/2
X1 3 3 1 0 1/2 1/2
Z = CB * XB = 2*1 + 3*3 = 11 3 2 5/2 1/2
Optimal Test 0 0 -5/2 -1/2
This solution is optimal solution because optimal test row doesn’t contain positive.

(5)
Operations Research
Lecture 5
Linear Programming:
Big-M Method
LP: Big-M Method
Steps to Solve:
1. Transform General LP model to Standard form
2. All constants in constraints must be positive (+)
3. If at least one constraint has = or ≥ sign then we will use Big-M method
4. Add a slack variable(S) to the constraint which has a ≤ sign or deduct a
surplus variable(S) to the constraint which has a ≥ and convert the sign to =
5. If the constraint has a = or ≥ sign we will add artificial variable (a)
6. In the objective function we will add (M) variable and its sign will be
determined based on the type of the objective function:
- Max (Profit) → -M
- Min (Cost) → +M
M → is a very big number (called penalty)
7. Determine the basic variables and non-basic variables:
Basic variable has a value while non-basic variable its value is 0.
8. Always X1 ,X2 , -S are non-basic variables
9. calculate the value of Basic variables.
10. Draw the initial solution table.
Example P. 61:
Max Z = 3X1 + 2X2
ST
2X1 + X2 ≤ 2
3X1 + 4X2 ≥ 12
X1 , X2 ≥ 0
Find optimal solution using mathematical method?

(2)
Solution
the is one constraint has ≥ sign, so we will solve using Big-M method.
First we will convert General LP to Standard LP:
1. 2X1 + X2 + S1 = 2
2. 3X1 + 4X2 - S2 + a1= 12
3. Max Z = 3X1 + 2X2 + 0S1 + 0S2 – Ma1
We have 5 variables in only two equations so we will determine which variables
are basic and which are non-basic.
→ X1, X2 , and S2 are Non-Basic variables so there value will be 0,
→ S1, a1 are Basic variables.

We then substitute by 0 for X1 , X2 and S2 in constraints to find the value of S1


and a1:
→ S1 = 2,
→ a1 = 12
This is called the initial solution where we start from the origin point (0,0).
Co-eff of Z Ćj 3 2 0 0 -M
Basic Var. CB XB X1 X2 S1 S2 a1
S1 0 2 2 1 1 0 0

a1 -M 12 3 4 0 -1 1
Z = CB * XB = -12M -3M -4M 0 M -M
Optimal Test 3 + 3M 2 + 4M 0 -M 0
The row before last row calculated by (CB * Xi).
Optimal test row = Co-eff of Z – The row before last row
To find if this solution is optimal solution or not:
• If the objective function is Max:
Optimal test row values must be negative or 0
• If the objective function is Min:
Optimal test row values must be positive or 0
→ If the solution is not the optimal solution so the solution should be improved
until it’s become optimal solution.

(3)
Improve the solution:
First decide the enter variable and then the outer variable:
→ the enter variable (Pivot Column) in max will be highest positive number in
optimal test row,
→ the outer variable can be found by ratio and we choose lowest positive value,
Ratio is calculated by divide XB by Pivot Column (Green column).

Co-eff of Z Ćj 3 2 0 0 -M
Basic Var. CB XB X1 X2 S1 S2 a1 Ratio
S1 0 2 2 1 1 0 0 2
a1 -M 12 3 4 0 -1 1 3
Z = CB * XB = 0 -3M -4M 0 M -M
Optimal Test 3+3M 2+4M 0 -M 0

Here the incoming variable is X2 because 4M is greater than 3M, and the outgoing
variable is S1
Co-eff of Z Ćj 3 2 0 0 -M
Basic Var. CB XB X1 X2 S1 S2 a1
X2 2 2 2 1 1 0 0
a1 -M 4 -5 0 -4 -1 1
Z = CB * XB = 4 – 4M 4+5M 2 2+4M M -M
Optimal Test -1-5M 0 -2 – 4M -M 0
current pivot row
New pivot row =
pivot element

Current pivot row = (2 2 1 1 0 0)


pivot element = 1
new pivot row = (2 1 -1 0 1) / 1 = (2 2 1 1 0 0)
→ We need now to calculate the values of ٍa1 (R1)
R1 = Current R1 – new pivot row * co-efficient of pivot column
co-efficient of pivot column is the intersection between the current R1 and current
pivot row.
(4)
R1 = (12 3 4 0 -1 1) – (2 2 1 1 0 0) * 4 =
(12 3 4 0 -1 1) - (8 8 4 4 0 0) = (4 -5 0 -4 -1 1)

→ If we look at the previous table we will find that it’s an optimal solution because
the optimal test row does not contain positive values.

Exercise:
Min Z = 4X1 + X2
S.T
3X1 + X2 = 3
4X1 + 3X2 ≥ 6
X1 + 2X2 ≤ 4
X1,X2 ≥ 0

(5)
Operations Research
Lecture 6
Games Theory
Games Theory
Any match is a competitive situation between persons called players.
Players are divided into:
 Row Player ‫العب الصف‬
 Column Player ‫العب العمود‬
Each player has strategies in a match and may win or lose the match.
- Any positive number represents a gain for Row Player and a loss for Column Player.
- Any Negative number represents a gain for Column Player and a loss for Row Player.
Example: Player B
2 5 1
Player A [ ]
3 −1 0
Let us explain this:
- This matrix is 2*3 level, which means that it has 2 rows and 3 column.
- Rows represent the strategies of the row player (2 rows = 2 strategies) and as on for
column (3 column = 3 strategies) for column player.
- +  gain for row player, loss for column player
- -  gain for column player, loss for row player.
If player A choose the first strategy (first row) and player B choose second strategy (second
column) the end game will be a gain for player A by 5 points.
If player B choose the second strategy (second column) and player A choose second strategy
(second row) the end game will be a gain for player B by 1 point.
Each player seek to maximize his points so we have to find the final score or end game.
Methods to solve:
1- The game has a saddle point ‫( نقطة تعادل‬Pure or fair Strategy)
2- The game has no saddle point ‫( ال يوجد نقطة تعادل‬mixed strategy)
a. Matrix level 2 * 2  Probabilities, Matrices Method
b. Matrix Level 2 * 3 or 3 *2  subgames method ‫مبارايات فرعية‬
c. Matrix Level 2 * M or M * 2  Dominance ‫مبدأ السيادة أو السيطرة‬
M>3
Example 1: B
5 9 2 8
A [18 7 5 6]
10 −4 3 7 3×4
Solution
First, check saddle point:
MinMax = MaxMin

Min Max
5 9 2 8 2 -
[18 7 5 6] 5 5
10 −4 3 7 3×4 -4 -
Max 18 9 5 8
Min - - 5 -

There is a saddle point in the match, which is 5 and this is a Pure Strategy
When the player A choose second strategy and player B choose third strategy then the end
game will be a 5 points gain for player A.

Example 2:
B
−3 9
A [ ]
6 5
Solution
First, check saddle point
Min Max
−3 9 -3 -
[ ]
6 5 5 5
Max 6 9
Min 6 -

No saddle point here because MinMax ≠ MaxMin, so we will choose either to solve the game
using:
1. Probabilities
L 1-L
K 9 −3
[ ]
1-K 5 6
K probability that player A choose first strategy
1 - K  probability that player A choose second strategy
L  probability that player B choose first Strategy, 1 - L  probability of second strategy
9K + 5 (1 - K) = -3K + 6 (1 - K)
9K + 5 – 5K = -3K + 6 – 6K
9K – 5K + 3K + 6K = 6 -5
1 1 12
13K = 1  K = , and 1 – K = 1 - =
13 13 13
1
The probability that player A choose first strategy is and the probability of second strategy
13
12
is
13

9L – 3 (1 - L) = 5L + 6 (1 - L)
9L – 3 + 3L = 5L + 6 – 6L
9L + 3L – 5L + 6L = 6 + 3
9 9 4
13L = 9  L = , and 1 – L = 1 - =
13 13 13
9
The probability that player B choose first strategy is and the probability of second strategy
13
4
is
13

End Game = 9KL – 3K (1 - L) + 5 (1 - K) L + 6 (1 - K) (1 - L)


1 9 1 4 12 9 12 4 69
=9* * –3* * +5* * +6* * =
13 13 13 13 13 13 13 13 13
69 69
End game is a gain for player A with points and a loss for player B by points.
13 13

2. Matrices Method
First, we will calculate delta (∆)
∆ = multiply elements of main diagonal – multiply elements of second diagonal
‫المحدد = حاصل ضرب عناصر القطر الرئيسي – حاصل ضرب عناصر القطر الفرعي‬
∆ = 9 * 6 – (-3 * 5) = 69
Second, calculate the rotation of matrix ‫مدور المصفوفة‬

6 3
Rotation matrix = [ ]
−5 9
.‫مدور المصفوفة = استبدال عناصر القطر الرئيسي مع عكس اشارات عناصر القطر الفرعي‬
Third, calculate the rotation of rotated matrix ‫مدور المصفوفة أو مصفوفة المرافقات‬

6 −5
Rotation of Rotated Matrix (Attachments Matrix) =[ ]
3 9
.‫مدور المدور (مصفوفة المرافقات) = تحويل الصف الي عمود والعمود الي صف‬
Probabilities of Row Player (Player A):
6 3
[1 1] 𝑟𝑜𝑡𝑎𝑡𝑖𝑜𝑛 𝑚𝑎𝑡𝑟𝑖𝑥 [1 1] [ ] [1 12]
−5 9
= 1 = 6 −5 1 =
[1 1] 𝐴𝑡𝑡𝑎𝑐ℎ𝑚𝑒𝑛𝑡𝑠 𝑀𝑎𝑡𝑟𝑖𝑥 [ ] [1 1] [ ][ ] 13
1 3 9 1
1 12
K= , 1–K=
13 13

Probabilities of Column Player (Player B):


[1 6 −5
[1 1] 𝑎𝑡𝑡𝑎𝑐ℎ𝑚𝑒𝑛𝑡 𝑚𝑎𝑡𝑟𝑖𝑥 1] [ ] [9 4]
3 9
= 1 = 6 −5 1 =
[1 1] 𝐴𝑡𝑡𝑎𝑐ℎ𝑚𝑒𝑛𝑡𝑠 𝑀𝑎𝑡𝑟𝑖𝑥 [ ] [1 1] [ ][ ] 13
1 3 9 1
9 4
L= , 1–L=
13 13

𝑑𝑒𝑙𝑎𝑡𝑎 ∆ 69 69
End Game = 1 = 6 −5 1 =
[1 1] 𝐴𝑡𝑡𝑎𝑐ℎ𝑚𝑒𝑛𝑡𝑠 𝑀𝑎𝑡𝑟𝑖𝑥 [ ] [1 1] [ ][ ] 13
1 3 9 1

Hack for this:

𝒂 𝒃
[ ]
𝒄 𝒅
𝒅−𝒄
K = (𝒂+𝒅)−(𝒃+𝒄)
𝒅−𝒃
L = (𝒂+𝒅)−(𝒃+𝒄)
𝒂𝒅 − 𝒃𝒄
End Game = (𝒂+𝒅)−(𝒃+𝒄)
Example 3:
1 3 7
[ ]
2 5 −6
Solution
First, check saddle point:
Min Max
1 3 7 1 1
[ ] -6 -
2 5 −6
Max 2 5 7
Min 2 - -

No saddle point and the matrix level is 2 * 3, so we will use subgames method.
First, divide the matrix into 3 submatrices of 2*2 level:
1 3 1 7 3 7
[ ] [ ] [ ]
2 5 2 −6 5 −6
Then we will solve each matrix as a separated game and check saddle point in each matrix.
Min Max
1 3 1 -
[ ]
2 5 2 2
Max 2 5
Min 2 -

In this subgame, there is a saddle point, which is 2 so the end game will be a gain for player
A by 2 points and a loss for player B by 2 points.

2) Second Subgame
Min Max
1 7 1 1
[ ]
2 −6 -6 -
Max 2 7
Min 2 -

No saddle point, so we will solve it using either probabilities or matrices method.


4 3
K= , 1–K=
7 7
13 1
L= , 1–L=
14 14
7
End Game =  gain for player A
10
3) Third subgame (solve it by yourself)

Example 4:
−2 −4
[3 2]
2 3
6 −1
This matrix of level 4 * 2, so we will first check saddle point and if no saddle point we then
use dominance method to solve it.

First, check saddle point


Min Max
−2 −4 -4 -
[3 2] 2 2
2 3 2 2
6 −1 -1 -
Max 6 3
Min - 3

No saddle point here, so we will use dominance method


- Check which we will reduce (rows or columns)
o If we will reduce rows, we will remove the row that contain smallest numbers
(negative)
o If we will reduce columns, we will remove the column that contain largest
numbers (positive)
- After reducing a row or a column will must check saddle point and then continue
- We will continue in reducing the matrix until we have 2*3 or 3*2 matrix or we reach a
saddle point.
In our example, we will reduce the number of rows:
−2 −4
3 2
[ 3 2 ] → [2 3 ]
2 3
6 −1
6 −1
We remove the first row, because it contains lowest numbers (losses for player A), then we
should check saddle point.
Min Max
3 2 2 2
[2 3 ] 2 2
6 −1 -1 -
Max 6 3
Min - 3

No Saddle point, so we will solve the matrix using Subgames method.


3 2 3 2 2 3
[ ][ ][ ]
2 3 6 −1 6 −1
Then we will check saddle point for each of these subgames, and then solve each matrix
alone.

Finished 
Operations Research
Lecture 7
Transportation Problem
Improvement
Transportation Problem: Improvement
As we learnt, there are many types of solutions but the one that we concern about is optimal
solution.
How to find optimal solution in transportation problem:
1. Solve the problem using any method (north-west, lowest cost, Vogel)
2. Check this condition:
Number of filled cells must equal to N + M – 1
N -> number of rows
M -> number of columns
3. Check the optimality by calculating the path cost of the non-basic cells.
4. If all path costs are positive, so this is an optimal solution, otherwise you have to make
an improvement.
Example:

W1 W2 W3 W4 Supply

F1 (19) (30) (50) (10) 7

F2 (70) (30) (40) (60) 9

F3 (40) (8) (70) (20) 18

Demand 5 8 7 14 34

First, we will solve this problem using:


North-west corner:
W1 W2 W3 W4 Supply

F1 5 (19) 2 (30) (50) (10) 72

F2 (70) 6 (30) 3 (40) (60) 9 3

F3 (40) (8) 4 (70) 14 (20) 18

Demand 5 8 7 14 34

This solution is:


X11 = 5, X12 = 2, X22 = 6, X23 = 3, X33 = 4, X34 = 14
Total cost = $1,015

Then we will solve same example using Lowest cost Method.


Lowest Cost:
W1 W2 W3 W4 Supply

F1 (19) (30) (50) 7 (10) 7

F2 2 (70) (30) 7 (40) (60) 92

F3 3 (40) 8 (8) (70) 7 (20) 18 10 3

Demand 5 8 7 14 7 34

This solution is:


X14 = 7, X21 = 2, X23 = 7, X31 = 3, X32 = 8, X34 = 7
Total Cost = $814

Vogel’s Approximation Method (VAM):


Penalty
W1 W2 W3 W4 Supply
D1 D2 D3

F1 5 (19) (30) (50) 2 (10) 72 9 9 3

F2 (70) (30) 7 (40) 2 (60) 97 10 20 20

F3 (40) 8 (8) (70) 10 (20) 18 10 12 20 50

Demand 5 8 7 14 4 34

D1 21 22 10 10

D2 21 -- 10 10

D3 -- -- 10 10

This solution is:


X11 = 5, X14 = 2, X23 = 7, X24 = 2, X32 = 8, X34 = 10
Total Cost = $779
As we see, Vogel’s method gives the lowest cost of transportation, but if we need to check
whether this solution is the optimal solution or not we will do the following:
We will improve the solution based on north-west method
First, check the condition:
Filled cells = 6
N+M–1= 3+4–1=6
So, Filled cells = N + M – 1 = 6
Second, calculate path cost for each of non-filled cells (non-basic cells).
Path conditions:
 Start point must be endpoint
 Must stop on filled cells only
 Must move horizontally or vertically
 You can change the direction (horizontally or vertically) on filled cells
 Start with +

W1 W2 W3 W4

F1 5 (19) 2 (30) (50) (10)

F2 (70) 6 (30) - +3 (40) (60)

F3 (40) (8) + - 4 (70) 14 (20)

Non-basic cells Path cost

X13 + X13 – X21 + X22 – X23 10

X14 + X14 – X34 + X33 – X23 + X22 – X21 20

X21 + X21 – X22 + X12 – X11 51

X24 + X24 – X23 + X33 – X34 70

X31 + X31 – X33 + X23 – X22 + X12 – X11 -9

X32 + X32 – X33 + X23 – X22 -52

As the cost row have negative values, so we should improve the solution and determine the
incoming cell and outgoing cell.
Incoming cell (is the cell with highest negative value) = -52 (X32)
 Determine the outgoing cell using the path of the incoming cell:
Path  + X32 – X33 + X23 – X22
 Choose the negative only:
X33 and X22
 Choose the cell with highest cost, which is X33 = 70
 Go to the path and add 4 (amount) to cell with + sign and deduct 4 from cell with – sign.

X32 = 0 + 4 = 4
X22 = 6 – 4 = 2
X23 = 3 + 4 = 7
X33 = 4 – 4 = 0
Therefore, the improved solution will be as follows:

W1 W2 W3 W4

F1 5 (19) 2 (30) (50) (10)

F2 (70) 2 (30) 7 (40) (60)

F3 (40) 4 (8) (70) 14 (20)

Note: the outgoing cell (X33) will not be included when we calculate the path and improve
this solution

Total cost (before improvement) = 1,015


Total cost (after improvement) = 807
Difference 208

Difference = incoming cell cost (from path) * outgoing cell quantity


= 52 * 4 = 208
We will repeat the steps until reach the optimal solution, to find optimal solution easily you
should improve based on Vogel’s method.

Finished 

You might also like