Linear Programming Lecture 2
Linear Programming Lecture 2
Power Systems
x = a 2 + b2
✓ Algebraically x + y =1 z
2 2
x
y
xz + y 38
✓ Simplex
2
Solving LP Problems (Geometric View)
3
Solving LP Problems (Geometric View)
min z = 2 x1 + 1x2
x1 , x2
s.t.
1x1 + 1x2 62
2
x1 + 1x2 68
3
2 x1 + 0.3x2 50
1x1 50
1x2 40
x1 , x2 0
4
Solving LP Problems (Geometric View)
min z = 2 x1 + 1x2
x1 , x2
s.t.
1x1 + 1x2 62
Quadrilateral
2
x1 + 1x2 68 (22, 40) (42, 40)
3 (50, 34.7)
2 x1 + 0.3x2 50
1x1 50 (50, 12)
1x2 40
x1 , x2 0
5
Solving LP Problems (Geometric View)
min z = 2 x1 + 1x2
x1 , x2
Minimization Move Downward
s.t.
1x1 + 1x2 62
2
x1 + 1x2 68 (22, 40) (42, 40)
3 (50, 34.7)
2 x1 + 0.3x2 50
1x1 50 (50, 12)
1x2 40
x1 , x2 0
6
Solving LP Problems (Geometric View)
Let’s Play with the Optimal
Objective Function Solution
7
Solving LP Problems (Geometric View)
Let’s Play with the
Objective Function The last point that the O.F.
touches the polygon
min z = 1x1 + 2 x2
x1 , x2
s.t. (22, 40) (42, 40)
1x1 + 1x2 62 (50, 34.7)
2
x1 + 1x2 68
Ex. 2-2: 3 (50, 12)
2 x1 + 0.3 x2 50
1x1 50
1x2 40
x1 , x2 0
8
Solving LP Problems (Geometric View)
Let’s Play with the Maximization Move Upward
Objective Function
max z = 2 x1 + 1x2
x1 , x2
s.t. (22, 40) (42, 40)
1x1 + 1x2 62 (50, 34.7)
2
x1 + 1x2 68
Ex. 2-3: 3 (50, 12)
2 x1 + 0.3 x2 50
1x1 50
1x2 40
x1 , x2 0
9
Solving LP Problems (Geometric View)
Let’s Play with the
Objective Function
max z = 1x1 + 2 x2
x1 , x2
s.t. (22, 40) (42, 40)
1x1 + 1x2 62 (50, 34.7)
2
x1 + 1x2 68
Ex. 2-4: 3 (50, 12)
2 x1 + 0.3 x2 50
1x1 50
1x2 40
x1 , x2 0
10
Solving LP Problems (Geometric View)
Let’s Play with the
Objective Function
Multiple Optimal
Solution
min z = 1x1 + 1x2
x1 , x2
s.t. (22, 40) (42, 40)
1x1 + 1x2 62 (50, 34.7)
2
x1 + 1x2 68
Ex. 2-5: 3 (50, 12)
2 x1 + 0.3 x2 50
1x1 50
1x2 40
x1 , x2 0
12
Solving LP Problems (Class Activity)
Together we are
Stronger!
13
Solving LP Problems (Geometric View)
VARIABLES Z;
POSITIVE VARIABLES x1, x2;
Unbounded Condition EQUATIONS EqObj, Eq1, Eq3, Eq5;
EqObj.. z =e= 2*x1 + x2;
Eq1.. x1 + x2 =g= 62;
*Eq2.. (2/3)*x1 + x2 =l= 68;
max z = 2 x1 + x2 Eq3.. 2*x1 + 0.3*x2 =g= 50;
x1 , x2 *Eq4.. x1 =l= 50;
Eq5.. x2 =l= 40;
s.t. MODEL LP_ED /ALL/;
1x1 + 1x2 62 Solve LP_ED using LP Maximizing Z;
2 x1 + 0.3 x2 50
1x1 50
1x2 40
x1 , x2 0
14
Solving LP Problems (Geometric View)
VARIABLES Z;
POSITIVE VARIABLES x1, x2;
EQUATIONS EqObj, Eq1, Eq3, Eq5;
Infeasible Condition EqObj.. z =e= 2*x1 + x2;
Eq1.. x1 + x2 =l= 62;
Eq2.. (2/3)*x1 + x2 =g= 68;
max z = 2 x1 + x2 Eq3.. 2*x1 + 0.3*x2 =l= 50;
Eq4.. x1 =l= 50;
x1 , x2
Eq5.. x2 =l= 40;
s.t. MODEL LP_ED /ALL/;
15
Solving LP Problems (Algebraically)
✓ From the Geometric View:
• Looking for extreme points is important.
✓ In Algebraic View:
• The extreme points (the intersection of hyperplanes)
are found using algebraic techniques.
• Determine away to characterize points that may be
optimal solutions of an LPP
• We need the Standard Form
16
Solving LP Problems (Algebraically)
min z = 2 x1 + x2 min z = 2 x1 + x2
x1 , x2 x1 , x2 , x3 ,
x4 , x5 , x6 ,
s.t. x1 + x2 62 x7
2 s.t. x1 + x2 − x3 = 62
x1 + x2 68 2
3 Standard Form x1 + x2 + x4 = 68
2 x1 + 0.3x2 50 3
2 x1 + 0.3x2 − x5 = 50
x1 50
x1 + x6 = 50
x2 40
x2 + x7 = 40
x1 , x2 0
x1 , x2 , x3 , x4 , x5 , x6 , x7 0
17
Solving LP Problems (Algebraically)
Matrix Form c1 x1
c = c2 , x = x2
n
min z = c j x j cn xn
xj s.t.
j =1
a1,1 a1,2 a1, n b1
s.t. A = a2,1 a2,2 a2, n ,
b = b2
am ,1 am ,2 am , n
n
a x
j =1
ij j = bi , i = 1,..., me bm
x j 0, j = 1,..., n min z = cT x
x
s.t. Ax = b
cT = (c1 c2 cn ) x0
18
Solving LP Problems (Algebraically)
Matrix Form x1
x2
x3
min z = 2 x1 + x2 min z = (2 1 0 0 0 0 0) x4
x1 , x2 , x3 ,
x x
x4 , x5 , x6 , x5
x7
s.t. x1 + x2 − x3 = 62 x6
7
2 x1 x1
x1 + x2 + x4 = 68 1 1 −1 0 0 0 0 x2 62 x2
3 2
2 x1 + 0.3x2 − x5 = 50 1 0 1 0 0 0 x3 68 x3
3
x1 + x6 = 50 2 0.3 0 0 −1 0 0 x4 = 50 ; and x4 0
x
x2 + x7 = 40 1 0 0 0 0 1 0 x5 50 x6
5
x1 , x2 , x3 , x4 , x5 , x6 , x7 0 0 1 0 0 0 0 1 x6 40
x
x7 7
19
Solving LP Problems (Algebraically)
7
We Consider the Equality
Constraints (Feasible x1
1 1 −1 0 0 0 0 x2 62
Region) form algebraic 2 1 0 1 0 0 0 x3 68
standpoint 3
5
2 0.3 0 0 −1 0 0 x4 = 50
1 0 0 0 0 1 0 x5 50
0 1 0 0 0 0 1 x6 40
x7
20
Solving LP Problems (Algebraically)
21
Solving LP Problems (Algebraically)
✓ Let us select the last 5 columns, and consequently, the
corresponding variables 𝑥3 , 𝑥4 , 𝑥5 , 𝑥6 and 𝑥7 are the
decision variables.
x1
1 1 −1 0 0 0 0 x2 62
2 1 0 1 0 0 0 x3 68
3
2 0.3 0 0 −1 0 0 x4 = 50
1 0 0 0 0 1 0 x5 50
0 1 0 0 0 0 1 x6 40
x7
22
Solving LP Problems (Algebraically)
✓ Therefore we have,
−1 0 0 0 0 x3 62
0 1 0 0 0 x4 68
0 0 −1 0 0 x5 = 50 Negative Values!!
0 0 0 1 0 x6 50
0 1 x7 40
We have
0 0 0 Problem!!!!
And after solving:
( x3 x4 x5 x6 x7 ) = ( − 62 68 −50 50 40)
&
( x1 x2 ) = (0 0)
23
Solving LP Problems (Algebraically)
( x3 x4 x5 x6 x7 ) = ( − 62 68 −50 50 40)
&
( x1 x2 ) = (0 0)
24
Solving LP Problems (Algebraically)
✓ Let us take away columns 𝑥3 and 𝑥4 , and consequently,
the corresponding variables, 𝑥1 , 𝑥2 , 𝑥5 , 𝑥6 and 𝑥7
x1
1 1 −1 0 0 0 0 x2 62
2 1 0 1 0 0 0 x3 68
3
2 0.3 0 0 −1 0 0 x4 = 50
1 0 0 0 0 1 0 x5 50
0 1 0 0 0 0 1 x6 40
x7
25
Solving LP Problems (Algebraically)
✓ Therefore we have,
1 1 0 0 0 x 62
2
1
1 1 0 0 x2 68
3 x = 50
2 0.3 0 −1 0 4
1 0 0 0 1 x5 50
0 1 0 0 0 x6 40
And after solving:
( x1 x2 x4 x5 x6 ) = (22 40 13.333 6 28)
&
( x3 x7 ) = (0 0)
26
Solving LP Problems (Algebraically)
( x1 x2 x4 x5 x6 ) = (22 40 13.333 6 28)
&
( x3 x7 ) = (0 0)
27
Solving LP Problems (Algebraically)
7 7!
=
5 5! (7 − 5)!
28
Solving LP Problems (Algebraically)
✓ The feasible basic solutions are as follows.
( x1 x2 x4 x5 x7 ) = (50 12 22.667 53.6 28) & ( x3 x6 ) = (0 0)
( x1 x2 x3 x5 x6 ) = (42 40 20 46 8) & ( x4 x6 ) = (0 0)
29
Solving LP Problems (Algebraically)
(50, 12)
30
Concluding Remarks
31
Concluding Remarks
✓ Therefore, we may use the Geometric Viewpoint to find all the
Extreme Points, however, this is good for systems with two
decision variables.
✓ Another possible strategy is checking all Basic Feasible
Solutions which may take too much time.
✓ An alternative solution strategy is to find a Basic Feasible
Solution and then jump to another Basic Feasible Solution
while decreasing the objective function until no further
decrease is possible. This is the Simplex Algorithm.
32
Thanks!
33