Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Civil Engineering Systems Analysis
Lecture XII
Instructor: Prof. Naveen Eluru
Department of Civil Engineering and Applied Mechanics
Today’s Learning Objectives
Dual
Midterm
10/16/2012 2 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS
Let us look at a complex case
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 3
Minimize 8x1 + 5x2 + 4x3
Subject to
4x1 + 2x2 + 8x3 = 12
7x1 + 5x2 + 6x3 ≥ 9
8x1 + 5x2 + 4x3 ≤ 10
3x1 + 7x2 + 9x3 ≥ 7
x1 ≥ 0, x2 unrestricted, x3 ≤ 0
We know how to write the dual if we have maximization and ≤ constraints, and non-negative variables
Solution
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 4
Convert Min to Max multiply with -1
Now convert x2 into a non-negative variable combination x2 = x4 – x5
Now convert x3 into a non-negative variable combination x3 = -x6
Max -8x1 - 5x4 + 5x5 + 4x6
4x1 + 2x4 – 2x5 - 8x6 = 12
7x1 + 5x4 – 5x5 - 6x6 ≥ 9
8x1 + 5x4 – 5x5 - 4x6 ≤ 10
3x1 + 7x4 – 7x5 - 9x6 ≥ 7
x1, x4, x5, x6 ≥ 0
Convert constraints to ≤
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 5
4x1 + 2x4 – 2x5 - 8x6 = 12
Write it as two equations
4x1 + 2x4 – 2x5 - 8x6 ≤ 12 (good!)
4x1 + 2x4 – 2x5 - 8x6 ≥ 12 (change this by
multiplying with -1)
-4x1 - 2x4 + 2x5 + 8x6 ≤ -12 (good!)
7x1 + 5x4 – 5x5 - 6x6 ≥ 9
-7x1 - 5x4 + 5x5 + 6x6 ≤ -9 (good!)
8x1 + 5x4 – 5x5 - 4x6 ≤ 10 (good!)
3x1 + 7x4 – 7x5 - 9x6 ≥ 7
-3x1 - 7x4 + 7x5 + 9x6 ≤ -7
In standard form
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 6
Maximize -8x1 - 5x4 + 5x5 + 4x6
4x1 + 2x4 – 2x5 - 8x6 ≤ 12 (good!)
-4x1 - 2x4 + 2x5 + 8x6 ≤ -12 (good!)
-7x1 - 5x4 + 5x5 + 6x6 ≤ -9 (good!)
8x1 + 5x4 – 5x5 - 4x6 ≤ 10
-3x1 - 7x4 + 7x5 + 9x6 ≤ -7
x1, x4, x5, x6 ≥ 0
5 constraints and 4 variables
So, dual will have 5 variables and 4 constraints
Lets write the dual
Dual
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 7
Minimize 12y1 – 12y2 -9y3 +10y4 -7y5
4y1 – 4y2 – 7y3 + 8y4 - 3y5 ≥ -8
2y1 – 2y2 – 5y3 + 5y4 – 7y5 ≥ -5
-2y1 + 2y2 + 5y3 – 5y4 + 7y5 ≥ 5
-8y1 + 8y2 + 6y3 – 4y4 + 9y5 ≥ 4
y1, y2, y3, y4, y5 ≥ 0
Reconvert to match with the original problem
Convert minimize to maximize
Max -12y1 + 12y2 +9y3 -10y4 +7y5
Match variables with original problem
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 8
Original problem has 4 constraints so only 4
variables!
Can we make some changes to the variables
Set y6 = y2-y1
–4y6 – 7y3 + 8y4 - 3y5 ≥ -8
-2y6 – 5y3 + 5y4 – 7y5 ≥ -5
2y6 + 5y3 – 5y4 + 7y5 ≥ 5
8y6 + 6y3 – 4y4 + 9y5 ≥ 4
Max 12y6 +9y3 -10y4 +7y5
Match variables with original problem
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 9
Also, the dual should have objective function
values from RHS of primal.. So all terms
positive
Set y7 = -y4
–4y6 – 7y3 - 8y7 - 3y5 ≥ -8
-2y6 – 5y3 - 5y7 – 7y5 ≥ -5
2y6 + 5y3 + 5y7 + 7y5 ≥ 5
8y6 + 6y3 + 4y7 + 9y5 ≥ 4
Max 12y6 +9y3 +10y7 +7y5
Match no. of constraints
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 10
Lets make all constraints have positive RHS
4y6 + 7y3 + 8y7 + 3y5 ≤ 8
2y6 + 5y3 + 5y7 + 7y5 ≤ 5
2y6 + 5y3 + 5y7 + 7y5 ≥ 5
8y6 + 6y3 + 4y7 + 9y5 ≥ 4
We had 3 variables in the primal, so 3 constraints
We can join equations 2 and 3 as =
4y6 + 7y3 + 8y7 + 3y5 ≤ 8
2y6 + 5y3 + 5y7 + 7y5 = 5
8y6 + 6y3 + 4y7 + 9y5 ≥ 4
Max 12y6 +9y3 +10y7 +7y5
For simplicity replace y6 with y1, y3 with y2 and so on
Solution
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 11
Primal
Minimize 8x1 + 5x2 + 4x3
4x1 + 2x2 + 8x3 = 12
7x1 + 5x2 + 6x3 ≥ 9
8x1 + 5x2 + 4x3 ≤ 10
3x1 + 7x2 + 9x3 ≥ 7
x1 ≥ 0, x2 unrestricted, x3 ≤ 0
Dual
Max 12y1 +9y2 + 10y3 +7y4
4y1 + 7y2 + 8y3 + 3y4≤ 8
2y1 + 5y2 + 5y3 + 7y4 = 5
8y1 + 6y2 + 4y3 + 9y4 ≥ 4
y1 unrestricted, y2, y4 ≥ 0 and y3 ≤ 0
Points to Remember
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 12
“=” constraint gives an unrestricted variable and vice versa
Desirable constraints yield desirable variables and vice-versa
In a minimization ≥ is desirable hence the variable corresponding to that will be ≥ 0 (look at constraints 2 and 4 in primal)
In a minimization ≤ is undesirable and hence it gives us ≤0 variable (look at constraint 3 in primal)
In any problem non-negativity is desirable,
non-negative variable yield desirable constraint signs (see x1 in primal)
Negative variables yield non-desirable constraint signs (see x3 in primal
Another example
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 13
Primal
Max 3x1 + 7x2 + 5x3 + 3x4
2x1 + 2x2 + 8x3 = 12
5x1 + 2x2 + 4x3 + x4 ≥ 9
6x1 + 3x2 + 5x3 + 2x4 ≤ 10
6x1 + 5x2 + 7x3 + 5x4 ≥ 7
x1 ≥ 0, x2 unrestricted, x3 ≤ 0, x4 ≥0
Dual
Min 12y1+9y2+10y3+7y4
2y1+5y2+6y3+6y4 ≥ 3
2y1+2y2+3y3+5y4 = 7
8y1+4y2+5y3+7y4 ≤ 5
y2+2y3+5y4 ≥ 3
y1 unrestricted, y2 ≤0, y3 ≥0, y4 ≤0
Relationship summary
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 14
MIDTERM REVIEW
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 15
Mid-term
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 16
Location
Trottier 100 [Even number student ids]
MC13 [Odd number student ids]
If you turn up in the wrong room [-10 points]
Time October 18th 1.05 – 2.25
Late comers will not be provided extra time!
Syllabus covered up to today
Cheat sheet on one side only
Important Components*
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 17
LP problem formulation (8-18)
Simplex (8-16)
Algebraic
Graphical
Table
Sensitivity analysis
Simplex theory
Matrix Simplex (8-15)
Revised Simplex (8–15)
Dual (4–8)
*I have not yet prepared the exam; so these mark allocations are for indication only
LP problem formulation
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 18
1-2 problems on formulating an LP
Simplex
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 19
Approach to solve LP problems Solves based on the corner point approach… Simplex moves from one
corner point to another with the objective of maximizing the rate of increase of the objective function
It does not consider the interior of the feasible space
For two dimensions graphical approach
For more than two dimensions move to the table approach
Requirements Create an identity matrix – so that we have an easy starting solution
Then , from there we set about increasing the objective function
At any iteration we only consider exchanging one element (highest –ive coefficient in z row)
So one variable enters the basis and on leaves the basis (based on minimum ratio)
Then do gauss-jordan transformations to get the new solution
Important elements to note Entering variable
Leaving variable
Simplex
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 20
Important points to note Tie in the leaving variable
Unbounded z
Multiple optima
Adapting simplex to other forms Artificial variables (M)
= artificial variable with penalty M in the objective function
≥ surplus + artificial variable with penalty M in the objective function
Minimization Max –Z
Also most cases will have a M based variable (so change the obj. function accordingly)
Theory Ensuring simplex works
Matrix and Revised Simplex forms
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 21
In this we just compute the below expression to replace for the table
1 cBB
−1𝐴 − 𝑐 cBB−1
0 B−1𝐴 B−1
𝑍xxs
= cBB
−1bB−1b
B-1 is expensive operation
So we improve the mechanism to compute B-1
Revised Simplex Method ((𝐵−1)𝑛𝑒𝑤 )𝑖𝑗 = (𝐵−1
𝑜𝑙𝑑)𝑖𝑗 - (aik/ark) (𝐵−1𝑜𝑙𝑑)𝑟𝑗 if i ≠r
= (1/ark) (𝐵−1𝑜𝑙𝑑)𝑖𝑗 if i = r
In matrix notation
(𝐵−1)𝑛𝑒𝑤= E (𝐵−1)𝑜𝑙𝑑 where E is an identity matrix except that its rth
column is replaced by vector
𝜂 =
𝜂1
𝜂2
⋮𝜂𝑚
where 𝜂I = -(aik/ark) if i ≠r
= (1/ark) if i = r
Dual
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 22
A dual problem is formed by Maximization ←→ Minimization
Constraints ←→ Variables No. of constraints in primal = no. of variables in dual
Column of coefficients ←→row of coefficients
Resources ←→ objective function values
Rules for conversion “=” constraint gives an unrestricted variable and vice versa
Desirable constraints yield desirable variables and vice-versa In a minimization ≥ is desirable hence the variable corresponding to
that will be ≥ 0
In a minimization ≤ is undesirable and hence it gives us ≤0 variable
In any problem non-negativity is desirable, Non-negative variable yield desirable constraint signs
Negative variables yield non-desirable constraint signs
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 23
Last year mid-term solutions
References
10/16/2012 CIVE 208: CIVIL ENGINEERING SYSTEMS ANALYSIS 24
Hillier F.S and G. J. Lieberman. Introduction to
Operations Research, Ninth Edition, McGraw-
Hill, 2010