0% found this document useful (0 votes)
31 views

Lec 2 - Linear Programming Graphical Solution

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Lec 2 - Linear Programming Graphical Solution

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Operations Research

Prepared By
Dr/Marwa Yahya
Objectives
At the end of this lesson the student should be able to
❑Define the following definitions:
- Feasible region.
- Feasible solution.
- Optimal solution.
❑Solve the linear programming problem graphically.
According to the video on the link below
https://www.youtube.com/watch?v=NncBeSG
kyu8
Answer the following question
What is the difference between feasible
region, feasible solution, and optimal
solution?
General Description of Linear
Programming Problem

A linear programming problem is one that


is concerned with finding the optimal
value (maximum or minimum value) of a
linear Objective Function 𝒁 of the term.
𝒁 = 𝒂𝒙𝟏 + 𝒃𝒙𝟐
The set of points satisfying both the
problem constraints and the non-negative
constraints is called feasible region for the
problem. Any point in the feasible region
that produces the optimal value of the
objective function over the feasible region
is called an optimal solution.
Example (1)
A company makes two products A and B; both
require processing on 2 machines. Product A takes
10 and 15 minutes on the two machines per unit
and product B takes 22 and 18 minutes per unit on
the two machines. The machines are available for
2640 and 2500 minutes respectively per week. The
products are sold for $200 and $175 respectively
per unit. Formulate the linear programming
problem to maximize sales revenue?
Solution
Let 𝒙𝟏 : the number of units of product A
𝒙𝟐 : the number of units of product B

A B Availability
M1 10 22 2640
M2 15 18 2500
Profits 200 175
𝑴𝒂𝒙 𝒁 = 𝟐𝟎𝟎𝒙𝟏 + 𝟏𝟕𝟓𝒙𝟐
Subject to
𝟏𝟎𝒙𝟏 + 𝟐𝟐𝒙𝟐 ≤ 𝟐𝟔𝟒𝟎
𝟏𝟓𝒙𝟏 + 𝟏𝟖𝒙𝟐 ≤ 𝟐𝟓𝟎𝟎
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Graphical Solution

𝟏𝟎𝐱 𝟏 + 𝟐𝟐𝐱 𝟐 = 𝟐𝟔𝟒𝟎 𝟏𝟓𝐱 𝟏 + 𝟏𝟖𝐱 𝟐 = 𝟐𝟓𝟎𝟎

𝐱𝟏 𝐱𝟐 𝐱𝟏 𝐱𝟐

0 2640/22=120 0 2500/18=138.9

2640/10=264 0 2500/15=166.7 0
140

120

100

80

60

40

20

0
0 50 100 150 200 250 300

𝟏𝟎𝐱1+𝟐𝟐𝐱2 = 𝟐𝟔𝟒𝟎
160

140

120

100

80

60 15x1 + 18x2 = 2500


10x1 + 22 x2 = 2640

40

20

0
0 50 100 150 200 250 300

10x1+22x2=2640 15x1+18x2=2500
160

140

D
120

100 C
80

60 15x1 + 18x2 = 2500


10x1 + 22 x2 = 2640

40

20

0 B
A
0 50 100

10x1+22x2=2640
150

15x1+18x2=2500
200 250 300
160

140

D
120

100 C
80

60 15x1 + 18x2 = 2500


10x1 + 22 x2 = 2640

40
Feasible
20
Region

0 B
A
0 50 100

10x1+22x2=2640
150

15x1+18x2=2500
200 250 300
160

140

D(0,120)
120

C(49.91,97.3)
100

80

60
Feasible
40 Region
20

B(166.7,0)
0
0 15 30 45 60 75 90 105 120 135 150 165 180 195 210 225 240 255 270 285
A(0,0) 10x1+22x2=2640 15x1+18x2=2500
To find C
𝟏𝟎𝒙𝟏 + 𝟐𝟐𝒙𝟐 = 𝟐𝟔𝟒𝟎 *15
𝟏𝟓𝒙𝟏 + 𝟏𝟖𝒙𝟐 = 𝟐𝟓𝟎𝟎 *(-10)
𝟏𝟓𝟎𝒙𝟏 + 𝟑𝟑𝟎𝒙𝟐 = 𝟑𝟗𝟔𝟎𝟎
−𝟏𝟓𝟎𝒙𝟏 − 𝟏𝟖𝟎𝒙𝟐 = −𝟐𝟓𝟎𝟎𝟎
𝟏𝟓𝟎𝒙𝟐 = 𝟏𝟒𝟔𝟎𝟎,
𝒙𝟐 = 𝟗𝟕. 𝟑, 𝒙𝟏 = 𝟒𝟗. 𝟗𝟒
Corner Point 𝑴𝒂𝒙 𝒁 = 𝟐𝟎𝟎𝒙𝟏 + 𝟏𝟕𝟓𝒙𝟐

A(0,0) 𝒁 = 𝟐𝟎𝟎 𝟎 + 𝟏𝟕𝟓 𝟎 = 𝟎

𝒁 = 𝟐𝟎𝟎 𝟏𝟔𝟔. 𝟕 + 𝟏𝟕𝟓 𝟎 = $𝟑𝟑𝟑𝟒𝟎


B(166.7,0)
(Optimal Solution)
𝒁 = 𝟐𝟎𝟎 𝟒𝟗. 𝟗𝟏 + 𝟏𝟕𝟓 𝟗𝟕. 𝟑
C(49.91,97.3)
= $𝟐𝟕𝟎15. 𝟓

D(0,120) 𝒁 = 𝟐𝟎𝟎 𝟎 + 𝟏𝟕𝟓 𝟏𝟐𝟎 = $𝟐𝟏𝟎𝟎𝟎


To make the most revenue, the
company should make 166.7 units
of product A and zero units of
product B.
Example (2)
Jay is trying to expand his pastry business to
include cupcakes and personal cakes. He has 40
hours to decorate the new items and can use no
more than 22 grams of cake mix. Each personal
cake requires 2 grams of cake mix and 2 hours to
decorate. Each cupcake order requires one gram
of cake mix and 4 hours to decorate. If he can
sell each personal cake for $ 20 and each
cupcake order for $ 25. Formulate the linear
programming problem.
Solution
x1:the number of cupcake orders.
x2:the number of personal cakes.

Cupcakes Personal cake Availability


Cake mix 1 2 22
# of hours 4 2 40
Profits $25 $20

𝒎𝒂𝒙𝒁 = 𝟐𝟓𝒙𝟏 + 𝟐𝟎𝒙𝟐


Subject to
𝒙𝟏 + 𝟐𝒙𝟐 ≤ 𝟐𝟐
𝟒𝒙𝟏 + 𝟐𝒙𝟐 ≤ 𝟒𝟎
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Graphical Solution

𝒙𝟏 + 𝟐𝒙𝟐 = 𝟐𝟐 𝟒𝒙𝟏 + 𝟐𝒙𝟐 = 𝟒𝟎

𝒙𝟏 𝒙𝟐 𝒙𝟏 𝒙𝟐
0 11 0 20
22 0 10 0
25

20

15

10
X1 + 2x2 = 22

0
0 5 10 15
25

20

15

x1+2x2=22
4x1+2x2=40

10

x1+2x2 = 22

4x1+2x2 = 40
0
0 5 10 15 20 25
25

20

15

D(0,11) x1+2x2=22
4x1+2x2=40
10

C(6,8)

5 Feasible
region

B(10,0)
0
0 5 10 15 20 25
A(0,0)
To find C
𝒙𝟏 + 𝟐𝒙𝟐 = 𝟐𝟐 *(-1)

𝟒𝒙𝟏 + 𝟐𝒙𝟐 = 𝟒𝟎

𝟑𝒙𝟏 = 𝟏𝟖, 𝒙𝟏 = 𝟔, 𝒙𝟐 = 𝟖

Points 𝐦𝐚𝐱𝐙 = 𝟐𝟓𝐱𝟏 + 𝟐𝟎𝐱𝟐


A(0,0) 𝐙 = 𝟐𝟓 𝟎 + 𝟐𝟎 𝟎 = 𝟎
B(10,0) 𝐙 = 𝟐𝟓 𝟏𝟎 + 𝟐𝟎 𝟎 = $𝟐𝟓𝟎
𝐙 = 𝟐𝟓 𝟔 + 𝟐𝟎 𝟖 = $𝟑𝟏𝟎
C(6,8)
(Optimal Solution)
D(0,11) 𝐙 = 𝟐𝟓 𝟎 + 𝟐𝟎 𝟏𝟏 = $𝟐𝟐𝟎
To make the most revenue, Jay
should make 8 personal cakes and 6
cupcake orders.
Example (5)
A diet is to contain at least 16 units of
carbohydrates and 20 units of protein. Food A
contains 2 units of carbohydrates and 4 of protein;
food B contains 2 units of carbohydrates and 1 of
protein. If food A costs $1.20 per unit and food B
costs $0.80 per unit. Formulate the linear
programming problem
Solution
𝒙𝟏 = # 𝒐𝒇 𝒖𝒏𝒊𝒕𝒔 𝒐𝒇 𝒇𝒐𝒐𝒅 𝑨 𝒑𝒖𝒓𝒄𝒉𝒂𝒔𝒆𝒅.
𝒙𝟐 = # 𝒐𝒇 𝒖𝒏𝒊𝒕𝒔 𝒐𝒇 𝒇𝒐𝒐𝒅 𝑩 𝒑𝒖𝒓𝒄𝒉𝒂𝒔𝒆𝒅

Solution
𝑴𝒊𝒏 𝒁 = 𝟏. 𝟐𝟎𝒙𝟏 + 𝟎. 𝟖𝟎𝒙𝟐
subject
𝟐𝒙𝟏 + 𝟐𝒙𝟐 ≥ 𝟏𝟔
4𝒙𝟏 + 𝒙𝟐 ≥ 𝟐𝟎
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Graphical Solution

𝟐𝒙𝟏 + 𝟐𝒙𝟐 = 𝟏𝟔 4𝒙𝟏 + 𝒙𝟐 = 𝟐𝟎

𝒙𝟏 𝒙𝟐 𝒙𝟏 𝒙𝟐

0 8 0 20

8 0 5 0
9

2x1+2x2=16
4

0
0 1 2 3 4 5 6 7 8 9
25

20

15

4x1+x2=20
2x1+2x2=16
10

0
0 1 2 3 4 5 6 7 8 9
25

20 A(0,20)

15

4x1+x2=20
2x1+2x2=16
10

5
B(4,4)

C(8,0)
0
0 1 2 3 4 5 6 7 8 9
25

20 A(0,20)

15 Feasible Region
4x1+x2=20
2x1+2x2=16
10

5
B(4,4)

C(8,0)
0
0 1 2 3 4 5 6 7 8 9
To find B

𝟐𝒙𝟏 + 𝟐𝒙𝟐 = 𝟏𝟔
𝟒𝒙𝟏 + 𝒙𝟐 = 𝟐𝟎 *(-2)
𝟐𝒙𝟏 + 𝟐𝒙𝟐 = 𝟏𝟔
−𝟖𝒙𝟏 − 𝟐𝒙𝟐 = −𝟒𝟎
−𝟔𝒙𝟏 = −𝟐𝟒, 𝒙𝟏 = 𝟒, 𝒙𝟐 = 𝟒
Points 𝑴𝒊𝒏 𝒁 = 𝟏. 𝟐𝟎𝒙𝟏 + 𝟎. 𝟖𝟎𝒙𝟐
A(0,20) 𝒁 = 𝟏. 𝟐𝟎 𝟎 + 𝟎. 𝟖𝟎 𝟐𝟎 = 𝟏𝟔
𝒁 = 𝟏. 𝟐𝟎 𝟒 + 𝟎. 𝟖𝟎 𝟒 = 𝟖
B(4,4) (Optimal Solution)

C(8,0) 𝒁 = 𝟏. 𝟐𝟎 𝟖 + 𝟎. 𝟖𝟎 𝟎 = 𝟗. 𝟔

To get the minimum cost of $ 8, the minimum


requirements for protein and carbohydrates
is 4 units each
25

20 A(0,20)

15
Feasible Region
4x1+x2=20
2x1+2x2=16
10

5
B(4,4)

C(8,0)
0
0 1 2 3 4 5 6 7 8 9
Summary
The region determined by all the
constraints of a given linear
programming problem is called
feasible region and every point in the
feasible region is called the
feasible solution. Any point in the
feasible region that produces the
optimal value of the objective function
over the feasible region is called an
optimal solution
Procedure: Geometric Method for Solving Linear
Programming Problem with Two Variables

Step 1: Graph the feasible region. Then, if an optimal solution


exists find the coordinates of each corner point.

Step 2: Construct a corner point table listing the value of the


objective function at each corner point.

Step 3: Determine the optimal solution (s) from the table in


Step 2.

Step 4: for an applied problem, interpret the optimal solution


(s) in terms of the original problem.
THANK You

You might also like