Lec 04 - Week 04 Operations Research
Lec 04 - Week 04 Operations Research
Lec 04 - Week 04 Operations Research
IS 231
Operation Research
Dr. Yasser ALHABIBI
E-mail: [email protected]
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
Graphical Solution
The graphical solution includes two basic
steps:
1.The determination of the solution space
that defines the feasible solutions that
satisfy all the constraints.
2.The determination of the optimum
solution from among all the points in the
feasible solution space.
9
Terminology for Solutions of the Model
A Solution
Any specification of values for the decision
variables (x1, x2, . . . , x2) is called a solution,
regardless of whether it is a desirable or even an
allowable choice.
Different types of solutions are then identified by
using an appropriate adjective.
Feasible Solution
is a solution for which all the constraints are
satisfied.
Infeasible Solution
is a solution for which at least one constraint is
violated. 1
Terminology for Solutions of the Model
The Feasible Region (Domain)
is the collection of all feasible solutions.
Optimal Solution
is a feasible solution that has the most favorable
value of the objective function. The most
favorable value is the largest value if the
objective function is to be maximized, whereas it
is the smallest value if the objective function is to
be minimized.
A Corner-Point Feasible (CPF) Solution
(Extreme Points or Vertices)
is a solution that lies at a corner of the feasible
region. 1
Terminology for Solutions of the Model
Objective function :
M in Z c1x 1 c 2 x 2 c 3x 3 ... c n x n
0 2 4
x1
14
Graphical Solution of LPs
Constraints
2X1 + X2 =4
X1 + 2 X2 =4
Objective Function: Max Z = X1 + X2 1
c
1
x2 1 1 3
x *
,
1 1
3
4 1 1 3
z *
c T
x *
(1 1) 2 23
1 1 3
Is a feasible
2 * optimal solution
x
Feasible
Domain
0 2 x1
4
15
Example 2
Solve the following LPP: Max Z = 120 X1 + 100 X2
subject to
X 1 + X2 ≤4
5 X1 + 3 X2 ≤15
x2 and
X1 ≥ 0, X2 ≥ 0.
2
5 S is " feasible solution "
direction of 1
max. increase
4 of objective 3/ 2
S is " feasible optimal solution "
5 / 2
.
(3\2, 5\2)
3 / 2
Z c T x (120 100) 430.
Feasible 5 / 2
Domain
0 3 4
x1
16
Example 3: Infeasible Solution
Solve the following LPP:
Max Z = 2 X1 + 5 X2
subject to
2 X1 + 3 X2 ≥ 12
3 X1+ 4X2 ≤ 12
x2 and
X1 ≥ 0, X2 ≥ 0.
S=Ф
2
x1
0 2 4 4 6
Infeasible Solution=Ф
17
Example 4: Non-existing or Infeasible Solution
Solve the following LPP:
Maximize Z= 3 X1 +2 X2
S.T 2 X1 + X2 ≤ 2
3 X1 +4 X2 ≥ 12
and X1, X2 ≥ 0
Non-existing or Infeasible
Solution
If the constraints are not satisfied
simultaneously, the model has no
feasible solution. This situation
can never occur if all the
constraints are of the type ≤
(assuming non-negative R.H.S
constraints) because the slacks
provide a feasible solution.
18
Example 5: Unbounded Solution
Max Z = 2 X1 + 5 X2
Solve the following LPP: subject to
-3 X1 + 2 X2 ≤ 6
X1 + 2X2 ≥ 2
and
x2 X1 ≥ 0, X2 ≥ 0.
x1
0 2 4 4 6
S is unbounded Solution
19
Example 6: Unbounded Solution
Solve the following L.P.P.:
Max Z = 2 X1 + X2
subject to
X1 - X2 ≤ 10
2 X1 ≤ 40
and
X1 ≥ 0, X2 ≥ 0.
S is unbounded Solution
In which the objective
function (Z) can be increased
indefinitely without violating
any of the constraints i.e.;
the solution space is
unbounded in at least one
direction.
20
Example 7: Alternative optima (Infinity of Solution)
Solve the following L.P.P.:
Maximize Z= 2 X1 + 4 X2
subject to
X1 + 2 X2 ≤5
X1 + X2 ≤4
and
X1 , X2 ≥0
When the objective function is
parallel to a binding constraint. So
the objective function (Z) will have
the same optimal value at more
than one solution point. LP Alternative optima
First Optimum Solution: X1=0, X2=5/2, Z=10
Second Optimum Solution: X1=3, X2=1, Z*=10
The general form: X1 = α (0) + (1-α) (3) = 3-3α
X2 = α (5/2) + (1-α) (1) = 1+3/2α
21
Example 8: The Diet Problem
A nutritionist is planning a menu consisting of two main foods A and B.
Each ounce of A contains 2 units of fat, 1 unit of carbohydrates, and 4
units of protein. Each ounce of B contains 3 units of fat, 3 unit of
carbohydrates, and 3 units of protein. The nutritionist wants the meal to
provide at least 18 units of fat, 12 unit of carbohydrates, and 24 units of
protein. If an ounce of A costs 20 cents and an ounce of B costs 25
cents, how many ounces of each food should be served to minimize the
cost of the meal yet satisfy the nutritionist's requirements?
Solution
Table: Summery Data for the example
22
The Diet Problem Linear Programming Model
a- Decision Variables:
Let x be the number of ounces of food A,
y be the number of ounces of food B.
b- Objective function:
Cost of menu Z= 20x + 25y
c- Constraints:
Fats: 2x + 3y ≥ 18
Carbohydrates: x + 3y ≥ 12
Proteins: 4x + 3y ≥ 24
Mathematical Model
Minimize Z = 20x + 25y
Subject to 2x + 3y ≥ 18
x + 3y ≥ 12
4x + 3y ≥ 24
and
x, y ≥ 0
23
Minimize Z = 20x + 25y
Subject to 2x + 3y ≥ 18
x + 3y ≥ 12
4x + 3y ≥ 24
and
x, y ≥ 0
Graphical solution
A
8
6
4 B
2 C
0 2 4 6 8 10 D12
Optimal solution
Minimum Cost = 160 cents at x = 3 Ounces & y = 4 Ounces (point B)
24
Example 9: The Diet Mix Problem
Farm uses at least 800lb of special feed daily. The special feed is a
mixture of corn and soybean with the following composition.
The food mixture must contain at least 30% protein and at most 5% fiber.
They want to determine the daily minimum cost feed mix.
Problem Formulation
Decision variables
X1= lb of corn in the daily mix.
X2= lb of soybean in the daily mix.
Objective Function
Minimize Z= 0.3 X1 + 0.9 X2
Constraints
X1 + X2 ≥ 800
0.09X1+0.6 X2 ≥ 0.3(X1+X2) = -0.21X1+0.3 X2 ≥0
0.02X1+0.06 X2 ≤ 0.05(X1+X2) = 0.03X1-0.01 X2 ≥ 0
Graphical solution of the diet model
Example 10: A Blending Problem
A manufacturer of artificial sweetener blends 14 kilograms of saccharin
and 18 kilograms of dextrose to prepare two new products: Sweet and
Low-Sugar. Each kilogram of Sweet contains 0.4 kilograms of dextrose
and 0.2 kilograms of saccharin, while each kilogram of Low-Sugar
contains 0.3 kilograms of dextrose and 0.4 kilograms of saccharin. If the
profit on each kilogram of Sweet is 20 cents and the profit on each
kilogram of Low-Sugar is 30 cents, how many kilograms of each product
should be made to maximize the profit?
Solution
Table: Summery Data for the example
27
A Blending Problem Linear
Programming Model
a- Variables:
Let x be the number of Kg.’s of Sweet,
y be the number of Kg.’s of Low-sugar
b- Objective function:
Profit of each Kg Z = 20x + 30y
c- Constraints:
Saccharin Qty: 0.2x + 0.4y ≤ 14
Dextrose Qty: 0.4x + 0.3y ≤ 18
Mathematical Model:
28
Maximize P = 20x + 30y
Subject to 0.2x + 0.4y ≤ 14
0.4x + 0.3y ≤ 18
x, y ≥ 0
Graphical solution:
80
60
40
B
20 C
A 10 20 30 40 D50 60 70
Optimal solution:
Max. Profit = 1200 $ at x = 30 Kg & y = 20 Kg (Point C)
29
Example 11: The Reddy Mikks Company
Reddy Mikks produces both interior and exterior paints from two raw
materials, M1 & M2. The following table provides the basic data of the
problem.
A market survey indicates that the daily demand for interior paint
cannot exceed that of exterior paint by more than 1 ton. Also, the
maximum daily demand of interior paint is 2 ton.
31
.
32
To determine the direction in which the profit function increases we assign
arbitrary increasing values of 10 and 15
5 X1 + 4 X2=10
and 5 X1 + 4 X2=15
The optimum solution is mixture of 3 tons of exterior and 1.5 tons of interior
paints will yield a daily profit of 21000$.
33
Example 12: A small generator
A small generator burns two types of fuel: Low sulfur (L) and High
sulfur (H) to produce electricity. For each hour of use, each gallon of L
emits 3 units of sulfur dioxide, generates 4 Kilowatts and costs 60 cents,
while each gallon of H emits 5 units of sulfur dioxide, generates 4
Kilowatts and costs 50 cents. The environmental protection agency
insists that the maximum amount of sulfur dioxide that can be emitted
per hour is 15 units. Suppose that at least 16 Kilowatts must be
generated per hour.
How many gallons of L and how many gallons of H should be used
hourly to minimize the cost of the fuel used?
Solution
Table: Summery Data for the example
Fuel Type sulfur dioxide Generation Costs
gallon(( units(( (KW) )cents(
Low sulfur (L) 3 4 60
High sulfur (H) 5 4 50
Requirement At most 15 At Least 16
units
34
A small generator Formulation as a Linear
Programming Model
a. Decision Variables
Let x be the number of gallons of L used hourly,
y be the number of gallons of H used hourly
b. Objective function:
Cost of fuel used
Z = 60x + 50y
c. Constraints
Environment protection: 3x + 5y ≤ 15
Power generated: 4x + 4y ≥ 16
Mathematical Model
Minimize Z = 60x + 50y
Subject to 3x + 5y ≤ 15
4x + 4y ≥ 16
and
x, y ≥ 0
35
A small generator Graphical solutions
2- Graphical solution
The problem has only 2 decision variables = only two dimensions, so a
graphical procedure can be used to solve it.
4
3
2 A
1
B C
1 2 3 4 5
3- Optimal solution
Minimum Cost = 225 cents at x = 2.5 G and y = 1.5 G (point c)
36
Example 13: A manufacturing firm
A manufacturing firm produces two machine parts using lathes, milling
machines and grinding machines as given in the following table:
Machining time required for the machine part
(minutes) Maximum time available
Type of machine
per week (minutes)
I II
Lathes 10 5 2500
Milling machines 4 10 2000
Grinding machines 1 1.5 450
Profit per unit 50 100
39
40
Example 15
Maximize Z= 20 ( x - 50) + 38 ( y – 20)
Solve the following LPP
Subject to x + 2 y ≤ 200
x≥ 50 , 20 ≤ y ≤ 90
and
x, y ≥ 0
- Graphical solution:
150
100 B
50
A C
50 100 150 200
- Optimal solution
X= 160 , y = 20 ---- Z = 2200 at C
41
Example 16: Product Mix Problem
The N.G. company produces two products: I and II. The Raw material
requirements, space needed for storage, production rates, and selling
prices for these products are given in the following table.
42
43
44
45
46
Example 17: A Transport Company
Min Z= f(x, y) = 30 x + 40 y
Subject to 20x+30y ≥ 3000 (1)
40x+30y ≥ 4000 (2)
and x≥0,y ≥0. (3)
47
48
49
Example 18: The WYNDOR GLASS CO.
The WYNDOR GLASS CO. produces high-quality glass products, including
windows and glass doors. It has three plants.
Plant 1: Produce Aluminum frames and hardware,
Plant 2: Produce wood frames,
Plant 3: produces the glass and assembles the products.
Because of declining earnings, top management has decided to revise the
company’s product line as following:
Unprofitable products are being discontinued, Saved production capacity will
be used to launch two new products having large sales potential:
Product 1: An 8-foot glass door with aluminum framing
Product 2: A 4 6 foot double-hung wood-framed window
Product 1: requires some of the production capacity in Plants 1 and 3, but
none in Plant 2.
Product 2: needs only Plants 2 and 3.
The marketing division has concluded that the company could sell as much of
either product as could be produced by these plants.
However, because both products would be competing for the same
production capacity in Plant 3, it is not clear which mix of the two products
would be most profitable. Therefore, an OR team has been formed to study
this question. 50
The WYNDOR GLASS CO.
The OR team began by having discussions with upper management to identify
management’s objectives for the study. These discussions led to developing
the following definition of the problem:
Determine what the production rates should be for the two products in order
to maximize their total profit, subject to the restrictions imposed by the
limited production capacities available in the three plants. (Each product will
be produced in batches of 20, so the production rate is defined as the number
of batches produced per week.) Any combination of production rates that
satisfies these restrictions is permitted, including producing none of one
product and as much as possible of the other.
The OR team also identified the data that needed to be gathered:
1. Number of hours of production time available per week in each plant for
these new products. (Most of the time in these plants already is committed to
current products, so the available capacity for the new products is quite
limited.)
2. Number of hours of production time used in each plant for each batch
produced of each new product.
3. Profit per batch produced of each new product.
Table 1 summarizes the data gathered.
51
Formulation as a Linear Programming
Problem
To formulate the mathematical (linear
programming) model for this problem.
let
X1 Number of batches of product 1 produced
per week
X2 Number of batches of product 2 produced
per week
Z Total profit per week (in thousands of Each product will be produced in batches of
dollars) from producing these two products 20, so the production rate is defined as the
Thus, X1 and X2 are the decision variables for number of batches produced per week.)
the model.
Using the bottom row of Table 1, we obtain
Z = 3 X1 + 5 X2.
In the mathematical language of linear programming, the problem is to choose
values of X1 and X2 so as to
Maximize Z = 3 X1 + 5 X2.
subject to the restrictions
X1 ≤4
2 X2 ≤ 12
3 X1 + 2 X2 ≤18
and
52
53
54
55
56