You are on page 1of 64

Linear Programming:

Model Formulation and


Graphical Solution
Chapter 2

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-1


Outline
 Linear Programming: Problem
Formulation Examples
 Graphical Solution Procedure for
2-variable LP Problems
 Extreme Points and the Optimal Solution
 LP Model in Standard Form

 Irregular Types (Special Cases) of Linear


Programming Models
 Properties of Linear Programming Models
2
2-2
Linear Programming (LP)
Problem
 The maximization or minimization of some
quantity is the objective in all linear programming
problems.
 All LP problems have constraints that limit the
degree to which the objective can be pursued.
 A feasible solution satisfies all the problem's
constraints.
 An optimal solution is a feasible solution that
results in the largest possible objective function
value when maximizing (or smallest when
minimizing). 3
2-3
A Simple Maximization
Problem

Objective
Max Z= 5x1 + 7x2 Function
s.t. x1 < 6
“Regular”
2x1 + 3x2 < 19
Constraints
x1 + x2 < 8
Non-negativity
x1 > 0 and x2 > 0
Constraints

4
2-4
Computer Solutions
 LP problems involving 1000s of variables and 1000s
of constraints are now routinely solved with
computer packages.
 Linear programming solvers are now part of many
spreadsheet packages, such as Microsoft Excel.
 Leading commercial packages include CPLEX,
LINGO, MOSEK, Xpress-MP, and Premium
Solver for Excel.
 In this course we will be using „QM for Windows‟

5
2-5
Example 1:
ABC Electronics
The product-mix problem at ABC Electronics
 Two products
1. X-pod: a portable music player
2. BlueBerry: an internet-connected color
telephone
A) Develop an LP model to determine the mix of
products that will produce the maximum profit
under the following constraints:
B) Find the optimum solution using graphical
approach
2-6
Example 1:
ABC Electronics
Hours Required
to Produce 1 Unit

X-pods BlueBerrys Available Hours


Department (X1) (X2) This Week

Electronic 4 3 240
Assembly 2 1 100
Profit per unit $7 $5

Table B.1

2-7
Steps to Formulate LP Model
 Define the decision variables.
 Define the objective function.

 Define each constraint including


non-negativity constraint.

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-8


Example 1
ABC Electronics, Part A)
Decision Variables:
X1= number of X-pods to be produced per week
X2= number of BlueBerrys to be produced per week
Max Z= 7X1 + 5X2
4X1 + 3X2 ≤ 240 (hours of electronic time)
2X1 + 1X2 ≤ 100 (hours of assembly time)
X1, X2>= 0

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-9


Part B) Graphical Solution
Can be used when there are two
decision variables
1. Plot the constraint equations at their
limits by converting each equation from
inequality to equality
2. Identify the feasible solution space
3. Calculate the coordinates of corner
points of the feasible space
4. The corner point which minimizes or
maximizes the objective function is
the optimum point. 2-10
Graphical Analysis –Example 1:
Shader Electronics
X2

The non-negativity constraints

X1

11
2-11
A feasible solution does
not violate any of the
constraints

An infeasible solution
violates at least one of
the constraints

2-12
Graphical Solution: ABC Electronics
4X1 + 3X2 ≤ 240 (hours of electronic time)
2X1 + 1X2 ≤ 100 (hours of assembly time)
X2

100 –

Number of BlueBerrys

80 – Assembly (constraint B)

60 –

40 –
– Electronics (constraint A)
20 – Feasible
region

|– | | | | | | | | | | X1
0 20 40 50 60 80 100
Number of X-pods
© 2008 Prentice Hall, Inc. B – 13
Corner-Point Method
X2

100 –
2 –
Number of BlueBerrys

80 –

60 –

3
40 –

20 –

|– | | | | | | | | | | X1
1
0 20 40 60 80 100
4
Number of X-pods
© 2008 Prentice Hall, Inc. B – 14
Corner-Point Method
 The optimal value will always be at a
corner point
 Find the objective function value at each
corner point and choose the one with the
highest profit

Point 1 : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0


Point 2 : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400
Point 4 : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350

© 2008 Prentice Hall, Inc. B – 15


Corner-Point Method
 The optimal value will always be at a
Solvepoint
corner for the intersection of two constraints

1 + 3X2 ≤ 240
 Find the4Xobjective (electronics
function valuetime)
at each
corner 2X 1 + 1X
point 2 ≤ 100
and (assembly
choose time)with the
the one
highest profit
4X1 + 3X2 = 240 4X1 + 3(40) = 240
- 4X1 - 2X2 = -200 4X1 + 120 = 240
Point 1 : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0
+ 1X2 = 40 X1 = 30
Point 2 : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400
Point 4 : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350

© 2008 Prentice Hall, Inc. B – 16


Corner-Point Method
 The optimal value will always be at a
corner point
 Find the objective function value at each
corner point and choose the one with the
highest profit

Point 1 : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0


Point 2 : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400
Point 4 : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350
Point 3 : (X1 = 30, X2 = 40) Profit $7(30) + $5(40) = $410

© 2008 Prentice Hall, Inc. B – 17


Corner-Point (Extreme Points) Method
to find the Optimal Solution
 The corners or vertices of the feasible region
are referred to as the extreme points.
 An optimal solution to an LP problem can
be found at an extreme point of the feasible
region.
 When looking for the optimal solution, you
do not have to evaluate all feasible solution
points.
 You have to consider only the extreme
points of the feasible region. 18
2-18
Iso-Profit Line Method to
Find the Optimum Solution
Max Z= 7X1 + 5X2
4X1 + 3X2 ≤ 240
2X1 + 1X2 ≤ 100
X1, X2>= 0
Choose a possible value for the objective function:
210 = 7X1 + 5X2
Solve for the axis intercepts of the function and plot the
line
X2 = 0  X1 = 30
X1 = 0  X2 = 42

© 2008 Prentice Hall, Inc. B – 19


Iso-Profit Line Method to Find the
Optimum Solution
X2

100 –

Number of BlueBerrys

80 –

60 –
$210 = $7X1 + $5X2

(0, 42) Iso-Profit Line
40 –

20 – (30, 0)

|– | | | | | | | | | | X1
0 20 40 60 80 100
Number of X-pods
© 2008 Prentice Hall, Inc. B – 20
Iso-Profit Line Method to Find the
Optimum Solution
X2

100 –
– $350 = $7X1 + $5X2
Number of BlueBeryys

80 –
– $280 = $7X1 + $5X2
60 –
$210 = $7X1 + $5X2

40 –

20 –
$420 = $7X1 + $5X2

|– | | | | | | | | | | X1
0 20 40 60 80 100
Number of X-pods
© 2008 Prentice Hall, Inc. B – 21
Iso-Profit Line Method to Find the
Optimum Solution
The optimal solution point is the last point the max
profit line touches on the boundary of the feasible
X2 solution area (corner points of the feasible space)
before it leaves the feasible solution area.
100 –
– Maximum profit line
Number of BlueBerrys

80 –

60 –
Optimal solution point

(X1 = 30, X2 = 40)
40 –

20 –
$410 = $7X1 + $5X2

|– | | | | | | | | | | X1
0 20 40 60 80 100
Number of X-pods
© 2008 Prentice Hall, Inc. B – 22
Example 2:
Beaver Creek Pottery Company
 The company employs skilled artisans to
produce clay bowls and mugs with authentic
Native American designs and colors. The
two primary resources used by the company
are special pottery clay and skilled labor.
Given these limited resources, the company
desires to know how many bowls and mugs
to produce each day in order to maximize
profit. A) Formulate an LP model B) Find
the optimum solution using graphical
aproach
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-23
LP Model Formulation
A Maximization Example

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-24


LP Model Formulation
A Maximization Example

 Product mix problem - Beaver Creek Pottery Company


 How many bowls and mugs should be produced to maximize
profits given labor and materials constraints?
 Product resource requirements and unit profit:
Resource Requirements

Labor Clay Profit


Product
(Hr./Unit) (Lb./Unit) ($/Unit)

Bowl 1 4 40
Mug 2 3 50

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-25


Steps to Formulate LP Model
 Define the decision variables.
 Define the objective function.

 Define each constraint including


non-negativity constraint.

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-26


LP Model Formulation
A Maximization Example (3 of 4)

Resource 40 hrs of labor per day


Availability: 120 lbs of clay
Decision x1 = number of bowls to produce per day
Variables: x2 = number of mugs to produce per day
Objective Maximize Z
Function: Where Z = profit per day
Resource hours of labor (at most 40)
Constraints: pounds of clay (at most 120)
Non-Negativity x1  0; x2  0
Constraints:
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-27
LP Model Formulation
A Maximization Example (4 of 4)
Complete Linear Programming Model:
x1 = number of bowls to produce per day
x2 = number of mugs to produce per day
Maximize Z = $40x1 + $50x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-28


Coordinate Axes
Graphical Solution of Maximization Model (1 of 12)

X2 is mugs

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x 1, x 2  0

X1 is bowls
Figure 2.2 Coordinates for Graphical Analysis
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-29
Labor Constraint
Graphical Solution of Maximization Model (2 of 12)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Figure 2.3 Graph of Labor Constraint


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-30
Labor Constraint Area
Graphical Solution of Maximization Model (3 of 12)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Figure 2.4 Labor Constraint Area


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-31
Clay Constraint Area
Graphical Solution of Maximization Model (4 of 12)

Maximize Z = $40x1 + $50x2


subject to:
1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Figure 2.5 Clay Constraint Area


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-32
Feasible Solution Area
Graphical Solution of Maximization Model (6 of 12)

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0
Blue shaded area which
is common to both
constraints shows feasible
solution area.
Figure 2.7 Feasible Solution Area
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-33
Extreme (Corner) Point Solutions
Graphical Solution of Maximization Model (11 of 12)

Maximize Z = $40x1 + $50x2


subject to:
1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0
B is optimum point.
Producing 24 bowls and
8 mugs will provide
maximum profit ($1360). Figure 2.12 Solutions at All Corner Points
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-34
Example 3, Planting Crop

2-35
Example 3, Planting Crop

Minimize Z = $6x1 + $3x2


subject to: 2x1 + 4x2  16
4x1 + 3x2  24
x1, x2  0

2-36
Example 3, Planting Crop

Minimize Z = $6x1 + $3x2


subject to: 2x1 + 4x2  16
4x1 + 3x2  24
x1, x2  0

2-37
Example 3, Planting Crop

Minimize Z = $6x1 + $3x2


subject to: 2x1 + 4x2  16
4x1 + 3x2  24
x1, x2  0
Corner
Points x1, x2 Z
A 0, 8 $24
B 4.8, 1.6 $33.6
C 8, 0 $48

So, optimum solution which


minimizes the cost is to
purchase 8 bags of Crop-Quick.
2-38
LP Model in Standard Form
 A linear program in which all the
variables are non-negative and all the
constraints are equalities is said to be
in standard form.
 Slack and surplus variables represent
the difference between the left and
right sides of the constraints.

2-39
Slack Variables
 A slack variable is added to a  constraint to convert it
to an equation (=).
 A slack variable typically represents an unused
resource.
 A slack variable contributes nothing to the objective
function value.
Example: Producing Mugs and Bowls:

1x1 + 2x2  40 (Available Labor Hours)


1x1 + 2x2 + s1 = 40

2-40
Example 2: Beaver Creek Pottery Company
LP Model in Standard Form

Max Z = 40x1 + 50x2 + 0s1 + 0s2


subject to:
1x1 + 2x2 + s1 = 40
4x1 + 3x2 + s2 = 120
x1, x2, s1, s2  0
Where:
x1 = number of bowls
x2 = number of mugs
s1, s2 are slack variables

Figure 2.14 Solution Points A, B, and C with Slack


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-41
Surplus Variables

 A surplus variable is subtracted from a  constraint to


convert it to an equation (=).
 A surplus variable represents an excess above a
minimum resource requirement level.
 A surplus variable contributes nothing to the calculated
value of the objective function.
 Subtracting surplus variables in the farmer problem
constraints:
2x1 + 4x2 - s1 = 16 (nitrogen)
4x1 + 3x2 - s2 = 24 (phosphate)

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-42


Example 3: Planting Crop LP Model in
Standard Form

Min Z= 6x1 + 3x2 + 0s1 + 0s2


subject to:
2x1 + 4x2 – s1 = 16
4x1 + 3x2 – s2 = 24
x1, x2, s1, s2  0

Figure 2.19 Graph of Fertilizer Example


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-43
Irregular Types of Linear Programming
Problems
For some linear programming models, the general rules
do not apply.
 Special types of problems include those with:

 Multiple optimal solutions


 Infeasible solutions
 Unbounded solutions

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-44


Multiple Optimal Solutions Beaver Creek Pottery
Second constraint and Obj. Func. have the same slope

The objective function is


parallel to a constraint line.
Maximize Z=$40x1 + 30x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0
Where:
x1 = number of bowls
x2 = number of mugs

Figure 2.20 Example with Multiple Optimal Solutions


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-45
An Infeasible Problem

Every possible solution


violates at least one constraint:
Maximize Z = 5x1 + 3x2
subject to: 4x1 + 2x2  8
x1  4
x2  6
x1, x2  0

Figure 2.21 Graph of an Infeasible Problem


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-46
An Unbounded Problem

Value of the objective


function increases indefinitely:
Maximize Z = 4x1 + 2x2
subject to: x1  4
x2  2
x1, x2  0

Figure 2.22 Graph of an Unbounded Problem


Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-47
Properties of Linear Programming Models
 The objective and constraints must be definable by linear
mathematical functional relationships.
 Proportionality–Contribution of each activity to the
objective function and a constraint is proportional to the
level of that activity. For example, if one bowl requires 1
hour of processing time, 20 bowles will require 20 hours.

This assumption fails when there is (dis)economies of scale.


Maximize Z=$40x1 + 30x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0
2-48
Properties of Linear
Programming Models
 Additivity - Individual contribution of different
activities can be summed up to obtain an objective
function and constraints. For example, the constraint
showing the total pounds of clay required is expressed
by summing the amount of clay required by bowles
and mugs. This assumption fails when activities
are not independent.
4x1 + 3x2  120 (pounds of clay)
 Divisibility -Decision variables can take integer as well
as fractional values.
 Certainty - Each parameter in the formulation is
known for sure (non-probabilistic, deterministic).
2-49
LP Model Formulation
Example 4
Moore's Meatpacking Company produces a hot dog
mixture in 1,000-pound batches. The mixture
contains two ingredients chicken and beef. Cost
of chicken and beef are $3/lb and $5/lb,
respectively. The hot dog recipe requires at least 500
pounds of “chicken” and at least 200 pounds of
“beef ”. Ratio of chicken to beef must be at least 2
to 1.
Formulate an LP model to determine optimal
mixture of ingredients that will minimize costs.
2-50
Steps to Formulate LP Model
 Define the decision variables.
 Define the objective function.

 Define each constraint including


non-negativity constraint.

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-51


LP Model Formulation
Example 4
Step 1:
Define decision variables.
x1 = lb of chicken in mixture
x2 = lb of beef in mixture
Step 2:
Define the objective function.
Minimize Z = $3x1 + $5x2
where Z = cost per 1,000-lb batch
$3x1 = cost of chicken
$5x2 = cost of beef
2-52
LP Model Formulation
Step 3:
Example 4
Define Model Constraints
x1 + x2 = 1,000 lb
x1  500 lb of chicken
x2  200 lb of beef
x1/x2  2/1 or x1 - 2x2  0
x1, x2  0
The Model:
Minimize Z = $3x1 + 5x2
subject to: x1 + x2 = 1,000
x1  500
x2  200
x1 - 2x2  0
x1,x2  0
2-53
Graphical Solution of 2-variable LP
Problems, Example 5
Solve the following model graphically:

Maximize Z = 4x1 + 5x2


subject to: x1 + 2x2  10
6x1 + 6x2  36
x1  4
x1, x2  0

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-54


Graphical Solution of 2-variable LP Problems
Example 5
Maximize Z = 4x1 + 5x2
subject to: x1 + 2x2  10
6x1 + 6x2  36
x1  4
x1, x2  0

Step 1: Plot the constraints


as equations

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-55


Graphical Solution of 2-variable LP Problems
Example 5

Maximize Z = 4x1 + 5x2


subject to: x1 + 2x2  10
6x1 + 6x2  36
x1  4
x1, x2  0
Step 2: Determine the feasible
solution space

Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-56


Graphical Solution of 2-variable LP Problems
Example 5
Maximize Z = 4x1 + 5x2
subject to: x1 + 2x2  10
6x1 + 6x2  36
x1  4
x1, x2  0
Step 3 and 4: Determine the
coordinates of corner points
and the optimal solution
Corner point B with
maximum profit gives the
optimum solution
x1= 2 , x2 = 4
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 2-57
Graphical Solution of 2-variable LP
Problems, Example 6
Solve the following model graphically:
Objective
Max Z= 5x1 + 7x2 Function
s.t. x1 < 6
“Regular”
2x1 + 3x2 < 19
Constraints
x1 + x2 < 8
Non-negativity
x1 > 0 and x2 > 0
Constraints

58
2-58
Graphical Solution of 2-variable LP Problems
Example 6
 First Constraint Graphed
x2

8
7 x1 = 6
6 Shaded region
5 contains all
feasible points
4
for this constraint
3
2
(6, 0)
1
x1
1 2 3 4 5 6 7 8 9 10
59
2-59
Graphical Solution of 2-variable LP Problems
Example 6
 Second Constraint Graphed
x2

8 (0, 6.33)
7
6
5
2x1 + 3x2 = 19

4
Shaded
3
region contains
2 all feasible points (9.5, 0)
1 for this constraint
x1
1 2 3 4 5 6 7 8 9 10
60
2-60
Graphical Solution of 2-variable LP Problems
Example 6
 Third Constraint Graphed
x2
(0, 8)
8
7
6 x1 + x2 = 8
5
4
Shaded
3
region contains
2 all feasible points
1 for this constraint (8, 0)
x1
1 2 3 4 5 6 7 8 9 10
61
2-61
Graphical Solution of 2-variable LP Problems
Example 6
 Combined-Constraint Graph Showing Feasible
Region x2
8
x1 + x2 = 8

7
6 x1 = 6
5
4
3
Feasible 2x1 + 3x2 = 19
2
Region
1
x1
1 2 3 4 5 6 7 8 9 10
62
2-62
Graphical Solution of 2-variable LP Problems
Example 6
Corner point B with maximum profit (46)
x2
gives the optimum solution Max Z= 5x1 +
7x2
8 x1= 5 , x2 = 3
7
A (0, 6.33)
6
5
4
B (5, 3)
3
Feasible C (6, 2)
2 Region
1 E (0, 0) D (6, 0)
x1
1 2 3 4 5 6 7 8 9 10
63
2-63
Summary
 Linear Programming Problem
Formulation Examples
 Graphical Solution Procedure for
2-variable LP Problems
 Extreme Points and the Optimal Solution
 LP Model in Standard Form

 Properties of Linear Programming Models

 Special Cases of Linear Programming


Models 64
2-64

You might also like