![Page 1: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/1.jpg)
Mechanical Engineering Department
1
النحل سورة(78)
![Page 2: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/2.jpg)
Mechanical Engineering Department
2
Chapter 2
Linear Programming (LP)
Lecture Objective
THE SIMPLEX METHOD
![Page 3: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/3.jpg)
Mechanical Engineering Department
3
SIMPLEX LINEAR SIMPLEX LINEAR PROGRAMMING PROGRAMMING SIMPLEX LINEAR SIMPLEX LINEAR PROGRAMMING PROGRAMMING
![Page 4: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/4.jpg)
Mechanical Engineering Department
4
1. INTRODUCTION1. INTRODUCTION
• The simplex method is a general-purpose linear programming algorithm that is widely used to solve large-scale problems.
• The simplex technique involves a series of iterations; successive improvements are made until an optimal solution is achieved.
• Most users of the technique rely on computers to handle the computations while they concentrate on the solutions.
• It is best to work with numbers in fractional form.
![Page 5: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/5.jpg)
Mechanical Engineering Department
5
Example Example
Consider the simplex solution to the following Consider the simplex solution to the following Problem:Problem:
![Page 6: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/6.jpg)
Mechanical Engineering Department
6
Graphical solutionGraphical solution
x1
![Page 7: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/7.jpg)
Mechanical Engineering Department
7
IntroductionIntroduction
• The simplex technique involves generating a series of solutions in tabular form, called tableaus.
• By inspecting the bottom row of each tableau, one can immediately tell if it represents the optimal solution.
• Each tableau corresponds to a corner point of the feasible solution space.
• The first tableau corresponds to the origin. • Subsequent tableaus are developed by shifting to an
adjacent corner point in the direction that yields the highest rate of profit.
![Page 8: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/8.jpg)
Mechanical Engineering Department
8
Simplex Method StepsSimplex Method Steps
1. Set up the initial tableau.2. Develop a revised
tableau using the information contained in the first tableau.
3. Inspect to see if it is optimum.
4. Repeat steps 2 and 3 until no further improvement is possible.
![Page 9: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/9.jpg)
Mechanical Engineering Department
9
Maximization Problem with only ≤ constraints
Maximization Problem with only ≤ constraints
1. Set up the initial tableau.A. Rewrite the constraints so that they become
equalities; add a slack variable to each constraint.
B. Rewrite the objective function to include the slack variables. Give slack variables coefficients of 0.
C. Put the objective coefficients and constraint coefficients into tableau form.
D. Compute values for the Z row.
E. Compute values for the C - Z row.
![Page 10: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/10.jpg)
Mechanical Engineering Department
10
Slack variables Slack variables
represent the amount of each resource that will not be used if the solution is implemented.
![Page 11: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/11.jpg)
Mechanical Engineering Department
11
Adding Slack variables to each Constraint
Adding Slack variables to each Constraint
In the initial solution, with each of the real variables equal to zero, the solution consists only of slack.
It is useful in setting up the table to represent each slack variable in every equation.
![Page 12: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/12.jpg)
Mechanical Engineering Department
12
Adding Slack variables to the Objective Function
Adding Slack variables to the Objective Function
The objective function can be written in similar form:
The slack variables are given coefficients of zero in the objective function because they do not produce any contributions to profits.
![Page 13: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/13.jpg)
Mechanical Engineering Department
13
The Problem After Adding Slack variables
The Problem After Adding Slack variables
![Page 14: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/14.jpg)
Mechanical Engineering Department
14
QuestionsQuestionsQuestionsQuestions
![Page 15: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/15.jpg)
Mechanical Engineering Department
15
The Initial Tableau The Initial Tableau
![Page 16: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/16.jpg)
Mechanical Engineering Department
16
Compute values for the Z row and C- Z row
Compute values for the Z row and C- Z row
• To compute the Z values, multiply the To compute the Z values, multiply the coefficients in each column by their respective coefficients in each column by their respective row profit per unit amounts, and sum within row profit per unit amounts, and sum within columns. To begin with, all values are zero.columns. To begin with, all values are zero.
• The last value in the Z row indicates the total The last value in the Z row indicates the total profit associated with a given solution (tableau). profit associated with a given solution (tableau). Since the initial solution has Since the initial solution has x1 x1 = 0 and = 0 and x2 x2 = 0, it = 0, it is not surprising that profit is 0.is not surprising that profit is 0.
• To compute in the C - Z row values, subtract the To compute in the C - Z row values, subtract the Z value in each column from the value of the Z value in each column from the value of the objective row for that column.objective row for that column.
![Page 17: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/17.jpg)
Mechanical Engineering Department
17
The Test for OptimalityThe Test for Optimality
If all the values in the C - Z row of any tableau If all the values in the C - Z row of any tableau are are zerozero or or negativenegative, the optimal solution has , the optimal solution has been obtained. been obtained.
In this case, the C - Z row contains two In this case, the C - Z row contains two positivepositive values, 4 and 5, indicating that improvement values, 4 and 5, indicating that improvement is possible.is possible.
![Page 18: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/18.jpg)
Mechanical Engineering Department
18
2. Set up subsequent tableaus.2. Set up subsequent tableaus.
A. Determine the entering variable (the largest positive value in the C - Z row).
B. Determine the leaving variable: Divide each constraint row's solution quantity by the row's pivot value; the smallest positive ratio indicates the leaving variable.
![Page 19: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/19.jpg)
Mechanical Engineering Department
19
The leaving and entering variablesThe leaving and entering variables
![Page 20: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/20.jpg)
Mechanical Engineering Department
20
2. Set up subsequent tableaus.2. Set up subsequent tableaus.
C. Form the new main row of the next tableau. Enter these values in the next tableau in the same row positions.
D. Compute new values for remaining constraint rows. Enter these in the new tableau in the same positions as the original row.
E. Compute values for Z and C - Z rows.F. Check to see if any values in the C - Z row are
positive; if they are, repeat 2A-2F Otherwise, the optimal solution has been obtained.
![Page 21: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/21.jpg)
Mechanical Engineering Department
21
Completed Second Tableau Completed Second Tableau
![Page 22: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/22.jpg)
Mechanical Engineering Department
22
Developing the Third TableauDeveloping the Third Tableau
![Page 23: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/23.jpg)
Mechanical Engineering Department
23
The Third Tableau (Optimum Solution) The Third Tableau
(Optimum Solution)
![Page 24: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/24.jpg)
Mechanical Engineering Department
24
Graphical analogies to Simplex Tableaus
Graphical analogies to Simplex Tableaus
![Page 25: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/25.jpg)
Mechanical Engineering Department
25
QuestionsQuestionsQuestionsQuestions
![Page 26: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/26.jpg)
Mechanical Engineering Department
26
A MINIMIZATION PROBLEM≥ and = Constraints
A MINIMIZATION PROBLEM≥ and = Constraints
For = constraint, add an artificial variable.
For example, the equalities
Using artificial variables a1 and a2.
Slack variables would not be added.4
![Page 27: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/27.jpg)
Mechanical Engineering Department
27
A MINIMIZATION PROBLEM≥ and = Constraints
A MINIMIZATION PROBLEM≥ and = Constraints
The objective function, say, Z = 2x1 + 3x2 would be rewritten as:
whereM = A large number (e.g., 999)The artificial variables are not desired in the
final solution, selecting a large value of M (much larger than the other objective coefficients) will insure their deletion during the solution process.
![Page 28: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/28.jpg)
Mechanical Engineering Department
28
A MINIMIZATION PROBLEM≥ and = Constraints
A MINIMIZATION PROBLEM≥ and = Constraints
For a ≥ constraint, surplus variables must be subtracted instead of added to each
constraint. For example, the constraints
would be rewritten as equalities:
![Page 29: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/29.jpg)
Mechanical Engineering Department
29
A MINIMIZATION PROBLEM≥ and = Constraints
A MINIMIZATION PROBLEM≥ and = Constraints
As equalities, each constraint must then be adjusted by addition of an artificial
variable.
The final result looks like this:
![Page 30: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/30.jpg)
Mechanical Engineering Department
30
A MINIMIZATION PROBLEM≥ and = Constraints
A MINIMIZATION PROBLEM≥ and = Constraints
If the objective function happened to be
it would become
![Page 31: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/31.jpg)
Mechanical Engineering Department
31
Two Ways to Solve a Minimization ProblemTwo Ways to Solve a
Minimization ProblemThe first approach
We select the variable with the MOST NEGATIVE Cj - Zj; as the one to introduce next.
We would STOP when every value in the net evaluation row is ZERO or POSITIVE.
![Page 32: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/32.jpg)
Mechanical Engineering Department
32
Two Ways to Solve a Minimization ProblemTwo Ways to Solve a
Minimization ProblemThe second approach
Any minimization problem can be converted to an equivalent maximization problem by multiplying the objective function by -1.
Solving the resulting maximization problem wil1 provide the optimal solution to the minimization problem.
![Page 33: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/33.jpg)
Mechanical Engineering Department
33
ProblemProblem
Let us illustrate this second approach
The mathematical statement of the problem is
![Page 34: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/34.jpg)
Mechanical Engineering Department
34
SolutionSolution
![Page 35: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/35.jpg)
Mechanical Engineering Department
35
Solution (Continue)Solution (Continue)
The tableau form for this problem is
![Page 36: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/36.jpg)
Mechanical Engineering Department
36
Solution (Continue)Solution (Continue)
The initial simplex tableau is:
![Page 37: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/37.jpg)
Mechanical Engineering Department
37
Solution (Continue)Solution (Continue)
At the first iteration, x1 is brought into the basis and a1 is removed.
After dropping the a1 column from the tableau, The first iteration is:
![Page 38: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/38.jpg)
Mechanical Engineering Department
38
Solution (Continue)Solution (Continue)
The final simplex tableau:
The minimum total cost of the optimal solution is $800
![Page 39: Mechanical Engineering Department 1 سورة النحل (78)](https://reader035.vdocuments.net/reader035/viewer/2022070402/56649f255503460f94c3c6f6/html5/thumbnails/39.jpg)
Mechanical Engineering Department
39
Thank YouThank YouThank YouThank You