You are on page 1of 21

LINEAR PROGRAMMING

Graphical – Lec.3
2

INTRODUCTION

What is optimal solution?

Optimal solution is the maximum or minimum value of an objective function.

How to solve a linear programming problem?

The problem have two variables can be solved graphically.

Dr.Noha Beshir
3

EXAMPLE 1
• Maximize z = 50 x + 18 y
• Subject to constraints
• 2 x + y ≤ 100
• x + y ≤ 80
• Non negativity
• x,y≥0
• To solve such a problem graphically, you have to use quadrant plan.

Dr.Noha Beshir
4

As a decision variables in a
linear programming problems
should satisfy the nonnegativity
constraints so
X≥0
Y≥0
That means they will lay on the
first quadrant only.

Dr.Noha Beshir
5

In this problem we have to find the maximum profit noted with


z = 50 x + 18 y
So we have to find the value of x and y that satisfy these linear inequalities
• 2 x + y ≤ 100
• x + y ≤ 80
As we need to find the solution graphically so these inequality has to be represented in
a quadrant plan.
How to draw inequality in graph?
You have to transfer these inequality to corresponding equations.

Dr.Noha Beshir
6

Inequalities Corresponding equations


2 x + y ≤ 100 2 x + y = 100
x + y ≤ 80 x + y = 80

• So we need to graph these equations and we can do that by finding the co-ordinates of x-
intercept and the co-ordinates of y-intercept.
Inequalities Corresponding Co-ordinates of x- Co-ordinates of y-
equations intercept intercept
2 x + y ≤ 100 2 x + y = 100 (50 , 0 ) ( 0 , 100)
x + y ≤ 80 x + y = 80 ( 80 , 0 ) ( 0 , 80 )

• In equation 1 to find co-ordinate of x-intercept 2 x + y = 100


• y = 0 so 2 x + 0 = 100
• X = 100 / 2 = 50
Dr.Noha Beshir
7

• In equation 1 to find co-ordinate of y-intercept 2 x + y = 100


• x = 0 so 2*0 + y = 100
• y = 100
• In equation 2
• Co-ordinate of x-intercept x + y = 80
• y = 0 so x = 80
• Co-ordinate of y-intercept x + y = 80
• x = 0 so y = 80
• Now let us draw these two lines representing these equations on the graph

Dr.Noha Beshir
8

• Now to find the optimal solution you have to find


the feasible region.

• What is feasible region?

• It’s the common region determined by all the


constraints of a linear programming problem.

• Each point of the feasible region satisfy part of


inequality problem so let us mark the feasible
region for this problem.

Dr.Noha Beshir
9

The feasible region will be 0ABC as the


two line intersection in point B (20 . 60)

Solve for the corner point B


2 x + y = 100
(-) x + (-) y = (-) 80
x = 20

Substitute in any equation for x = 20


2 (20) + y = 100
y = 60

Any point in this feasible region will


satisfy the constraints of this problem.
Dr.Noha Beshir
10

For example, try point (30,40) in the


equity x + y ≤ 80
30 + 40 ≤ 80
70 ≤ 80
So this point satisfy the linear
inequality in this way every point
within and in the boundary of the
feasible region can be feasible solution
for the given problem.
So that means all points within feasible
region satisfy linear constraints.
Now how to find the optimal
solution?
Since there are many possible solutions
for this problem we will use the corner
point method to find the maximum
profit.
Dr.Noha Beshir
11

What is corner point method?


In this method a solution of linear
programming problem lays on the corner
point of the feasible region.
The coordinates of the corner points are
substituted to the values of x and y in the
objective function.
In this example points A, B, C and 0 are
the corner points of the feasible region.

So we have to evaluate the objective


function by substituting these points as Corner Points Corresponding value of z
values of x and y one by one
0 (0,0) 50 (0) + 18 (0) =0
z = 50 x + 18 y A (0,80) 50 (0) + 18 (80) = 1440
Optimal solution is x = 50 , y = 0 value B (20, 60) 50 (20) + 18 (60) = 2080
of z maximum at point C (50,0) C (50,0) 50 (50) + 18 (0) =2500
Dr.Noha Beshir
12

EXAMPLE 2
• Solve the given linear programming problems graphically:
• Maximize: Z = 8x + y
• Constraints are,
• x + y ≤ 40
• 2x + y ≤ 60
• x,y≥0

Inequalities Corresponding Co-ordinates of x- Co-ordinates of y-


equations intercept intercept
x + y ≤ 40 x + y = 40 (40 , 0) (0 , 40)
2x + y ≤ 60 2 x + y = 60 (30 , 0) (0 , 60)
Dr.Noha Beshir
13

• Here both the constraints are less than or equal to,


so they satisfy the below region (towards origin).
You can find the feasible region by graph, or you
can calculate using the given constraints:
• x + y = 40 …(i)
• 2x + y = 60 …(ii)
• Now multiply eq(i) by 2 and then subtract both
eq(i) and (ii), we get
• y = 20
• Now put the value of y in any of the equations, we
get
• x = 20
• So the third point of the feasible region is (20, 20)

Dr.Noha Beshir
14

• To find the maximum value of


• Z = 8x + y
• Compare each intersection point of the graph to find
the maximum value
• So the maximum value of Z = 240 at point
• x = 30, y = 0.

Corner Points Corresponding value of z


(0, 0) 8 (0) + 0 = 0
(0, 40) 8 (0) + 40 = 40
(20 , 20) 8 (20) + 20 = 180
(30 , 0) 8 (30) + 0 = 240

Dr.Noha Beshir
15

EXAMPLE 3
• One kind of cake requires 200 g of flour and 25 g of fat, and another kind of cake requires
100 g of flour and 50 g of fat Find the maximum number of cakes that can be made from 5
kg of flour and 1 kg of fat assuming that there is no shortage of the other ingredients, used in
making the cakes.

Dr.Noha Beshir
16

• 200x + 100y ≤ 5000 or 2x + y ≤ 50


• 25x + 50y ≤ 1000 or x + 2y ≤ 40
• x,y≥0

Inequalities Corresponding Co-ordinates of x- Co-ordinates of y-


equations intercept intercept
2x + y ≤ 50 2 x + y = 50 (25 , 0) (0 , 50)
x + 2y ≤ 40 x + 2 y = 40 (40 , 0) (0 , 20)
Dr.Noha Beshir
17

• Here both the constraints are less than or equal to, so


they satisfy the below region (towards origin). You
can find the feasible region by graph, or you can
calculate using the given constraints:
• 2x + y = 50 …(i)
• x + 2y =40 …(ii)
• Now multiply eq(i) by 2 and then subtract both eq(i)
and (ii), we get
• x = 20
• Now put the value of x in any of the equations, we get
• y = 10
• So the third point of the feasible region is (20, 10)

Dr.Noha Beshir
18

• To find the maximum number of cakes


• Z=x+y
• Compare each intersection point of the graph to find the maximum number of cakes that can
be baked.

• Clearly, Z is maximum at co-ordinate (20, 10). So the maximum number of cakes that can be
baked is Z = 20 + 10 = 30.

Dr.Noha Beshir
19

EXAMPLE 4
• Solve the given linear programming problems graphically
• Maximize: Z = 50x + 15y
• Constraints are,
• 5x + y ≤ 100
• x + y ≤ 50
• x ,y ≥ 0
Inequalities Corresponding Co-ordinates of x- Co-ordinates of y-
equations intercept intercept
5x + y ≤ 100 5 x + y = 100 (20 , 0) (0 , 100)
x + y ≤ 50 x + y = 50 (50 , 0) (0 , 50)

Dr.Noha Beshir
20

• Here both the constraints are less than or equal to, so


they satisfy the below region (towards origin). You
can find feasible region by graph, or you can calculate
using the given constraints:
• 5 x + y = 100 …(i)
• x + y = 50 …(ii)
• Now subtract both eq(i) and (ii), we get
• x = 12.5
• Now put the value of x in any of the equations, we get
• y = 37.5
• So the third point of the feasible region is (12.5, 37.5)

Dr.Noha Beshir
21

• To find the maximum of


• Z = 50x + 15y
• Compare each intersection point of the graph to find the maximum

Corner Points Corresponding value of z


(0,0) 50 (0) + 15 (0) = 0
(0,50) 50 (0) + 15 (50) = 750
(12.5, 37.5) 50 (12.5) + 15 (37.5) = 1187.5
(20,0) 50 (20) + 15 (0) = 1000

• Thus, maximum value of Z with given constraint is, 1187.5 when x = 12.5 and y = 37.5

Dr.Noha Beshir

You might also like