You are on page 1of 35

2/20/2018

Systems Analysis in
Construction
CB312
Construction & Building Engineering Department- AASTMT

by

Ahmed Elhakeem & Mohamed Saied

3. Linear Programming
Optimization
Graphical Solution
Simplex Method
Network Models
68

1
2/20/2018

Introduction to LP
• Linear Programming Problem
• Problem Formulation
• A Maximization Problem
• Graphical Solution Procedure
• Extreme Points and the Optimal Solution
• A Minimization Problem
• Special Cases
• Introduction to Sensitivity Analysis
• Graphical Sensitivity Analysis
69

Introduction to LP
• If both the objective function and the constraints are linear,
the problem is referred to as a linear programming
problem.
• Linear functions are functions in which each variable
appears in a separate term raised to the first power and is
multiplied by a constant (which could be 0).
• Linear constraints are linear functions that are restricted to
be "less than or equal to", "equal to", or "greater than or
equal to" a constant.

70

2
2/20/2018

Introduction to LP
• 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).
• A graphical solution method can be used to solve a linear
program with two variables.
71

Introduction to LP

72

3
2/20/2018

Introduction to LP

73

Introduction to LP
• Is the most widely used of these mathematical methods (for
optimization).
• All relationships considered in L.P. must be linear functions.

Max 3X1+5X2- 3X3 Max 3X1+5X2- 3X3


S.T. 2 X1+ X 2 <12 S.T. 2X1+ X2 <12
X2- X3 >10 X2 - X1X3 >10

74

4
2/20/2018

Introduction to LP
• In Appling L.P. we should have:
• A set of linear constraints (equations);
• A linear objective function which is to be maximized or minimized; and
• A set of variables that affect both the objective function and the constraints.

Maximized Cost Time Distance

Or
Profit Efficiency ROR
Minimized

75

Problem Formulation
Problem formulation or modeling is the process of translating a
verbal statement of a problem into a mathematical statement.

Max 100x1 + 200x2


s.t. 2x1 + 3x2 < 2000
x1 > 60
x2 < 720
x2 > 0

76

5
2/20/2018

Problem Formulation Guidelines

• Understand the problem thoroughly.


• Describe the objective.
• Describe each constraint.
• Define the decision variables.
• Write the objective in terms of the decision variables.
• Write the constraints in terms of the decision variables.

77

Example 1: Graphical Solution max


• LP Formulation

Max 5 x1 + 7 x2

s.t. 1 x1 + 0 x2 < 6
2 x1 + 3 x2 < 19
1 x1 + 1 x2 < 8

x1 , x2 >0

78

6
2/20/2018

Example 1: Graphical Solution max


• Constraint #1 Graphed • Constraint #2 Graphed

x2 x2

8 8 (0, 6 1/3)
7
7
x1 < 6
6 6

5 5
4 2x1 + 3x2 < 19
4
3 3

2 (6, 0)
2 (9 1/2, 0)
1 1
x1 x1
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

79

Example 1: Graphical Solution max


• Constraint #3 Graphed • Combined-Constrains Graph

x2 x2
(0, 8)
x1 + x2 < 8
8 8
7 x1 + x2 < 8 7
x1 < 6
6 6
5 5
4 4
3 3 2x1 + 3x2 < 19
2 2
1 (8, 0) 1

1 2 3 4 5 6 7 8 9 10
x1 1 2 3 4 5 6 7 8 9 10
x1

80

7
2/20/2018

Example 1: Graphical Solution max


• Feasible Region • Objective Function Line

x2 x2

8 8
7 7 (0, 5)
6 6
5 5
4 4
3 3
Feasible
2 2
Region (7, 0)
1 1
x1 x1
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

81

Example 1: Graphical Solution max


• Optimal Solution

82

8
2/20/2018

Summary of Graphical Solution


• Prepare a graph of the feasible solutions for each of the
constraints.
• Determine the feasible region that satisfies all the
constraints simultaneously.
• Draw an objective function line.
• Move parallel objective function lines toward larger
objective function values without entirely leaving the
feasible region.
• Any feasible solution on the objective function line with the
largest value is an optimal solution.
83

Extreme Points & 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.

84

9
2/20/2018

Extreme Points

85

Example 2: A Minimization Problem


• LP Formulation

Min 5x1 + 2x2

s.t. 2x1 + 5x2 > 10


4x1 - x2 > 12
x1 + x2 > 4
x1, x2 > 0

86

10
2/20/2018

Example 2: A Minimization Problem


• Graph the Constraints
Constraint 1: When x1 = 0, then x2 = 2; when x2 = 0, then x1 = 5.
Connect (5,0) and (0,2). The ">" side is above this line.
Constraint 2: When x2 = 0, then x1 = 3. But setting x1 to 0 will yield
x2 = -12, which is not on the graph. Thus, to get a second point on
this line, set x1 to any number larger than 3 and solve for x2: when
x1 = 5, then x2 = 8. Connect (3,0) and (5,8). The ">" side is to the
right.
Constraint 3: When x1 = 0, then x2 = 4; when x2 = 0, then x1 = 4.
Connect (4,0) and (0,4). The ">" side is above this line.

87

Example 2: A Minimization Problem


• Graph the Objective Function
Set the objective function equal to an
x2 arbitrary constant (say 20) and graph it.
For 5x1 + 2x2 = 20, when x1 = 0, then x2 =
4x1 - x2 > 12
5 10; when x2= 0, then x1 = 4. Connect
4 x1 + x2 > 4 (4,0) and (0,10).
Feasible
3
Region
2x1 + 5x2 > 10
• Move the Objective Function Line
2 Toward Optimality
1 Move it in the direction which lowers its
x1 value (down), since we are minimizing,
until it touches the last point of the
1 2 3 4 5 6

feasible region, determined by the last


two constraints.
88

11
2/20/2018

Example 2: A Minimization Problem

x2 Min z = 5x1 + 2x2 x2

4x1 - x2 > 12
5 5

4 x1 + x2 > 4 4

3 3
2x1 + 5x2 > 10
2 2

1 1
x1 x1
1 2 3 4 5 6 1 2 3 4 5 6

89

Example 2: A Minimization Problem

• Solve for the Extreme Point at the Intersection of the Two


Binding Constraints
4x1 - x2 = 12
x1+ x2 = 4
Adding these two equations gives:
5x1 = 16 or x1 = 16/5.
Substituting this into x1 + x2 = 4 gives: x2 = 4/5

90

12
2/20/2018

Example 2: A Minimization Problem


• Solve for the Optimal Value of the Objective
Function

Solve for z = 5x1 + 2x2 = 5(16/5) + 2(4/5) = 88/5.


Thus the optimal solution is
x1 = 16/5; x2 = 4/5; z = 88/5

91

Example 3: Solve
• Solve graphically for the optimal solution:

Max 2 x1 + 6 x2
s.t. 4x1 + 3x2 < 12
2 x1 + x2 > 8
x1 , x2 > 0

92

13
2/20/2018

Example 3: Solve
• There are no points that satisfy both constraints, hence this
problem has no feasible region, and no optimal solution.

Infeasible Problem
93

Example 4: Solve
• Solve graphically for the optimal solution:

Max 3x1 + 4x2


s.t. x1 + x2 > 5
3 x1 + x2 > 8
x1 , x2 > 0

94

14
2/20/2018

Example 4: Solve
• The feasible region is unbounded and the objective function
line can be moved parallel to itself without bound so that z
can be increased infinitely.

Unbounded Problem
95

Feasible Region
• The feasible region for a two-variable LP problem can be
nonexistent, a single point, a line, a polygon, or an
unbounded area.
• Any linear program falls in one of three categories:
• is infeasible
• has a unique optimal solution or alternate optimal solutions
• has an objective function that can be increased without bound
• A feasible region may be unbounded and yet there may be
optimal solutions. This is common in minimization
problems and is possible in maximization problems.
96

15
2/20/2018

Special Cases
• Alternative Optimal Solutions
In the graphical method, if the objective function line is parallel to a
boundary constraint in the direction of optimization, there are
alternate optimal solutions, with all points on this line segment being
optimal.
• Infeasibility
A linear program which is over constrained so that no point satisfies
all the constraints is said to be infeasible.
• Unboundedness

97

Extra Examples: E1

98

16
2/20/2018

Extra Examples: E1 Solution

99

Extra Examples: E1 Solution

100

17
2/20/2018

Extra Examples: E1 Solution

If 2X + Y = 10  Y=0
X=0
X=5
Y = 10

If 2X + Y = 20 
Y=0 X = 10
X=0 Y = 20

• This represents two parallel lines for the objective function


with increasing trend in the objective value, as shown:
101

Extra Examples: E1 Solution

102

18
2/20/2018

Extra Examples: E1 Solution

Max Production: at X = 10 and Y = 12


Production = 2 ×10 + 12 = 32 Units.
103

Extra Examples: E2
• A builder has a hydraulic press.
• The press produce 125 slabs/day
• Unpressed precast slabs to produce 200 slabs/day

8 men are needed to produce 100


• He has 18 men precast slabs
4 men are needed to produce 100
hydraulically pressed slabs

$8 /100 precast concrete


• Profit
$6 /100 pressed slabs

104

19
2/20/2018

Extra Examples: E2 Solution

• Assume S1 daily production of precast slabs (in hundred)


• Assume S2 daily production of hydraulic pressed slabs (in hundred)
• Linear constraints:

S1 ≤ 2
S2 ≤ 1.25
8 S1 + 4 S2 ≤ 18

• Objective function: maximize 8 S1 + 6 S2

105

Extra Examples: E2 Solution


• Graph:
S1 ≥ 0 S2 ≥ 0
S1 ≤ 2 S2 ≤ 1.25
• 8 S1 + 4 S2 = 18
If S1 = 0  S2 = 4.5
If S2 = 0  S1 = 2.25
• Assume profit = 10  8 S1 + 6 S2 = 10
If S1 = 0  S2 = 1.66
If S2 = 0  S1 =1.25
• Assume profit = 12  8 S1 + 6 S2 = 12
If S1 = 0  S2 =2
If S2 = 0  S1 =1.5

106

20
2/20/2018

Extra Examples: E2 Solution


• The greatest profit at point B
Where: S2 = 1.25  8 S1 + 4 S2 = 18
8 S1 = 13  S1 = 1.625
• Profit = 8 S1 + 6 S2
8 × 1.625 + 6 (1.25) = $ 20.5 per day.

• If he makes 125 S2 (pressed slabs) & 162.5 S1 (precast slabs)

107

Sensitivity & Interpretation of Solution

• Introduction to Sensitivity Analysis


• Graphical Sensitivity Analysis
• Simultaneous Changes
• Sensitivity Analysis: Computer Solution

108

21
2/20/2018

Sensitivity Analysis
• Sensitivity analysis (or post-optimality analysis) is used to
determine how the optimal solution is affected by changes,
within specified ranges, in:
• the objective function coefficients
• the right-hand side (RHS) values
• Sensitivity analysis is important to the manager who must
operate in a dynamic environment with imprecise estimates
of the coefficients.
• Sensitivity analysis allows to ask certain what-if questions
about the problem.
109

Sensitivity Analysis

Max 5x1 + 7x2

s.t. x1 < 6
2x1 + 3x2 < 19
x1 + x2 < 8
x1 , x2 > 0

110

22
2/20/2018

Sensitivity Analysis
Objective Function Coefficients
• Let us consider how changes in the objective function
coefficients might affect the optimal solution.
• The range of optimality for each coefficient provides the
range of values over which the current solution will remain
optimal.
• Managers should focus on those objective coefficients that
have a narrow range of optimality and coefficients near the
endpoints of the range.
111

Sensitivity Analysis
• Changing Slope of Objective Function

Max 5 x1 + 7 x2
Slope -5/7

112

23
2/20/2018

Sensitivity Analysis
• Changing Slope of Objective Function

123

Sensitivity Analysis
Range of Optimality
• Graphically, the limits of a range of optimality are found
by changing the slope of the objective function line
within the limits of the slopes of the binding constraint
lines.
• The slope of an objective function line, Max c1x1 + c2x2,
is -c1/c2, and the slope of a constraint, a1x1 + a2x2 = b, is
-a1/a2.

114

24
2/20/2018

Example 1

Max 5x1 + 7x2

s.t. x1 < 6
2x1 + 3x2 < 19
x1 + x2 < 8
x1 , x2 > 0

115

Example 1 Solution
• Range of Optimality for c1
The slope of the objective function line is -c1/c2. The slope of the
first binding constraint, x1 + x2 = 8, is -1/1 and the slope of the
second binding constraint, 2x1 + 3x2 = 19, is -2/3.
Find the range of values for c1 (with c2 staying 7) such that the
objective function line slope lies between that of the two binding
constraints: -C1/7
-1 < -c1/7 < -2/3
-1/1 -2/3

Multiplying through by -7 (and reversing the inequalities):


14/3 < c1 < 7
116

25
2/20/2018

Example 1 Solution
• Range of Optimality for c2
Find the range of values for c2 ( with c1 staying 5) such that the
objective function line slope lies between that of the two binding
constraints:
-1 < -5/c2 < -2/3

Multiplying by -1: 1 > 5/c2 > 2/3


Inverting, 1 < c2/5 < 3/2

Multiplying by 5: 5 < c2 < 15/2

117

Computer Solution
• Computer programs designed to solve LP problems are now
widely available.
• Most large LP problems can be solved with just a few
minutes of computer time.
• Small LP problems usually require only a few seconds.
• Linear programming solvers are now part of many
spreadsheet packages, such as Microsoft Excel.

118

26
2/20/2018

Excel Solution understanding

Max 5x1 + 7x2

s.t. x1 < 6
2x1 + 3x2 < 19
x1 + x2 < 8
x1 , x2 > 0

119

Example 2: Olympic Bike Co.


Olympic Bike is introducing two new lightweight bicycle
frames, the Deluxe and the Professional, to be made
from special aluminum and steel alloys. The anticipated
unit
profits are $10 for the Deluxe
and $15 for the Professional.
The number of pounds of
each alloy needed per
frame is summarized as follows:
120

27
2/20/2018

Example 2: Olympic Bike Co.

A supplier delivers 100 pounds of the aluminum alloy and 80


pounds of the steel alloy weekly.

Aluminum Alloy Steel Alloy


Deluxe 2 3
Professional 4 2

How many Deluxe and Professional frames should


Olympic produce each week?
121

Example 2: Olympic Bike Co.


• Model Formulation

• Verbal Statement of the Objective Function


Maximize total weekly profit.
• Verbal Statement of the Constraints
Total weekly usage of aluminum alloy < 100 pounds.
Total weekly usage of steel alloy < 80 pounds.
• Definition of the Decision Variables
x1 = number of Deluxe frames produced weekly.
x2 = number of Professional frames produced weekly.
122

28
2/20/2018

Example 2: Olympic Bike Co.


• Model Formulation (continued)

Max 10x1 + 15x2 (Total Weekly Profit)

s.t. 2x1 + 4x2 < 100 (Aluminum Available)


3x1 + 2x2 < 80 (Steel Available)

x1, x2 > 0

123

Example 2: Olympic Bike Co.


• Partial Spreadsheet Showing Solution
A B C D
6 Decision Variables
7 Deluxe Professional
8 Bikes Made 15 17.500
9
10 Maximized Total Profit 412.500
11
12 Constraints Amount Used Amount Avail.
13 Aluminum 100 <= 100
14 Steel 80 <= 80

124

29
2/20/2018

Example 2: Olympic Bike Co.


• Optimal Solution
According to the output:
x1 (Deluxe frames) = 15
x2 (Professional frames) = 17.5
Objective function value = $412.50

125

Example 2: Olympic Bike Co.


• Range of Optimality

Question
Suppose the profit on deluxe frames is increased to $20. Is
the above solution still optimal? What is the value of the
objective function when this unit profit is increased to
$20?

126

30
2/20/2018

Example 2: Olympic Bike Co.


• Sensitivity Report

Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$8 Deluxe 15 0 10 12.5 2.5
$C$8 Profess. 17.500 0.000 15 5 8.33333333

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$B$13 Aluminum 100 3.125 100 60 46.66666667
$B$14 Steel 80 1.25 80 70 30
127

Example 2: Olympic Bike Co.

• Range of Optimality

Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between
7.5 and 22.5. Since 20 is within this range, the optimal
solution will not change. The optimal profit will change:
20x1 + 15x2 = 20(15) + 15(17.5) = $562.50.

128

31
2/20/2018

Example 2: Olympic Bike Co.

• Range of Optimality

Question
If the unit profit on deluxe frames were $6 instead of $10,
would the optimal solution change?

129

Example 2: Olympic Bike Co.


• Range of Optimality

Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$8 Deluxe 15 0 10 12.5 2.5
$C$8 Profess. 17.500 0.000 15 5 8.33333333

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$B$13 Aluminum 100 3.125 100 60 46.66666667
$B$14 Steel 80 1.25 80 70 30
130

32
2/20/2018

Example 2: Olympic Bike Co.

• Range of Optimality

Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between
7.5 and 22.5. Since 6 is outside this range, the optimal
solution would change.

131

Range of Optimality & 100% Rule

The 100% rule states that simultaneous changes in


objective function coefficients will not change the
optimal solution as long as the sum of the percentages
of the change divided by the corresponding maximum
allowable change in the range of optimality for each
coefficient does not exceed 100%.

132

33
2/20/2018

Example 2: Olympic Bike Co.


• Range of Optimality and 100% Rule

Question
If simultaneously the profit on Deluxe frames was raised to
$16 and the profit on Professional frames was raised to $17,
would the current solution be optimal?

133

Example 2: Olympic Bike Co.


Answer

If c1 = 16, the amount c1 changed is 16 - 10 = 6 . The


maximum allowable increase is 22.5 - 10 = 12.5, so this is a
6/12.5 = 48% change. If c2 = 17, the amount that c2
changed is 17 - 15 = 2. The maximum allowable increase is
20 - 15 = 5 so this is a 2/5 = 40% change. The sum of the
change percentages is 88%. Since this does not exceed
100%, the optimal solution would not change.

134

34
2/20/2018

END of Graphical Sol.

?
3. Linear Programming
Optimization
Simplex Method

135

35

You might also like