Professional Documents
Culture Documents
SI-5101
Engineering Analysis
Linear Programming
BIEMO W. SOEMARDI
b.soemardi@itb.ac.id
01
Introduction to
Linear Programming
Models (Graphical)
2
Review Linear Programming
• An LP is a mathematical model for maximizing or minimizing a
linear function of a several variables, subject to a set of linear
constraints.
• The linear model consists of the following components:
• A set of decision variables.
• An objective function.
• A set of constraints.
▪ The output generated from linear programming packages provides
useful “what if” analysis.
3
Review Linear Programming
4
Return to Scale
• In a (production) system: the behavior of the rate of increase in
output (production) relative to the associated increase in the inputs.
• In economics, the quantitative change in output of a firm or industry
resulting from a proportionate increase in all inputs
• Constant Return to Scale (CRS): output increases by that same
proportional change as all inputs change
• Decreasing Return of Scale (DRS): output increases by less than that
proportional change in inputs
• Increasing Return to Scale (IRS): output increases by more than the
proportional change in inputs.
5
Return to Scale
6
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
8(450) + 5(100)
• The current production plan consists of:
Model-A = 450 dozen
Model-B = 100 dozen
Profit = $4100 per week
8
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
Problem: finding the best schedule (proportion) that yield the largest profit
Decision Variables:
X1 = weekly production level of Model-A
X2 = weekly production level of Model-B
Objective Function:
To maximized weekly profit
9
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
10
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
Graphical Model of Linear Modeling
• The set of all points that satisfy all the constraints of the model is called
a Feasible Region
• Using a graphical presentation we can represent all the constraints, the
objective function, and the three types of feasible points.
X2
X1 11
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
Graphical Model of Linear Modeling
12
Example
The RAID Industries Production Problem – Production Schedule
RENDER – STAIR - HANNA
Graphical Model of Linear Modeling
X2
1000 Start at some arbitrary profit, say profit = $2,000...
Then increase the profit, if possible.. ... and continue until it becomes infeasible
14
The Role of Sensitivity Analysis of the Optimal Solution
• Is the optimal solution sensitive to changes in input parameters?
• Possible reasons for asking this question:
− Parameter values used were only best estimates.
− Dynamic environment may cause changes.
− “What-if” analysis may provide economical and operational information.
• Range of Optimality
− The optimal solution will remain unchanged as long as:
• An objective function coefficient lies within its range of optimality
• There are no changes in any other input parameters.
− The value of the objective function will change if the coefficient
multiplies a variable whose value is nonzero.
15
Sensitivity Analysis of Objective Function Coefficients
X2
1000
Range of Optimality
• The optimal solution will remain
unchanged as long as
Range of optimality:
[3.75, 10] − An objective function coefficient lies
within its range of optimality
500
− There are no changes in any other
input parameters.
• The value of the objective function will
change if the coefficient multiplies a
variable whose value is nonzero.
X1
400 600 800
16
Sensitivity Analysis of - Right-Hand Side Values
Constraints 2X1 + 1X2 < 1000 (Plastic)
3X1 + 4X2 < 2400 (Production Time)
• In sensitivity analysis of right-hand sides of constraints, we are interested in
the following questions:
− Keeping all other factors the same, how much would the optimal value
of the objective function (for example, the profit) change if the right-
hand side of a constraint changed by one unit?
− For how many additional or fewer units will this per unit change be valid?
• Any change to the right-hand side of a binding constraint will change the
optimal solution.
• Any change to the right-hand side of a non-binding constraint that is less than
its slack or surplus, will cause no change in the optimal solution 17
02
Duality in
Linear Programming
18
Duality in Linear Programming
https://en.wikipedia.org/wiki/Dual_linear_program
19
Duality Theorem in Linear Programming
https://en.wikipedia.org/wiki/Dual_linear_program
The weak duality theorem says that, for each feasible solution x of the primal
and each feasible solution y of the dual: cTx ≤ bTy.
In other words, the objective value in each feasible solution of the dual is an
upper-bound on the objective value of the primal, and objective value in each
feasible solution of the primal is a lower-bound on the objective value of the
dual. This implies:
maxx cTx ≤ miny bTy
In particular, if the primal is unbounded (from above) then the dual has no
feasible solution, and if the dual is unbounded (from below) then the primal
has no feasible solution.
20
Duality Theorem in Linear Programming
https://en.wikipedia.org/wiki/Dual_linear_program
The strong duality theorem says that if one of the two problems has an optimal
solution, so does the other one and that the bounds given by the weak duality
theorem are tight, i.e.:
maxx cTx = miny bTy
The strong duality theorem is harder to prove; the proofs usually use the weak
duality theorem as a sub-routine..
21
Example of Duality in Linear Programming
https://en.wikipedia.org/wiki/Dual_linear_program
Consider the primal LP, with two variables and one constraint:
Applying the recipe above gives the following dual LP, with one variable
and two constraints:
22
03
Shadow Price in
Linear Programming
25
Shadow Prices
• Assuming there are no other changes to the input parameters, the change to
the objective function value per unit increase to a right-hand side of a
constraint is called the “Shadow Price”
26
Shadow Prices
• Sunk costs: The shadow price is the value of an extra unit of the
resource, since the cost of the resource is not included in the
calculation of the objective function coefficient.
27
Shadow Prices: Graphical Representation
The Plastic
constraint X2 When more plastic becomes available (the
plastic constraint is relaxed), the right-hand side
of the plastic constraint increases.
1000
Maximum profit = $4360
500
28
Analyzing Shadow Prices
Assuming there are no other changes to the input parameters, the range of
feasibility is:
− The range of values for a right-hand side of a constraint, in which the
shadow prices for the constraints remain unchanged.
− In the range of feasibility, the objective function value changes as follows:
29
Using Excel Solver
This cell contains the value
Set target cell of the objective function
equal to .. Max
Click on ‘Options’
and check ‘Linear
Programming’ and
‘Non-negative’.
30
04
Notes on
Linear Programming
Solutions
31
Infeasible Models
Objective Function
Infeasibility:
Occurs when a No point, simultaneously, lies both above
3 1
32
Unbounded Solution
Unboundness:
Occurs when
the objective
can become
infinitely large
(max), or
infinitely small
(min).
33
05
Analytic
Simplex Method
34
Linear Programming Model
X2
(0,0) (60,0) X1
35
Simplex Method:
• The first step of the simplex method requires that each inequality be
converted into an equation. ”less than or equal to” inequalities are
converted to equations by including slack variables.
• Slack variables represent the unused resources between the left-
hand side and right-hand side of each inequality. It is mathematical
representation of surplus resources,
• In real life problems, it’s unlikely that all resources will be used
completely, so there usually are unused resources
36
Simplex Method:
Initialization
(Find initial CPF solution)
No
Stop
Move to a better
adjacent CPF solution
40
Simplex Procedure:
Steps to solve a linear programming problem in standard form
1. Convert each inequality in the set of constraints to an equation by adding slack
variables.
2. Create the initial simplex tableau.
3. Select the pivot column. (The column with the “most negative value” element in the
last row.)
4. Select the pivot row. (The row with the smallest non-negative result when the last
element in the row is divided by the corresponding in the pivot column.)
5. Use elementary row operations calculate new values for the pivot row so that the
pivot is 1 (Divide every number in the row by the pivot number.)
6. Use elementary row operations to make all numbers in the pivot column equal to 0
except for the pivot number. If all entries in the bottom row are zero or positive, this
the final tableau. If not, go back to step 3.
7. If you obtain a final tableau, then the linear programming problem has a maximum
solution, which is given by the entry in the lower-right corner of the tableau. 41
Simplex Procedure:
The PIVOT table
Pivot Number: The element in both the pivot column and the pivot row.
42
Simplex Tableau:
Maximize Z = 70X1+ 50X2 + 0S1 + 0S2
subject to 4X1+ 3X2 + S1 = 240
2X1+ X2 + S2 = 100
x1, x2 = 0
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 1 -70 -50 0 0 0
s1 4 3 1 0 240
s2 2 1 0 1 100
43
Simplex Tableau:
Select the pivot column (determine which variable to enter into the solution mix).
Choose the column with the “most negative” element in the objective function row.
x1 should enter into the solution mix because each unit of product A contributes a
profit of $70 compared with only $50 for each unit of product B
Pivot Column
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 1 -70 -50 0 0 0
s1 4 3 1 0 240
s2 2 1 0 1 100
44
Simplex Tableau:
Select the pivot row (determine which variable to replace in the
solution mix). The pivot row is the row with the smallest non-
negative result.
Pivot Column
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 1 -70 -50 0 0 0
s1 4 3 1 0 240 240/4 = 60
s2 2 1 0 1 100 100/2 = 50
Pivot Row
Pivot Point
45
Simplex Tableau:
Divide the last element in each row by the corresponding element in the pivot column.
Should be replaced by x1 in the solution mix.
60 product A can be made with 240 unused production hours but only 50 product B can be
made with 100 finishing hours. Therefore, we decide to make 50 product A.
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 1 -70 -50 0 0 0
s1 4 3 1 0 240
X1 1 1/2 0 1/2 50
Calculate new values for the pivot row. Divide every number in the row by the pivot number.
46
Simplex Tableau:
Use row operations to make all numbers in the pivot column equal to 0 except for the pivot
number which remains as 1.
If 50 product A are made, then the unused production hours are reduced by 200 hours (4
h/product A multiplied by 50 units); the value changes from 240 hours to 40 hours.
Making 50 product A results in the profit being increased by $3500; the value changes from
$0 to $3500.
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 0 0 -15 0 35 3500
s1 0 0 1 1 -2 40
X1 0 1 1/2 0 1/2 50
Basic
variable
Z x1 x2 s1 s2 r.h.s.
Z 1 0 -15 0 35 3500
new
pivot 40/1 = 40
row s1 0 0 1 1 -2 40
48
Simplex Tableau:
2X1+ X2 + S2 = 100
x1, x2 = 0
15.R1 + R3
1
− .R1 + R2
2
49
Simplex Tableau:
Z 1 0 0 15 5 4100
X2 0 0 1 1 -2 40
X1 0 1 0 -1/2 3/2 30
x1 = 30, x2 = 40, s1 = 0, s2 = 0
If 40 product B are made, then the number of product A are reduced by 20 unit (1/2 A/B
multiplied by 40 B); the value changes from 50 product A to 30 product A. The replacement
of 20 product A by 40 product B results in the profit being increased by $600; the value
changes from $3500 to $4100.
X1 = 30 (unit product A)
X2 = 40 (unit product B)
Z = $ 4,100 51
The Dual Problem:
Minimization with problem constraints of the form >
52
The Dual Problem
Thus, the dual problem uses exactly the same parameters as the primal problem,
but in different locations. To highlight the comparison, now look at these same
two problems in matrix notation.
Primal Problem Dual Problem
Minimize Z = cx Maximize W = yb
Subject to Ax ≥ b Subject to yA c
and X ≥0 and Y ≥0
Primal Problem in
Primal problem Consequently,
Dual problem
(1) the parameters for
Dual Problem ina alg
algebraic form form
Minimize C=3x1+5x2
constraint in either problem are
Maximize
the Z=4y1+1
1 0 4 coefficient
1 0 in 3the3other problem, and
Subject to x1 ≥ 4 A= 0 2 12 T
(2)
A = the
0 coefficients
2 2 5 for the objective
Subject to y1+3
2x2 ≥ 12 4 12 18 1 problem are the 2y2+2
3 2 18 function of either
3x1+2x2 ≥18
3 5 1 right-sides for the other problem
and y1≥0 , y2≥0 ,y3≥0
and x1≥0, x2≥0
Primal Dual
Maximize. Minimize
55
06
Integer Programming
Goal Programming
56
Integer Programming Model
• Quite too often that optimization problems require the solution to be
real values but limited to non-negative integer values.
• An Integer Programming model is a linear programming problem where
some or all of the variables are required to be non-negative integers.
▪ Recall RAID industry:
O.F. : Max: Z = 8X1 + 5X2 (Weekly profit)
subject to:
2X1 + 1X2 < 1000 (Plastic)
3X1 + 4X2 < 2400 (Production Time)
X1 + X2 < 700 (Total production)
X1 - X2 < 350 (Mix)
X1, X2 ≠ 0, X1 and X2 integer
57
Classification of Integer Programming Model
Pure IP Model: where all variables must take integer values.
Maximize z = 8x1 + 5x2
subject to 2x1 + x2 < 1000; x1 + x2 < 700;
……………….
x1, x2 ≠ 0, x1 and x2 integer
Mixed IP Model: where some variables must be integer while others can take real values.
Maximize z = 3x1 + 2x2
subject to 2x1 + x2 < 1000; x1 + x2 < 700;
……………….
x1, x2 ≠ 0, x1 integer
0-1 IP Model: where all variables must take values 0 or 1 .
Maximize z = x1 - x2
subject to x1 + 2x2 < 2
2x1 - x2 < 1, x1, x2 = 0 or 1 58
Simple Approaches for Solving IP Problem
Approach 1:
• Enumerate all possible solutions
• Determine their objective function values
• Select the solution with the maximum (or, minimum) value.
Any potential difficulty with this approach?
Approach 2:
• Solve the LP relaxation
• Round-off the solution to the nearest feasible integer solution.
Any potential difficulty with this approach?
59
Graphical Solution IP Problem (RAID Industry)
X2
Infeasible
1000 The Plastic
constraint: 2X1+X2 <
700 1000
Total production
constraint: X1+X2 < 700
500 (redundant)
800
600
200 1 = 200
X1
200 400 600 800 1000 1200
62
Goal Programming Model
• Goal programming is a variation of linear programming considering more
than one objective (goals) in the objective function.
• Multiple goals are arranged in order of importance.
• Goal Constraint Requirements
− All goal constraints are equalities that include deviational variables d- and d+.
− A positive deviational variable (d+) is the amount by which a goal level is
exceeded.
− A negative deviation variable (d-) is the amount by which a goal level is
underachieved.
− At least one or both deviational variables in a goal constraint must equal zero.
− The objective function in a goal programming model seeks to minimize the
deviation from goals in the order of the goal priorities.
63
Goal Programming: Model Formulation
Beaver Creek Pottery Company Example:
Maximize Z = $40x1 + 50x2
subject to:
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0
Where: x1 = number of bowls produced
x2 = number of mugs produced
64
Goal Programming: Model Formulation
Adding objectives (goals) in order of importance, the company:
• Does not want to use fewer than 40 hours of labor per day.
• Would like to achieve a satisfactory profit level of $1,600 per day.
• Prefers not to keep more than 120 pounds of clay on hand each day.
• Would like to minimize the amount of overtime.
65
Goal Constraints and Objective Function
▪ Labor goals constraint (1, less than 40 hours labor; 4, minimum overtime):
− Minimize P1d1-, P4d1+
▪ Add profit goal constraint (2, achieve profit of $1,600):
− Minimize P1d1-, P2d2-, P4d1+
▪ Add material goal constraint (3, avoid keeping more than 120 pounds of clay on
hand):
− Minimize P1d1-, P2d2-, P3d3+, P4d1+
66
Goal Constraints and Objective Function
67
Goal Constraints and Objective Function
Alternative Forms of Goal Constraints
68
Goal Constraints and Objective Function
Alternative Forms of Goal Constraints
Goal Constraints 70
Goal Programming: Graphical Interpretation
76