Linear Programming Model Formulation and Graphical Solution: by Babasab Patil
Linear Programming Model Formulation and Graphical Solution: by Babasab Patil
By Babasab Patil
1
Part I: Linear Programming
Model Formulation and Graphical Solution
• Model Formulation
2
Linear Programming - An Overview
• Steps in application:
1- Identify problem as solvable by linear programming.
2- Formulate a mathematical model of the unstructured problem.
3- Solve the model.
3
Model Components and Formulation
4
A Maximization Model Example (1 of 2)
Problem Definition
Resource Requirements
Product Labor Clay Profit
(hr/unit) (lb/unit) ($/unit)
Bowl 1 4 40
Mug 2 3 50
5
A Maximization Model Example (2 of 2)
Resource availability:
40 hours of labor per day
120 pounds of clay
Decision Variables:
x1=number of bowls to produce/day
x2= number of mugs to produce/day
Objective function
maximize Z = $40x1 + 50x2
where Z= profit per day
Resource Constraints:
1x1 + 2x2 40 hours of labor
4x1 + 3x2 120 pounds of clay
Non-negativity Constraints:
x10; x2 0
Complete Linear Programming Model:
maximize Z=$40x1 + 50x2
subject to
1x1 + 2x2 40
4x2 + 3x2 120
x1, x2 0
6
Feasible/Infeasible Solutions
• A feasible solution does not violate any of the constraints:
Example x1= 5 bowls
x2= 10 mugs
Z = $40 x1 + 50x2= $700
Labor constraint check:
1(5) + 2(10) = 25 < 40 hours, within constraint
Clay constraint check:
4(5) + 3(10) = 70 < 120 pounds, within constraint
7
Graphical Solution of Linear Programming Models
8
Graphical Solution of a Maximization Model
Coordinate Axes
9
Graphical Solution of a Maximization Model
Labor Constraint
10
Graphical Solution of a Maximization Model
Labor Constraint Area
11
Graphical Solution of a Maximization Model
Clay Constraint Area
12
Graphical Solution of a Maximization Model
Both Constraints
13
Graphical Solution of a Maximization Model
Feasible Solution Area
14
Graphical Solution of a Maximization Model
Objective Function = $800
15
Graphical Solution of a Maximization Model
Alternative Objective Functions
Alternative objective function lines for profits, Z, of $800, $1,200, and $1,600
16
Graphical Solution of a Maximization Model
Optimal Solution
17
Graphical Solution of a Maximization Model
Optimal Solution Coordinates
18
Graphical Solution of a Maximization Model
Corner Point Solutions
19
Graphical Solution of a Maximization Model
Optimal Solution for New Objective Function
20
Slack Variables
21
Complete Linear Programming Model in Standard Form
22
A Minimization Model Example
Problem Definition
• Two brands of fertilizer available - Super-gro, Crop-quick.
• Field requires at least 16 pounds of nitrogen and 24 pounds of phosphate.
• Super-gro costs $6 per bag, Crop-quick $3 per bag.
• Problem : How much of each brand to purchase to minimize total cost of
fertilizer given following data ?
Chemical Contribution
Nitrogen Phosphate
Brand (lb/bag) (lb/bag)
Super-gro 2 4
Crop-quick 4 3
23
A Minimization Model Example Model Construction
Decision variables
x1 = bags of Super-gro
x2 = bags of Crop-quick
The objective function:
minimize Z = $6x1 + 3x2
where $6x1 = cost of bags of Super-gro
3x2 = cost of bags of Crop-quick
Model constraints:
2x1 + 4x2 16 lb (nitrogen constraint)
4x1 + 3x2 24 lb (phosphate constraint)
x1, x2 0 (nonnegativity constraint)
24
A Minimization Model Example
Complete Model Formulation and Constraint Graph
25
A Minimization Model Example
Feasible Solution Area
26
A Minimization Model Example
Optimal Solution Point
27
A Minimization Model Example
Surplus Variables
28
A Minimization Model Example
Graphical Solutions
29
Irregular Types of Linear Programming Problems
30
Multiple Optimal Solutions
Graph of the Beaver Creek Pottery Company example with multiple optimal solutions
31
An Infeasible Problem
32
An Unbounded Problem
An unbounded problem
33
Characteristics of Linear Programming Problems
34
Properties of Linear Programming Models
36
Example Problem No. 1
Solution
37
Example Problem No.1
Solution (continued)
Step 3: Establish 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 lb
x1 50
x2 200
x1 - 2x2 0
x1,x2 0
38
Example Problem No.2
39
Example Problem No.2
40
Example Problem No.2
41
Part II: Linear Programming
Modeling Examples
43
Product Mix Example
Data
Sweatshirt - F 0.10 36 90
T-shirt - F 0.08 25 45
44
Product Mix Example
Model Construction
Decision variables:
x1 = sweatshirts, front printing
x2 = sweatshirts, back and front printing
x3 = T-shirts, front printing
x4 = T-shirts, back and front printing
Objective function:
maximize Z = $90x1 + 125x2 + 45x3 + 65x4
Model constraints:
0.10x1 + 0.25x2+ 0.08x3 + 0.21x4 72 hr
3x1 + 3x2 + x3 + x4 1,200 boxes
$36x1 + 48x2 + 25x3 + 35x4 $25,000
x1 + x2 500 dozen sweatshirts
x3 + x4 500 dozen T-shirts
45
Product Mix Example
Computer Solution with QM for Windows
maximize Z = $90x1 + 125x2 + 45x3 + 65x4
subject to:
0.10x1 + 0.25x2+ 0.08x3 + 0.21x4 72
3x1 + 3x2 + x3 + x4 1,200 boxes
$36x1 + 48x2 + 25x3 + 35x4 $25,000
x1 + x2 500 dozed sweatshirts
x3 + x4 500 dozen T-shirts
x1, x2, x3, x4 0
46
Product Mix Example
Computer Solution with QM for Windows (continued)
maximize Z = $90x1 + 125x2 + 45x3 + 65x4
subject to:
0.10x1 + 0.25x2+ 0.08x3 + 0.21x4 72
3x1 + 3x2 + x3 + x4 1,200 boxes
$36x1 + 48x2 + 25x3 + 35x4 $25,000
x1 + x2 500 dozed sweatshirts
x3 + x4 500 dozen T-shirts
x1, x2, x3, x4 0
47
Diet Example
Data and Problem Definition
Breakfast to include at least 420 calaries, 5 milligrams of iron, 400 milligrams of calcium, 20 grams of protein,
12 grams of fiber, and must have no more than 20 grams of fat and 30 milligrams of cholesterol.
48
Diet Example
Model Construction: Decision Variables
minimize Z =0.18x1 + 0.22x2 + 0.10x3 + 0.12x4 + 0.10x5 + 0.09x6+ 0.40x7 + 0.16x8 + 0.50x9
0.07x10
subject to
90x1 + 110x2 + 100x3 + 90x4 + 75x5 + 35x6 + 65x7 + 100x8 + 120x9 + 65x10 420
2x2 + 2x3 + 2x4 + 5x5 + 3x6 + 4x8 + x10 20
270x5 + 8x6 + 12x8 30
6x1 + 4x2 + 2x3 + 3x4+ x5 + x7 + x10 5
20x1 + 48x2 + 12x3 + 8x4+ 30x5 + 52x7 + 250x8 + 3x9 + 26x10 400
3x1 + 4x2 + 5x3 + 6x4 + 7x5 + 2x6 + x7+ 9x8+ x9 + 3x10 20
5x1 + 2x2 + 3x3 + 4x4+ x7 + 3x10 12
xi 0
50
An Investment Example
Model Summary
maximize Z = $0.085x1 + 0.05x2 + 0.065 x3+ 0.130x4
subject to
x1 14,000
x2 - x1 - x3- x4 0
x2 + x3 21,000
-1.2x1 + x2 + x3 - 1.2 x4 0
x1 + x2 + x3 + x4 = 70,000
x1, x2, x3, x4 0
where
x1 = amount invested in municipal bonds ($)
x2 = amount invested in certificates of deposit ($)
x3 = amount invested in treasury bills ($)
x4 = amount invested in growth stock fund($)
51
A Marketing Example
Data and Problem Definition
Exposure Cost
(people/ad or
commercial)
Television 20,000 $15,000
commercial
Radio commercial 12,000 6,000
52
Transportation Example
Problem Definition and Data
Warehouse supply of televisions sets: Retail store demand for television sets:
From To Store
Warehouse
A B C
1 $16 $18 $11
2 14 12 13
3 13 15 17
53
A Blend Example
Problem Definition and Data
Determine the optimal mix of the three components in each grade of motor oil that will maximize profit.
Company wants to produce at least 3,000 barrels of each grade of motor oil.
Maximum Barrels
Component Cost/barrel
Available/day
1 4,500 $12
2 2,700 10
3 3,500 14
54
A Blend Example
Decision Variables and Model Summary
Decision variables: The quantity of each of the three components used in each grade of
gasoline (9 decision variables); xij = barrels of component i used in motor oil grade j per day,
where i = 1, 2, 3 and j = s (super), p(premium), and e(extra).
Model Summary: maximize Z = 11x1s + 13x2s + 9x3s + 8x1p + 10x2p + 6x3p + 6x1e + 8x2e + 4x3e
subject to
x1s + x1p + x1e 4,500
x2s + x2p + x2e 2,700
x3s + x3p + x3e 3,500
0.50x1s - 0.50x2s - 0.50x3s 0
0.70x2s - 0.30x1s - 0.30x3s 0
0.60x1p - 0.40x2p - 0.40x3p 0
0.75x3p - 0.25x1p - 0.25x2p 0
0.40x1e- 0.60x2e- - 0.60x3e 0
0.90x2e - 0.10x1e - 0.10x3e 0
x1s + x2s + x3s 3,000
x1p+ x2p + x3p 3,000
x1e+ x2e + x3e 3,000
xij 0
55
A Multiperiod Scheduling Example
Problem Definition and Data
Production capacity : 160 computers per week
Additional 50 computers with overtime
Assembly costs: $190/comp. regular time; $260/comp. overtime
Inventory cost: $10/comp. per week
Order schedule: Week Computer Orders
1 105
2 170
3 230
4 180
5 150
6 250
56
A Multiperiod Scheduling Example
Decision Variables and Model Summary
Decision variables:
rj = regular production of computers per week j (j = 1, 2, 3, 4, 5, 6)
oj = overtime production of computers per week j (j = 1, 2, 3, 4, 5, 6)
ij = extra computers carried over as inventory in week j (j = 1, 2, 3, 4, 5)
Model summary:
minimize Z = $190(r1 + r2 + r3 + r4 + r5 + r6) + $260(o1 + o2 + o3 + o4 + o5 +o6) + 10(i1, + i2 + i3 + i4 + i5)
subject to rj 160 (j = 1, 2, 3, 4, 5, 6)
oj 150 (j = 1, 2, 3, 4, 5, 6)
r1 + o1 - i1 105
r2 + o2 + i1 - i2 170
r3 + o3 + i2 - i3 230
r4 + o4 + i3 - i4 180
r5 + o5 + i4 - i5 150
r6 + o6 + i5 250
rj, oj, ij 0
57
A Data Envelopment Analysis (DEA) Example
Problem Definition and Data
DEA compares a number of service units of the same type based on their inputs (resources) and
outputs. The result indicates if a particular unit is less productive, or efficient, than other units.
Elementary school comparison:
input 1 = teacher to student ratio output 1 = average reading SOL score
input 2 = supplementary $/student output 2 = average math SOL score
Inputs Outputs
School 1 2 3 1 2 3
58
A Data Envelopment Analysis (DEA) Example
Decision Variables and Model Summary
Decision variables:
xi = a price per unit of each output where i = 1, 2, 3
yi = a price per unit of each input where i = 1, 2, 3
Model summary:
maximize Z = 81x1 + 73x2 + 69x3
subject to
.06 y1 + 460y2 + 13.1y3 = 1
86x1 + 75x2 + 71x3 .06y1 + 260y2 + 11.3y3
82x1 + 72x2 + 67x3 .05y1 + 320y2 + 10.5y3
81x1 + 79x2 + 80x3 .08y1 + 340y2 + 12.0y3
81x1 + 73x2 + 69x3 .06y1 + 460y2 + 13.1y3
xi, yi 0
59
Example Problem Solution
Problem Statement and Data
60
Example Problem Solution
Model Formulation
Step 1: Define the Decision Variables
xij = ounces of ingredient i in pet food j per week, where i = h (horse meat), f (fish) and
c (cereal), and j = m (Meow chow) and b (Bow Chow).
Step 2: Formulate the Objective Function
maximize Z = $0.05(xhm + xfm + xcm) + 0.06(xhb + xfb + xcb)
Step 3: Formulate the Model Constraints
Amount of each ingredient available each week:
xhm + xhb 9,600 ounces of horse meat
xfm + xfb 12,800 ounces of fish
xcm + xcb 16,000 ounces of cereal additive
Recipe requirements:
Meow Chow xfm/(xhm + xfm + xcm) 1/2, or, - xhm + xfm- xcm 0
Bow Chow xhb/(xhb + xfb + xcb) 1/2, or, xhb- xfb - xcb 0
Can content constraint: xhm + xfm + xcm + xhb + xfb+ xcb 36,000 ounces
61
Example Problem Solution
Model Summary and Solution with QM for Windows
Step 4: Model Summary
maximize Z = $0.05 xhm + 0.05 xfm + 0.05 xcm + 0.06 xhb + 0.06 xfb + 0.06 x subject
to xhm + xhb 9,600 ounces of horse meat
xfm + xfb 12,800 ounces of fish
xcm + xcb 16,000 ounces of cereal additive
- xhm + xfm- xcm 0
xhb- xfb - xcb 0
xhm + xfm + xcm + xhb + xfb+ xcb 36,000 ounces
xij 0
62
Additional Exercises
• Chap 2 - No 36 & 38; page 62;
• Chap 3 – No 8, 9, 10, 17, 19; pg 92;
• Chap 4 - 20, 21; pg 146
• Group assignment: Case Problem “Summer
Sports Camp at State University”