0% found this document useful (0 votes)
3 views

Optimization techniques (lecture 3 and 4)

Linear programming is an optimization technique used to solve problems with linear objective functions and constraints. The graphical method involves transforming inequalities into equations, plotting them to identify feasible regions, and evaluating corner points to find optimal solutions. The document also discusses the Simplex method for solving linear programming problems through a systematic tabular approach.

Uploaded by

w.mohammadtalaat
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)
3 views

Optimization techniques (lecture 3 and 4)

Linear programming is an optimization technique used to solve problems with linear objective functions and constraints. The graphical method involves transforming inequalities into equations, plotting them to identify feasible regions, and evaluating corner points to find optimal solutions. The document also discusses the Simplex method for solving linear programming problems through a systematic tabular approach.

Uploaded by

w.mohammadtalaat
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/ 42

Linear Programming

• What is linear programming?

 Linear programming is an optimization method applicable for the solution of


problems in which the objective function and the constraints appear as linear
functions of the decision variables.

 The constraint equations in a linear programming problem may be in the form of


equalities or inequalities.
Linear Programming
• Standard formulation of LP Problem:
Linear Programming
Graphical solution of LP problems
• Steps of graphical method:

1. Transform every inequality into an equation.


2. Plot every equation graphically.
3. Highlight the “feasible region” and common feasible region.
4. Assess the coordinates of the corner points.
5. Put the coordinates of all corner points into the objective function and find out one
which provides the optimal value.
Linear Programming
Graphical solution of LP problems
• Example 1:
Linear Programming
Graphical solution of LP problems
• Example 1 (continues):
Linear Programming
Graphical solution of LP problems
• Example 1 (continues):
Linear Programming
Graphical solution of LP problems
• Example 1 (continues):
Linear Programming
Graphical solution of LP problems
• Example 2:
Linear Programming
Graphical solution of LP problems
• Example 2 (continues):
Linear Programming
Graphical solution of LP problems
• Example 2 (continues):
Linear Programming
Graphical solution of LP problems
Unbounded
• Example 2 (continues): feasible
region

What if it was a
maximization
problem?
Linear Programming
Graphical solution of LP problems
• Example 2 (continues):
If this problem was a maximization, the answer is quite different, because:
For example, take a point within the feasible region along x1-axis, that is larger than point
C ( 6, 0 ), such as D ( 12, 0 ).
Evaluate the objective function at both C ( 6, 0 ), and D ( 12, 0 ).
You will notice that
(ZD( 12, 0 )=48) > (ZC( 6, 0 )=24)
This means that as the values of X1 goes to ∞, the obj. function Z (x1,0) can be
increased/maximized with no bounds (we refer to this as the unbounded solution)

Unbounded solution: The solution occurs when the value of the decision variables may be
increased indefinitely without violating any of the constraints
Linear Programming
Graphical solution of LP problems
• Example 2 (continues):
Similarly, take a point within the feasible region along x2-axis, that is larger than point
A ( 0, 12 ), such as E ( 0, 24 ).
Evaluate the objective function at both A ( 0, 12 ), and E ( 0, 24 ).
You will notice that
(ZE( 0, 24 )=144) > (ZA( 0, 12 )=72)

This means that as the values of X2 goes to ∞, the obj. function Z (0, x2) can be
increased/maximized with no bounds (we refer to this as the unbounded solution)

Unbounded solution: The solution occurs when the value of the decision variables may be
increased indefinitely without violating any of the constraints
Linear Programming
Graphical solution of LP problems
• Example 3:
A manufacturing firm produces two machine parts using lathes, milling machines, and
grinding machines. The different machining times required for each part, the machining
times available on different machines, and the profit on each machine part are given in the
following table.
Linear Programming
Graphical solution of LP problems
• Example 3:
Linear Programming
Graphical solution of LP problems
• Example 3 (Continues):

 The optimum solution corresponds to a value of


x*= 187.5, y*= 125.0 and a profit of
f(187.5,125)= $21,875.00.
Linear Programming
Graphical solution of LP problems
• Example 4:

Solution
Linear Programming
Graphical solution of LP problems
• Example 4 (continues):
Linear Programming
Graphical solution of LP problems
• Example 4 (continues):
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:

1. Transform every inequality into an equation. Add slack variables for the “≤” inequalities
and subtract slack variables for the “≥” inequalities.

For example:

• 𝑿≤𝟒 𝑿 + 𝑺𝟏 = 𝟒
• 𝒀≤𝟔 Y+𝑺𝟐 = 𝟔
• 𝟑𝑿 + 𝟐𝒀 ≤ 𝟏𝟖 𝟑𝑿 + 𝟐𝒀 + 𝑺𝟑 = 𝟏𝟖
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:

2. Rearrange the objective function so that all constants be on the RHS

Maximization example Z=3x+5y


turns into
Z-3x-5y=0
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:
3. Construct the Simplex table as shown below

All variables
RHS (CRHS) Ratio (Cratio)
Basic x y s1 s2 s3
Maximize: Z-3x-5y=0 z -3 -5 0 0 0 0
𝑋 + 𝑆1 = 4 s1 1 0 1 0 0 4
𝑌 + 𝑆2 = 6 s2 0 1 0 1 0 6
3𝑋 + 2𝑌 + 𝑆3 = 18 s3 3 2 0 0 1 18
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:

4. Determine the column of the entering variable (entering column CE ).


for maximization problems : CE is the column corresponding to the largest –ve
value of the row of obj. function
for minimization problems: CE is the column corresponding to the largest +ve
Entering column CE value of the row of obj. function
Row of
All variables Objective
RHS (CRHS) Ratio (Cratio)
Basic x y s1 s2 s3 function
Maximize: z -3 -5 0 0 0 50
s1
s2
Largest s3
–ve value
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:
5. Determine the row of the exiting variable Cext by dividing the RHS column C(RHS) by the
entering column CE. The Ratio column CRatio is the result of dividing C(RHS) by CE. The
exiting row is the one that correspond to the minimum positive value/ratio in the
resulting column CRatio=C(rhs)/CE.

Entering CE
All variables
Basic RHS (CRHS) Ratio (CRatio)
x y s1 s2 s3
z -3 -5 0 0 0 0
Exiting Cext s1 1 0 1 0 0 4
s2 0 1 0 1 0 6 6 Minimum positive ratio
s3 3 2 0 0 1 18 9
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:
6. The pivot element is the intersection of CE and Cext
(Notice that “S2” has been removed from the basic variable list and replaced by “y”)
7. Divide Cext by the value of the pivot to turn the pivot value into 1
(Note: In this example P is already equal 1 so we do not need to perform step 7)
Entering CE
All variables
Basic RHS (CRHS) Ratio (CRatio)
x y s1 s2 s3
z -3 -5 0 0 0 0
Exiting Cext s1 1 0 1 0 0 4
y 0 1 0 1 0 6 6 Minimum positive ratio
s3 3 2 0 0 1 18 9

Pivot (P)
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:
8. Use gauss elimination procedure to turn all the elements, within CE , above and below
the pivot into zeros as follows
i. Multiply Cext by 5 and add it to the row of the objective function.
ii. Multiply Cext by -2 and add it to the row of S3.
iii. In this example the intersection of CE and the row of S1 is already zero so we do
not need to change it
All variables Row of
Basic RHS (CRHS) Ratio (CRatio)
x y s1 s2 s3 Objective
z -3 -5 0 0 0 0 function
Exiting Cext s1 1 0 1 0 0 4
y 0 1 0 1 0 6 6 Row S3
s3 3 2 0 0 1 18 9

Pivot (P)
Linear Programming
Solution of LP problems by Simplex table
• Solution procedure:
Notice the following
The objective function increased to 30>>>>
this means that the first iteration provided a better solution that could maximize
the objective function
9. Now, the second iteration starts by selecting the new CE that has the largest negative
value
All variables
Basic RHS (CRHS) Ratio (CRatio)
x y s1 s2 s3
z -3 0 0 5 0 30
s1 1 0 1 0 0 4
y 0 1 0 1 0 6
s3 3 0 0 -2 1 6

10. Repeat the steps from 5 to 9


Linear Programming
Solution of LP problems by Simplex table
• Example 1:
Linear Programming
Solution of LP problems by Simplex table
• Example 1 (Cont.):
Linear Programming
Solution of LP problems by Simplex table
• Example 1 (Cont.):
All variables
RHS (CRHS) Ratio (Cratio)
Basic x1 x2 x3 x4 x5 x6 x7
z 4 6 3 1 0 0 0 0 0
x5 1 4 8 6 1 0 0 11 2.75
x6 4 1 2 1 0 1 0 7 7
x7 2 3 1 2 0 0 1 2 0.66666667 min

z 0 0 1 -3 0 0 -2 -4 -4
x5 -1.667 0 6.67 3.33 1 0 -1.33 8.33333333 1.25 min

x6 3.333 0 1.67 0.33 0 1 -0.33 6.33333333 3.8


x2 0.667 1 0.33 0.67 0 0 0.33 0.66666667 2
z 0.25 0 0 -3.5 -0.15 0 -1.8 -5.25 -21
x3 -0.25 0 1 0.5 0.15 0 -0.2 1.25 -5
x6 3.75 0 0 -0.5 -0.25 1 0 4.25 1.13333333
x2 0.75 1 0 0.5 -0.05 0 0.4 0.25 0.33333333 min

z 0 -0.33 0 -3.67 -0.13 0 -1.93 -5.33333333


x3 0 0.33 1 0.67 0.133 0 -0.07 1.33333333
x6 0 -5 0 -3 0 1 -2 3
x1 1 1.33 0 0.67 -0.07 0 0.53 0.33333333
Linear Programming
Solution of LP problems by Simplex table
• Example 1 (Cont.):
Linear Programming
Solution of LP problems by Simplex table
• Example 2:
Linear Programming
Solution of LP problems by Simplex table
• Example 2 (continues):
All variables
Basic RHS (CRHS) Ratio (Cratio)
x1 x2 x3 x4 x5
z -4 -3 0 0 0 0 0
x3 3 4 1 0 0 12 4
x4 3 3 0 1 0 10 3.3333333
x5 4 2 0 0 1 8 2 min

z 0 -1 0 0 1 8 -8
x3 0 2.5 1 0 -0.75 6 2.4 min

x4 0 1.5 0 1 -0.75 4 2.6666667


x1 1 0.5 0 0 0.25 2 4
z 0 0 0.4 0 0.7 10.4
x2 0 1 0.4 0 -0.3 2.4
x4 0 0 -0.6 1 -0.3 0.4
x1 1 0 -0.2 0 0.4 0.8
Linear Programming
Solution of LP problems by Simplex table
• Example 3:
Linear Programming
Solution of LP problems by Simplex table
• Example 3 (Cont.):
Linear Programming
Solution of LP problems by Simplex table
• Example 3 (Cont.):
Linear Programming
Solution of LP problems by Simplex table
• Example 4:
Linear Programming
Solution of LP problems by Simplex table
• Example 4 (cont.):
Linear Programming
Solution of LP problems by Simplex table
• Example 4 (cont.):

You might also like