4. Linear Programming (1)
4. Linear Programming (1)
University of Gondar
MSc in Construction
Engineering and Management
Linear Programming
March, 2023.
LINEAR PROGRAMMING
History of LP
▪ US Air Force investigate applying mathematical techniques
to military budgeting and planning
▪ George Dantzig proposed LP model
▪ Air Force initiated project SCOOP (Scientific Computing of
Optimum Programs) and SCOOP began in June 1947,
Dantzig and associates developed:
✓ An initial mathematical model of the general linear programming
problem
✓ A general method of solution called the simplex method.
1
3/25/2023
LINEAR PROGRAMMING
Why LP?
▪ Most popular optimization technique
LP ASSUMPTION
▪ The preferred solution is the one that optimizes the objective and
satisfies the constraints.
2
3/25/2023
LINEAR PROGRAMMING
▪ Mathematical Model
▪ Decision variables
✓ Minimization
▪ linear constraints
✓ Inequalities LE or GE
✓ Equation =
▪ Non-negativity constraints
LINEAR PROGRAMMING
3
3/25/2023
▪ Constraints:
s.t. a11x1 + a12x2 +……+ a1nxn ≤ b1
a21x1 + a22x2 +……+ a2nxn ≤ b2
am1x1 + am2x2 +……+ amnxn ≤ bm
4
3/25/2023
FORMULATION OF LP PROBLEM
▪ An Example of LP model:
Maximize Z = 2x1 + 3x2 – 3x3
Subjected to:
3x1 - x2 + 2x3 ≤ 7
x1 - 2x3 ≤ 4
2x1 + 2x2 + x3 ≤ 8
3x1 ≤ 5
x1, x2, x3 ≥ 0
OTHER FORMS
1. Minimization problems
5
3/25/2023
GRAPHICAL METHOD
GRAPHICAL METHOD
6
3/25/2023
Maximization Example
Resource Requirements
Resource Requirements
Bowl 1 4 40
Mug 2 3 50
7
3/25/2023
X2 is mugs
X1 is bowls
Labor Constraint
8
3/25/2023
9
3/25/2023
Both Constraints
10
3/25/2023
11
3/25/2023
EXAMPLE
EXAMPLE
12
3/25/2023
EXAMPLE
✓ Determine what the production rates should be for the two products in
order to maximize their total profit, subject to the restrictions imposed by
the limited production capacities available in the three plants. (Each
product will be produced in batches of 20, so the production rate is defined
as the number of batches produced per week.) Any combination of
production rates that satisfies these restrictions is permitted, including
producing none of one product and as much as possible of the other.
EXAMPLE
13
3/25/2023
EXAMPLE
EXAMPLE
14
3/25/2023
EXAMPLE
Thus, x1 and x2 are the decision variables for the model. Using the
bottom row of Table, we obtain
EXAMPLE
15
3/25/2023
EXAMPLE
Graphical Solution
EXAMPLE
16
3/25/2023
EXAMPLE
The Wyndor Glass Co. problem would have no feasible solutions if the
constraint 3x1 + 5x2 50 were added to the problem.
EXAMPLE
The Wyndor Glass Co. problem would have Multiple Optimal solutions if the
objective function were changed to Z = 3x1 + 2x2
17
3/25/2023
EXAMPLE
The Wyndor Glass Co. problem would have No Optimal solutions if the only
functional constraint were x1 4, because x2 then could be increased
indefinitely in the feasible region without ever reaching the maximum value of
Z = 3x1 + 5x2
NOTES
▪ As in this case, any problem having multiple optimal solutions will have an
infinite number of them, each with the same optimal value of the objective
function.
▪ Another possibility is that a problem has no optimal solutions. This occurs only
if (1) it has no feasible solutions or (2) the constraints do not prevent improving
the value of the objective function (Z) indefinitely in the favorable direction
(positive or negative). The latter case is referred to as having an unbounded Z.
▪ A corner-point feasible (CPF) solution is a solution that lies at a corner of the
feasible region.
▪ Relationship between optimal solutions and CPF solutions: Consider any
linear programming problem with feasible solutions and a bounded feasible
region. The problem must possess CPF solutions and at least one optimal
solution. Furthermore, the best CPF solution must be an optimal solution.
▪ If a problem has exactly one optimal solution, it must be a CPF solution.
▪ If the problem has multiple optimal solutions, at least two must be CPF
solutions.
18
3/25/2023
GRAPHICAL METHOD
▪ LP model formulation:
19
3/25/2023
SOLUTION
20
3/25/2023
▪ Say c=40
LP SOLUTIONS
▪ 4) unbounded solutions.
21
3/25/2023
22
3/25/2023
NO FEASIBLE SOLUTION
▪ 5x1 + 5x2 ≤ 50
▪ x1 ≥ 8
▪ x2 ≥ 6
UNBOUNDED SOLUTION
▪ 5x1 + 5x2 ≥ 50
▪ x1≤ 8
▪ x1≥ 6
23
3/25/2023
EXAMPLE 3
SOLUTION
24
3/25/2023
SOLUTION
▪ Optimum solution:
✓ x1 = 750
✓ x2 = 250
▪ Amount of gravel = 300m3
from in situ
▪ Amount of sand = 700 m3;
450 m3 from in situ and
250 m3 from outside.
25
3/25/2023
EXERCISE
SIMPLEX METHOD
26
3/25/2023
▪ The new variable is known as the slack variable (Loose) added left
in the process of satisfying the objective function in ≤ (Sj or Xj or
any letter)
27
3/25/2023
𝑥1 + 2𝑥2 ≤ 5 𝑥1 , 𝑥2 , 𝑆1, 𝑆2 ≥ 0
𝑥1 , 𝑥2 ≥ 0
▪ What will be the surpluses
direction
If the sign in equations was ≥ sign?
EXAMPLE OF LP
28
3/25/2023
Demonstration
29
3/25/2023
SIMPLEX METHOD
STANDARD FORM
30
3/25/2023
SOME DEFINITIONS
▪ Constraint boundaries
▪ Feasible region
X2 ▪ Corner-point feasible (CPF)
(0,9)
solutions
▪ Adjacent CPF solutions
(0,6) (2,6) (4,6)
▪ Edges of the feasible region
31
3/25/2023
The tabular form of the simplex method records only the essential
information, namely,
(1) the coefficients of the variables
(2) the constants on the right-hand sides of the equations and
(3) the basic variable appearing in each equation.
32
3/25/2023
▪ Entering variable: the variable entering the basis is the one with
the most negative coefficient in the z-row. It will contribute to the
increase of OF most.
▪ The one basic variable to leave is the one which gives the
minimum ratio test by applying those pivot column coef. That are
strictly positive..
33
3/25/2023
Mathematical Procedures
Use the simple Gauss-Jordan row operations
1. Pivot row
a. Replace the leaving variable in the Basic column with the entering
variable.
cj c1 c2 c3 c4 c5
0 S2
0 S3
Zj
Cj - Zj
34
3/25/2023
Maximization Problem
cj c1 c2 c3 c4 c5
Zj Row
• The Zj-value under b-column represents the current profit.
• Other values in the Zj row represent the amount by which contribution
(profit) would be reduced if one unit of the corresponding variable x1, x2 etc
was added to the basis column.
• They represent the contribution lost per unit of the variables.
Maximization Problem
cj c1 c2 c3 c4 c5
The Cj - Zj row
• The Cj - Zj row is called a base row or the Net Evaluation Row (NER).
• Coefficients in this row represent the net marginal improvement in the value of the
objective function Z for each unit of the respective column variable introduced into
the solution.
• This row determines whether the current solution is optimal or not.
35
3/25/2023
EXAMPLE
36
3/25/2023
Cj 5 4 0 0 0 0 RHS Ratio
β x1 x2 S1 S2 S3 S4
Pivot Row 24/6 =
0 S1 6 4 1 0 0 0 24 4
leaving Variable
Initial 0 S2 1 2 0 1 0 0 6 6/1 =6
Iteration 1/-1
0 S3 -1 1 0 0 1 0 1 (ignore
zj 0 0 0 0 0
cj-zj 5 4 0 0 0
Pivot column coefficient
Cj 5 4 0 0 0 0 RHS
β x1 x2 S1 S2 S3 S4
0 S1 6 4 1 0 0 0 24
0 S2 1 2 0 1 0 0 6
Initial Iteration 0 S3 -1 1 0 0 1
X1 entering row0=leaving row/pivot
1 element
0 S4 0 1 0 0 0 1 2
zj 0 0 0 0 0 x4 - (its coefficint* x1 entering row)
x4 = old
cj-zj 5 4 0 0 0
x5 = old x5 - (its coefficint* x1 entering row)
Cj 5 4 0 0 0 0 RHS ǿ
β x1 x2 S1 S2
x6S3= old x6 S4
- (its coefficint* x1 entering row)
5 x1 1 2/3 1/6 0 0 0 4 6
0 S2 0 1 1/3 - 1/6 1 0 0 2 1 1/2
Initial Iteration 2
0 S3 0 1 2/3 1/6 0 1 0 5 3
0 S4 0 1 0 0 0 1 2 2
zj 5 3 1/3 5/6 0 0 0 20
cj-zj 0 2/3 - 5/6 0 0 0
Cj 5 4 0 0 0 0 RHS ǿ
β x1 x2 S1 S2 S3 S4
5 x1 1 0 1/4 - 1/2 0 0 3
4 x2 0 1 - 1/8 3/4 0 0 1 1/2
Initial Iteration 3
0 S3 0 0 3/8 -1 1/4 1 0 -2 1/2
0 S4 0 0 1/8 - 3/4 0 1 1/2
zj 5 4 3/4 1/2 0 0 21
cj-zj 0 0 - 3/4 - 1/2 0 0
37
3/25/2023
PROBLEM
S.T
X1 + x2 ≤ 5
3x1 + 2x2 ≤ 12
X1, x2 ≥ 0
PROBLEM
38
3/25/2023
Cj 6 5 0 0 RHS ǿ
β x1 x2 S1 S2
NW = old -
Initial Iteration 1 0 S1 0 1/3 1 - 1/3 1 coef*pr
6 x1 1 2/3 0 1/3 4 PR =old/pc
zj 6 4 0 2 24
cj-zj 0 1 0 -2
Cj 6 5 0 0 RHS ǿ
β x1 x2 S1 S2
0 S1 0 1/3 1 - 1/3 1 3
Initial Iteration 1
6 x1 1 2/3 0 1/3 4 6
zj 6 4 0 2 24
cj-zj 0 1 0 -2
Cj 6 5 0 0 RHS ǿ
β x1 x2 S1 S2
5 x2 0 1 3 -1 3
Initial Iteration 2
6 x1 1 0 -2 1 2
zj 6 5 3 1 27
cj-zj 0 0 -3 -1
CLASS ACTIVITY
39
3/25/2023
Exercise
SPECIAL CASES
40
3/25/2023
▪ Max x1 + x2
S.t. 2x1 + x2 ≤ 4
x1 + 2x2 ≤ 3
x1 ≥ 0; x2 ≥ 0
41
3/25/2023
MULTIPLE SOLUTIONS
EXAMPLE
▪ Max. x1+1/2x2
S.t. 2x1 + x2 ≤ 4
x1 +2x2 ≤ 3
x1 ≥ 0; x2 ≥ 0
42
3/25/2023
▪ Departing variable: If the ratio is the same between two rows, and
is also the minimum among the ratios for all rows, there is a tie for
the departing variable. Here also, any one variable can be
arbitrarily selected as the departing variable. This results in a
degenerate solution.
EXAMPLE
43
3/25/2023
44