Topic 02 - Linear Programming
Topic 02 - Linear Programming
Topic 02 - Linear Programming
1
ISE 303
OPERATIONS RESEARCH I
3
Quality & Accreditation Terminologies
5
Steps in Applying Linear Programming Technique
• LP technique derives its name from the fact that the functional
relationships in the mathematical model are linear, and the solution
technique consists of predetermined mathematical steps – that is, a
program
6
LP – Model Formulation
7
Decision Variables
8
Objective Function
9
Model Constraints
10
A Maximization Model Example
11
A Maximization Model Example
• The two products have the following resource requirements for production
and profit per item produced (i.e., the model parameters):
Resource Requirements
• There are 40 hours of labor and 120 pounds of clay available each day for
production
12
Solution
• Decision Variables
– The decision confronting management in this problem is how many
bowls and mugs to produce
– The two decision variables represent the number of bowls and mugs
to be produced on a daily basis. The quantities to be produced can be
represented symbolically as:
x1 = number of bowls to produce
x2 = number of mugs to produce
13
Solution
• Objective Function
– The objective of the company is to maximize total profit
– The company’s profit is the sum of the individual profits gained from each bowl
and mug. Profit derived from bowls is determined by multiplying the unit profit of
each bowl, $40, by the number of bowls produced, x1. Likewise, profit derived
from mugs is derived from the unit profit of a mug, $50, multiplied by the
number of mugs produced, x2
– Thus, total profit, which we will define symbolically as Z, can be expressed
mathematically as $40x1 + $50x2. By placing the term maximize in front of the
profit function, we express the objective of the firm – to maximize total profit
Maximize Z = $40x1 + $50x2
14
Solution
• Model Constraints
– In this problem, two resources are used for production – labor and clay – both
of which are limited
– Production of bowls and mugs requires both labor and clay
– For each bowl produced, 1 hour of labor is required. Therefore, the labor used
for the production of bowls is 1x1 hours. Similarly, each mug requires 2 hours of
labor; thus, the labor used to produce mugs every day is 2 x2 hours. The total
labor used by the company is the sum of the individual amounts of labor used
for each product:
1x1 + 2x2
– However, the amount of labor represented by 1 x1 + 2x1 is limited to 40 hours per
day; thus, the complete labor constraint is
1x1 + 2x2 ≤ 40 hrs
15
Solution
• Model Constraints
– The “less than or equal to” (≤) inequality is employed instead of an equality (=)
because the 40 hours of labor is a maximum limitation that can be used, not an
amount that must be used
– This constraint allows the company some flexibility; the company is not
restricted to using exactly 40 hours but can use whatever amount is necessary
to maximize profit, up to and including 40 hours
– Each bowl requires 4 pounds of clay, the amount of clay used daily for the
production of bowls is 4x1 pounds; and because each mug requires 3 pounds of
clay, the amount of clay used daily for mugs is 3 x2. Given that the amount of
clay available for production each day is 120 pounds, the material constraint
can be formulated as:
4x1 + 3x2 ≤ 120
16
Solution
• Model Constraints
– A final restriction is that the number of bowls and mugs produced must be
either zero or a positive value because it is impossible to produce negative
items. These restrictions are referred to as non-negativity constraints and are
expressed mathematically as
x1 ≥ 0, x2 ≥ 0
• Complete Formulation
Maximize Z = $40x1 + $50x2
Subject to:
1x1 + 2x2 ≤ 40 hrs of labour
4x1 + 3x2 ≤ 120 lb of clay
x1 ≥ 0, x2 ≥ 0
17
Solution Types
18
Another Example
Giapetto’s Woodcarving, Inc., manufactures two types of wooden toys: soldiers and trains. A
soldier sells for $27 and uses $10 worth of raw materials. Each soldier that is manufactured
increases Giapetto’s variable labor and overhead costs by $14. A train sells for $21 and uses
$9 worth of raw materials. Each train built increases Giapetto’s variable labor and overhead
costs by $10. The manufacture of wooden soldiers and trains requires two types of skilled
labor: carpentry and finishing. A soldier requires 2 hours of finishing labor and 1 hour of
carpentry labor. A train requires 1 hour of finishing and 1 hour of carpentry labor. Each week,
Giapetto can obtain all the needed raw material but only 100 finishing hours and 80 carpentry
hours. Demand for trains is unlimited, but at most 40 soldiers are bought each week. Giapetto
wants to maximize weekly profit (revenues - costs).
Formulate a mathematical model of Giapetto’s situation that can be used to maximize
Giapetto’s weekly profit.
19
Solution
• Decision Variables
X1: number of soldiers produced each week
X2: number of trains produced each week
• Objective Function
– We note that fixed costs (such as rent and insurance) do not depend on the
values of X1 and X2. Thus, Giapetto can concentrate on maximizing (weekly
revenues) − (raw material purchase costs) − (other variable costs)
– Giapetto’s weekly revenues and costs can be expressed in terms of the
decision variables X1 and X2
20
Solution
• Objective
Function
Weekly revenues = weekly revenues from soldiers + weekly revenues from trains
=
= 27X1 + 21X2
Weekly raw material costs: 10X1 + 9X2
Other weekly variable costs: 14X1 + 10X2
21
Solution
• Constraints
Constraint 1: Each week, no more than 100 hours of finishing time may
be used
Constraint 2: Each week, no more than 80 hours of carpentry time may
be used
Constraint 3: Because of limited demand, at most 40 soldiers should be
produced each week
22
Solution
• Constraints
Constraint 1: Each week, no more than 100 hours of finishing time may
be used
Total finishing hrs =
= 2(X1) + 1(X2) = 2X1 + X2
23
Solution
• Constraints
Constraint 2: Each week, no more than 80 hours of carpentry time may
be used
Total carpentry hrs =
= 1(X1) + 1(X2) = X1 + X2
25
Assumptions of Linear Programming
26
Assumptions of Linear Programming
27
Assumptions of Linear Programming
• Divisibility Assumption
The divisibility assumption requires that each decision variable be permitted to
assume any fractional values…
28
Graphical Solutions of Linear Programming Models
The steps for solving a graphical linear programming model are summarized here:
1. Plot the model constraints as equations on the graph; then, considering the inequalities
of the constraints, indicate the feasible solution area
2. Plot the objective function; then, move this line out from the origin to locate the optimal
solution point
3. Solve simultaneous equations at the solution point to find the optimal solution values
Or
2. Solve simultaneous equations at each corner point to find the solution values at each
point
3. Substitute these values into the objective function to find the set of values that results in
the maximum Z value
30
Example
31
Graphical Solution
45
40
x1 + 2x2 ≤ 40
35 x1 = 0; x2 = 20
30 x2 = 0; x1 = 40
25
20
15
10
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
32
Graphical Solution
45
40
4x1 + 3x2 ≤ 120
35 x1 = 0; x2 = 40
30 x2 = 0; x1 = 30
25
20
15
10
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
33
Graphical Solution
45
40
4x1 + 3x2 ≤ 120
35
30
25
20
15
10
x1 + 2x2 ≤ 40
5
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
34
Graphical Solution
45
40
4x1 + 3x2 ≤ 120
35
30
S T
25
20
15
10
R x1 + 2x2 ≤ 40
5
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
35
Optimal Solution Point
• Second step in the graphical solution method is to locate the point in the
feasible solution area that will result in the greatest total profit
• To begin the solution analysis, we first plot the objective function line for
an arbitrarily selected level of profit
• For example, if we say profit, Z, is $800, the objective function is:
$800 = $40x1 + $50x2
36
Graphical Solution
45
25
20
x1 + 2x2 ≤ 40
15
10
5
4x1 + 3x2 ≤ 120
0
0 1 2 3 4 5 6 7 8 9
37
Graphical Solution
45
25
20
x1 + 2x2 ≤ 40
15
10
5
4x1 + 3x2 ≤ 120
0
0 2 4 6 8 10 12
38
Graphical Solution
45
25
$1600 = $40x1 + $50x2
20 x1 = 0; x2 = 32
x1 + 2x2 ≤ 40
15 x2 = 0; x1 = 40
10
5
4x1 + 3x2 ≤ 120
0
0 2 4 6 8 10 12 14 16
39
Graphical Solution – Optimal Point
45
Optimal Point
40
x1 = 24
35
x2 = 8
30
Z = $1360
25
20
x1 + 2x2 ≤ 40
15
10
5
4x1 + 3x2 ≤ 120
0
0 2 4 6 8 10 12 14 16 18
40
Optimal Point
41
Determining Optimal Point Mathematically
Chemical Contribution
Brand
Nitrogen (lb/bag) Phosphate (lb/bag)
Super-go 2 4
Crop-Quick 4 3
• Decision Variables
– Problem contains two decision variables, representing the number of
bags of each brand of fertilizer to purchase:
x1 = bags of Super-gro
x2 = bags of Crop-quick
44
Solution
• Objective Function
– The farmer’s objective is to minimize the total cost of fertilizing
– The total cost is the sum of the individual costs of each type of fertilizer
purchased
– The objective function that represents total cost is expressed as
Maximize Z = $6x1 + $3x2
where
$6x1 = cost of bags of Super-gro
$3x2 = cost of bags of Crop-quick
45
Solution
• Model Constraints
– The requirements for nitrogen and phosphate represent the constraints of
the model
– Each bag of fertilizer contributes a number of pounds of nitrogen and
phosphate to the field
– The constraint for nitrogen is
2x1 + 4x2 ≥ 16 1b
– The constraint for phosphate is constructed like the constraint for nitrogen
4x1 + 3x2 ≥ 24 1b
– There are also non-negativity constraints in this problem to indicate that
negative bags of fertilizer cannot be purchased:
x1 ≥ 0, x2 ≥ 0
46
Solution
• Complete Formulation
minimize Z = $6x1 + $3x2
Subject to:
2x1 + 4x2 ≥ 16 lb of nitrogen
4x1 + 3x2 ≥ 24 lb of phosphate
x1 ≥ 0, x2 ≥ 0
47
Graphical Solution
8
2x1 + 4x2 ≥ 16
7 x1 = 0; x2 = 4
6 x2 = 0; x1 = 8
5
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
48
Graphical Solution
8
4x1 + 3x2 ≥ 24
7 x1 = 0; x2 = 8
6 x2 = 0; x1 = 6
5
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
49
Graphical Solution
8
4x1 + 3x2 ≥ 24
7
2
2x1 + 4x2 ≥ 16
1
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
50
Optimal Point
• After the feasible solution area has been determined, the second step in
the graphical solution approach is to locate the optimal point
• In a maximization problem, the optimal solution is on the boundary of the
feasible solution area that contains the point(s) farthest from the origin
• Optimal solution point in a minimization problem is also on the boundary
of the feasible solution area; however, the boundary contains the point(s)
closest to the origin (zero being the lowest cost possible)
• As in a maximization problem, the optimal solution is located at one of the
extreme points of the boundary
• In this case, the corner points represent extremities in the boundary of the
feasible solution area that are closest to the origin
51
Graphical Solution
8 24 = $6x1 + $3x2
4x1 + 3x2 ≥ 24
7 x1 = 0
6 x2 = 8
5
2
2x1 + 4x2 ≥ 16
1
0
0 1 2 3 4 5 6 7 8 9
52
Graphical Solution
8
4x1 + 3x2 ≥ 24 x1 = 4.4
7 x2 = 1.8
6
Z = 30
5
2
2x1 + 4x2 ≥ 16
1
0
0 1 2 3 4 5 6 7 8 9
53
Graphical Solution
8
4x1 + 3x2 ≥ 24 x1 = 8
7 x2 = 0
6
Z = 48
5
2
2x1 + 4x2 ≥ 16
1
0
0 1 2 3 4 5 6 7 8 9
54
Irregular Types of Linear Programming Problems
55
Multiple Optimal Solutions
• Consider the Beaver Creek Pottery Company example, with the objective
function changed from:
Z = $40x1 + $50x2 to Z = $40x1 + $30x2
56
Multiple Optimal Solutions
59
An Infeasible Problem
61
An Unbounded Problem
62
Characteristics of Linear Programming Problems
63
Problem 1
Step 1:
Identify decision variables.
x1 = lb of chicken in mixture
x2 = lb of beef in mixture
Step 2:
Formulate the objective function.
Minimize Z = $3x1 + $5x2
where Z = cost per 1,000-lb batch
$3x1 = cost of chicken
$5x2 = cost of beef
65
Problem 1 – Solution
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 and x1,x2 0 66
Problem 2
67
Problem 2 – Solution
68
Problem 2 – Solution
69
Problem 2 – Solution
70
FORMULATION OF LP:
EXAMPLES
Diet Problem Formulation
A prison is trying to decide what to feed its prisoners. They would like to offer
some combination of milk, beans, and oranges. Their goal is to minimize cost,
subject to meeting the minimum nutritional requirements imposed by law. The
cost and nutritional content of each food, along with the minimum nutritional
requirements are shown below.
72
Diet Problem Formulation
73
Scheduling / Man Power Planning Formulation
74
Scheduling / Man Power Planning Formulation
75
Bank Loan Model
BankOne is in the process of devising a loan policy that involves a maximum of $12
million. The following table provides the pertinent data about available types of loans
77
Bank Loan
78
Bank Loan
3. Home loans should equal at least 50% of personal, car, and home loans:
5. Non-negativity:
79
Blending Problem formulation
An oil company makes two blends of fuel by mixing three oils. Figures on the costs
and daily availability of the oils are given in Table below:
Also, the requirements of the blends of fuel are given in Table below:
Each liter of blend 1 can be sold for $1.10 and each liter of blend 2 can be sold for
$1.20. Long-term contracts require at least 10,000 liters of each blend to be
produced. Formulate this blending problem as a linear programming problem
80
Blending Problem formulation
81
Blending Problem formulation
82
Blending Problem formulation
83
Media Selection Problem Formulation
A company has budget up to $8000 per week for local advertisement. The money is
to be allocated among four promotional media: TV spots, newspaper ads, and two
types of radio advertisements. The company goal is to reach the largest possible
high-potential audience through the various media.
The following table presents the number of potential customers reached by making
use of advertisement in each of the four media. It also provides the cost per
advertisement placed and the maximum number of ads than can be purchased per
week.
84
Media Selection Problem Formulation
The company arrangements require that at least 5 radio spots be placed each week.
To ensure a board-scoped promotional campaign, management also insists that no
more than $1800 be spent on radio advertising every week.
85
Media Selection Problem Formulation
Decision Variables
X1 = number of 1-miute TV spots taken Each week
X2 = number of full-page daily newspaper ads taken each week
X3 = number of 30-second prime-time radio spots taken each week.
X4 = number of 1-minute afternoon radio spots taken each week
Objective Function
The company goal is to reach the largest possible high-potential audience through the
various media
Maximize Z = 5000 X1 + 8500 X2 + 2400 X3 + 2800 X4
86
Media Selection Problem Formulation
Constraints
X1 ≤ 12 (maximum TV spots/week)
X2 ≤ 5 (maximum newspaper ads/week)
X3 ≤ 25 (maximum 30-second radio spots/week)
X4 ≤ 20 (maximum 1-minute radio spots/week)
800 X1 + 925 X2 + 290 X3 + 380 X4 ≤ 8000 (weekly budget)
X3 + X4 ≥ 5 (minimum radio spots contracted)
290 X3 + 380 X4 ≤ 1800 (maximum dollars spent on radio)
X1, X2, X3, X4 ≥ 0
87
Trim Loss / Cutting Stock Problem Formulation
The Pacific Paper Company produces paper rolls with a standard width of 20 feet
each. Special customer orders with different widths arc produced by slitting the
standard rolls. Typical orders (which may vary daily) are summarized in the following
table:
88
Trim Loss / Cutting Stock Problem Formulation
However, there may be more settings by which the rolls can be cut.
The feasible cut setting of the rolls. Note that there must not be any setting That
produces the waste equal to or greater than 5 feet width. As the Minimum size of the
roll requirement is 5 feet.
89
Trim Loss / Cutting Stock Problem Formulation
Decision Variables
x1= number of rolls to cut as per setting 1
x2= number of rolls to cut as per setting 2
x3= number of rolls to cut as per setting 3
x4= number of rolls to cut as per setting 4
x5= number of rolls to cut as per setting 5
x6= number of rolls to cut as per setting 6
Objective Function
Minimize the total waste
z = 4x1+ 3x2 + 1x3 + 0x4 + 1x5 + 2x6
90
Trim Loss / Cutting Stock Problem Formulation
Constraints
0x1+ 2x2 + 2x3 + 4x4 + 1x5 + 0x6 ≥ 150 (Number of rolls of size 5 feet)
1x1+ 1x2 + 0x3 + 0x4 + 2x5 + 0x6 ≥ 200 (Number of rolls of size 7 feet)
1x1+ 0x2 + 1x3 + 0x4 + 0x5 + 2x6 ≥ 300 (Number of rolls of size 9 feet)
x1, x2, x3, x4, x5, x6 ≥ 0
91