0% found this document useful (0 votes)
4 views33 pages

Linear Programming Lecture 2

The document discusses solving linear programming (LP) problems, focusing on geometric and algebraic views. It highlights the importance of feasible regions, extreme points, and the simplex method for optimization. Various examples illustrate the process of finding optimal solutions through both graphical representation and algebraic formulation.

Uploaded by

badar.ee9086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views33 pages

Linear Programming Lecture 2

The document discusses solving linear programming (LP) problems, focusing on geometric and algebraic views. It highlights the importance of feasible regions, extreme points, and the simplex method for optimization. Various examples illustrate the process of finding optimal solutions through both graphical representation and algebraic formulation.

Uploaded by

badar.ee9086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Optimization Methods in Energy and

Power Systems

Lecture 2: Solving LP Problems


Mahdi Pourakbari Kasmaei, 2019

Thursday, 07 March 2019


Solving LP Problems

✓ Picturing (Geometric View)

x =  a 2 + b2
✓ Algebraically x + y =1 z
2 2
x
y
xz + y  38

✓ Simplex

2
Solving LP Problems (Geometric View)

✓ Two Main Characteristics


• The feasible region, if exists, is always a
multidimensional analogue of a polygon.
• The objective function is always increasing or
decreasing in the same direction, which is
perpendicular to the contours.

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

min z = 2 x1 + 1x2 The last point(s) that the


x1 , x2 O.F. touches the polygon
s.t. (22, 40) (42, 40)
1x1 + 1x2  62 (50, 34.7)
2
x1 + 1x2  68
Ex. 2-1: 3 (50, 12)
2 x1 + 0.3 x2  50
1x1  50
1x2  40
x1 , x2  0

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

Friday, 07 January 2022


11
Solving LP Problems (Geometric View)
✓ Vertices or Extreme Points of the Feasible
Region are Important; Optimal Solution
is one of these points.
✓ Multiple Optimal Solution occurs if the
(22, 40) (42, 40) counter lines of the O.F. are parallel to a
(50, 34.7) side of the polytope.
Optimal Solution(s)
(50, 12)
exist in the
Boundary (Point or
Line)

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 **** SOLVER STATUS 1 Normal Completion


x1 + 1x2  68 **** MODEL STATUS 3 Unbounded
Ex. 2-6: 3 **** OBJECTIVE VALUE 124.00 (NOT VALID!)

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/;

1x1 + 1x2  62 Solve LP_ED using LP Maximizing Z;

**** SOLVER STATUS 1 Normal Completion


2
x1 + 1x2  68 **** MODEL STATUS 4 Infeasible
**** OBJECTIVE VALUE 15.3333 (NOT VALID!)
Ex. 2-7: 3
2 x1 + 0.3 x2  50
1x1  50
1x2  40
x1 , x2  0

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 ) x0

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 

It has more Columns (Variables)


than Rows (Equations)

20
Solving LP Problems (Algebraically)

✓ A way to obtain the solutions is selecting a number of


columns equal to the rows.
✓ Take a way Excess Columns and Assign Zero to the
corresponding variables.
✓ The obtained solutions this way are called Basic Solutions

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)

✓ Since the nonnegativity (22, 40) (42, 40)


condition has been violated for (50, 34.7)
𝑥3 and 𝑥5 , then, this solution is
an Infeasible Basic Solution. (50, 12)

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)

✓ Since the nonnegativity (22, 40) (42, 40)


condition has been satisfied for (50, 34.7)
all variables, then this solution
is a Feasible Basic Solution. (50, 12)

27
Solving LP Problems (Algebraically)

✓ Number of combinations of 7 columns taking 5 is 21.

7 7!
 =
 5  5!  (7 − 5)!

✓ Now, we will consider the feasible basic solutions.

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 x4 x5 x6 ) = (22 40 13.333 6 28) & ( x3 x7 ) = (0 0)

( x1 x2 x3 x5 x7 ) = (50 34.7 22.7 60.4 5.3) & ( x4 x6 ) = (0 0)

( x1 x2 x3 x5 x6 ) = (42 40 20 46 8) & ( x4 x6 ) = (0 0)

29
Solving LP Problems (Algebraically)

✓ The obtained Feasible Basic


Solution are the extreme points
(22, 40) (42, 40)
of the feasible region
(50, 34.7)

(50, 12)

30
Concluding Remarks

✓ In Geometrical Method, each Extreme Point of the feasible


region is a Basic Feasible Solution of the Algebraic method; In
Geometric viewpoint, General Form can be used, while in
Algebraic viewpoint, Standard Form is used. Minimization Problem
✓ If an LP problem has a solution, this solution is one of the
Extreme Points (Basic Feasible Solution).

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

You might also like