3/19/2020 Dr. Abdulfatah Salem 2
For linear programming problems involving two variables, the graphical solution
method introduced before is convenient.
It is better to use solution methods that are adaptable to computers. One such method
is called the simplex method, The simplex method is an iterative procedure
developed by George Dantzig in 1946. It provides us with a systematic way of
examining the vertices of the feasible region to determine the optimal value of the
objective function.
more than two
variables
problems involving
a large number of
constraints
However, for
problems involving
3/19/2020 Dr. Abdulfatah Salem 3
Standard Minimization Form
• The objective function is to be
minimized.
• All the RHS involved in the
problem are nonnegative.
• All other linear constraints may
be written so that the
expression involving the
variables is greater than or equal
to a nonnegative constant.
Standard Maximization Form
• The objective function is to be
maximized.
• All the RHS involved in the
problem are nonnegative.
• All other linear constraints may
be written so that the expression
involving the variables is less
than or equal to a nonnegative
constant.
3/19/2020 Dr. Abdulfatah Salem 4
1) Be sure that the model is standard model
2) Be sure that the right hand side is +ve value
3) Convert each inequality in the set of constraints to an equation as
follows:
• Slack Variable added to a ≤ constraint to convert it to an equation
(=).
A slack variable represents unused resources A slack variable
contributes nothing to the objective function value.
• Surplus Variable subtracted from a ≥ constraint to convert it to an
equation (=).
A surplus variable represents an excess above a constraint
requirement level. Surplus variables contribute nothing to the
calculated value of the objective function.
Simplex Algorithm
3/19/2020 Dr. Abdulfatah Salem 5
4) Prepare the equations to make the unknowns in the left hand side and
the fixed values in the right hand side
5) Create the initial simplex tableau
6) Select the pivot column. ( The column with the “most negative value”
element in the last row. )
7) Select the pivot row. (The row with the smallest non-negative result
when the last element in the row is divided by the corresponding in
the pivot column)
8) Use elementary row operations to make all numbers in the pivot column
equal to 0 except for the pivot number equal to 1.
9) Check the optimality (entries in the bottom row are zero or positive, If
so, this the final tableau (optimal solution) , If not, go back to step 6
10) The linear programming problem has been solved and maximum solution
obtained, which is given by the entry in the lower-right corner of the
tableau.
Simplex Algorithm (cont.)
3/19/2020 Dr. Abdulfatah Salem 6
= + Artificial (A)
Constraint type Variable to be added
≥ + slack (s)
≤ - Surplus (s) + artificial (A)
Simplex Algorithm (cont.)
3/19/2020 Dr. Abdulfatah Salem 7
The national co. for assembling computer systems. assembles laptops and
printers, Each laptop takes four hours of labor from the hardware department and two hours of labor from
the software department. Each printer requires three hours of hardware and one hour of software. During
the current week, 240 hours of hardware time are available and 100 hours of software time. Each laptop
assembled gives a profit of $70 and each printer a profit of $50. How many printers and laptops should be
assembled in order to maximize the profit?
Example
Solution
ConstraintsprinterlaptopResource
24034hardware
10012software
5070Unit profit $
Max Z = 70x1 + 50x2
4x1 + 3x2 ≥ 240
2x1 + x2 ≥ 100
Z - 70x1 - 50x2 = 0
4x1 + 3x2 + s1 = 240
2x1 + x2 + s2 = 100
3/19/2020 Dr. Abdulfatah Salem 8
4x1 + 3x2 + s1 = 240
2x1 + x2 + s2 = 100
Z - 70x1 - 50x2 = 0
Basic
Variable
X1 X2 S1 S2 Z Rhs
S1 4 3 1 0 0 240
S2 2 1 0 1 0 100
Z -70 -50 0 0 1 0
3/19/2020 Dr. Abdulfatah Salem 9
Basic Variable X1 X2 S1 S2 Z Rhs
S1 4 3 1 0 0 240
S2 2 1 0 1 0 100
Z -70 -50 0 0 1 0
Basic Variable X1 X2 S1 S2 Z Rhs
S1 4 3 1 0 0 240
S2 2 1 0 1 0 100
Z -70 -50 0 0 1 0
Ratio
60
50
0
Basic Variable X1 X2 S1 S2 Z Rhs
S1 4 3 1 0 0 240
S2 2 1 0 1 0 100
Z -70 -50 0 0 1 0
X1 1 1/2 0 1/2 0 50 /2
3/19/2020 Dr. Abdulfatah Salem 10
Basic Variable X1 X2 S1 S2 Z Rhs
S1 4 3 1 0 0 240
X1 1 1/2 0 1/2 0 50
Z -70 -50 0 0 1 0
4
1
-70
❶
❷
1 1/2 0 1/2 0 50
4 2 0 2 0 200
1 ½ 0 1/2 0 50
-70 -35 0 -35 0 -3500
Basic Variable X1 X2 S1 S2 Z Rhs
S1
0 1 1 -2 0 40
X1
1 1/2 0 1/2 0 50
Z 0 -15 0 35 1 3500
❸
First
iteration
3/19/2020 Dr. Abdulfatah Salem 11
1
1/2
-15
❶
❷
Basic Variable X1 X2 S1 S2 Z Rhs
X2
0 1 1 -2 0 40
X1
1 1/2 0 1/2 0 50
Z 0 -15 0 35 1 3500
0 1 1 -2 0 40
0 1 1 -2 0 40
0 1/2 1/2 -1 0 20
0 -15 -15 30 0 -600
Basic Variable X1 X2 S1 S2 Z Rhs
X2 0 1 1 -2 0 40
X1 1 0 -1/2 3/2 0 30
Z 0 0 15 5 1 4100
❸
Second
iteration
3/19/2020 Dr. Abdulfatah Salem 12
BV X1 X2 S1 S2 Z Rhs
X2 0 1 1 -2 0 40
X1 1 0 -1/2 3/2 0 30
Z 0 0 15 5 1 4100
X1 = 30 No of laptops = 30
X2 = 40 No of printers = 40
Z = 4100 The optimal profit = $4100
3/19/2020 Dr. Abdulfatah Salem 13
Solve the following problem using the simplex method
Max Z = 3X1+ 5X2
S.t.
X1  4
2 X2  12
3X1 +2X2  18
X1 , X2  0
Example
Solution
Basic
variables
X1 X2 S1 S2 S3 Z RHS
S1 1 0 1 0 0 0 4
S2 0 2 0 1 0 0 12
S3 3 2 0 0 1 0 18
Z -3 -5 0 0 0 1 0
3/19/2020 Dr. Abdulfatah Salem 14
BV X1 X2 S1 S2 S3 Z RHS
S1 1 0 1 0 0 0 4
X2 0 1 0 1/2 0 0 6
S3 3 2 0 0 1 0 18
Z -3 -5 0 0 0 1 0
0
1
2
-5
0 1 0 1/2 0 0 6
0 0 0 0 0 0 0
0 1 0 1/2 0 0 6
0 2 0 1 0 0 12
0 -5 0 -5/2 0 0 -30
❶
❷
BV X1 X2 S1 S2 S3 Z RHS
S1 1 0 1 0 0 0 4
X2 0 1 0 1/2 0 0 6
S3 3 0 0 -1 1 0 6
Z -3 0 0 5/2 0 1 30
❸
First
iteration
3/19/2020 Dr. Abdulfatah Salem 15
BV X1 X2 S1 S2 S3 Z RHS
S1 1 0 1 0 0 0 4
X2 0 1 0 ½ 0 0 6
X1 1 0 0 -1/3 1/3 0 2
Z -3 0 0 5/2 0 1 30
1
0
1
-3
1 0 0 -1/3 1/3 0 2
1 0 0 -1/3 1/3 0 2
0 0 0 0 0 0 0
1 0 0 -1/3 1/3 0 2
-3 0 0 1 -1 0 -6
❶
❷
BV X1 X2 S1 S2 S3 Z RHS
S1 0 0 1 1/3 -1/3 0 2
X2 0 1 0 1/2 0 0 6
X1 1 0 0 -1/3 1/3 0 2
Z 0 0 0 3/2 1 1 36
❸
Second
iteration
3/19/2020 Dr. Abdulfatah Salem 16
BV X1 X2 S1 S2 S3 Z RHS
S1 0 0 1 1/3 -1/3 0 2
X2 0 1 0 1/2 0 0 6
X1 1 0 0 -1/3 1/3 0 2
Z 0 0 0 3/2 1 1 36
X1 = 2
X2 = 6
Z = 36
❸
19-Mar-20 Dr. Abdulfatah Salem 17
Max. Z = 13X1+11X2
ST.
4X1 + 5X2 < 1500
5X1 + 3X2 < 1575
X1 + 2X2 < 420
X1, X2 > 0
Example
Solution
X1 + 2X2 + S3 = 420
Z = 13X1+11X2
4X1 + 5X2 < 1500
5X1 + 3X2 < 1575
X1 + 2X2 < 420
Z - 13X1 - 11X2 = 0
4X1 + 5X2 + S1 = 1500
5X1 + 3X2 + S2 = 1575
19-Mar-20 Dr. Abdulfatah Salem 18
RHSS3S2S1X2X1BV
150000154S1
157501035X1
42010021S3
0000-11-13Z
RHSS3S2S1X2X1BV
150000154S1
31501/503/51X1
42010021S3
0000-11-13Z
RHSS3S2S1X2X1BV
150000154S1
157501035S2
42010021S3
0000-11-13Z
/5
19-Mar-20 Dr. Abdulfatah Salem 19
RHSS3S2S1X2X1BV
150000154S1
31501/503/51X1
42010021S3
0000-11-13Z
31501/503/51
4
1
1
-13
126004/5012/54
31501/503/51
31501/503/51
-40950-13/50-39/5-13
First
iteration
RHSS3S2S1X2X1BV
2400-4/5113/50S1
31501/503/51X1
1051-1/507/50S3
4095013/50-16/50Z
19-Mar-20 Dr. Abdulfatah Salem 20
RHSS3S2S1X2X1BV
2400-4/5113/50S1
31501/503/51X1
755/7-1/7010X2
4095013/50-16/50Z
RHSS3S2S1X2X1BV
2400-4/5113/50S1
31501/503/51X1
1051-1/507/50S3
4095013/50-16/50Z
RHSS3S2S1X2X1BV
2400-4/5113/50S1
31501/503/51X1
1051-1/507/50X2
4095013/50-16/50Z
*5/7
19-Mar-20 Dr. Abdulfatah Salem 21
RHSS3S2S1X2X1BV
2400-4/5113/50S1
31501/503/51X1
755/7-1/7010X2
4095013/50-16/50Z
19513/7-13/35013/50
453/7-3/3503/50
755/7-1/7010
-240-16/3516/350-16/50
RHSS3S2S1X2X1BV
45-13/7-15/35100S1
270-3/710/35001X1
755/7-1/7010X2
433516/3575/35000Z
755/7-1/7010
13/5
3/5
1
-16/5
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 22
RHSS3S2S1X2X1BV
45-13/7-15/35100S1
270-3/710/35001X1
755/7-1/7010X2
433516/3575/35000Z
RHSBV
45S1
270X1
75X2
4335Z
270X1
75X2
4335Z
3/19/2020 Dr. Abdulfatah Salem 23
Max Z = 2X1 + 4X2
X1 + 4X2 ≥ 12
X1 + 3X2 ≥ 10
Z - 2X1 - 4X2 = 0
X1 + 4X2 + S1 = 12
X1 + 3X2 + S2 = 10
RHSS2S1X2X1BV
120141S1
101031S2
000-4--2Z
Example
Solution
Z -2X1 - 4X2 = 0
X1 + 4X2 ≥ 12
X1 + 3X2 ≥ 10
3/19/2020 Dr. Abdulfatah Salem 24
RHSS2S1X2X1BV
301/411/4X2
101031S2
000-4--2Z
301/411/4
1
3
-4
301/411/4
903/433/4
-120-1-4-1
❶
❷
❸
First
iteration
RHSS2S1X2X1BV
301/411/4X2
11-3/401/4S2
12010-1Z
3/19/2020 Dr. Abdulfatah Salem 25
RHSS2S1X2X1BV
301/411/4X2
44-301X1
12010-1Z
44-301
1/4
1
-1
11-3/401/4
44-301
-4-430-1
❶
❷
❸
Second
iteration
RHSS2S1X2X1BV
2-1110X2
44-301X1
164-200Z
3/19/2020 Dr. Abdulfatah Salem 26
RHSS2S1X2X1BV
2-1110S1
44-301X1
164-200Z
1
-3
-2
2-1110
2-1110
-63-3-30
-42-2-20
RHSS2S1X2X1BV
2-1110S1
101031X1
202020Z
❶
❷
❸
third
iteration
3/19/2020 Dr. Abdulfatah Salem 27
RHSS2S1X2X1BV
2-1110S1
101031X1
202020Z
RHSBV
2S1
10X1
20Z
10X1
0X2
20Z
19-Mar-20 Dr. Abdulfatah Salem 28
Example :
Max 20X1 + 8X2
S.T.
9X1 + 4X2 ≤ 36
2X1 - X2 ≤ 2
X1 + X2 ≤ 8
16X1 ≤ 32
Z -20X1 - 8X2 =0
9X1 + 4X2 + S2 = 36
2X1 - X2 + S1 = 2
X1 + X2 + S3 = 8
16X1 + S4 = 32
Max 20X1 + 8X2
S.T.
9X1 + 4X2 ≤ 36
2X1 - X2 ≤ 2
X1 + X2 ≤ 8
16X1 ≤ 32
Solution :
19-Mar-20 Dr. Abdulfatah Salem 29
X1 X2 S1 S2 S3 S4 RHS
X1 2 -1 1 0 0 0 2
S2 9 4 0 1 0 0 36
S3 1 1 0 0 1 0 8
S4 16 0 0 0 0 1 32
Z -20 -8 0 0 0 0 0
X1 X2 S1 S2 S3 S4 RHS
X1 1 -1/2 1/2 0 0 0 1
S2 9 4 0 1 0 0 36
S3 1 1 0 0 1 0 8
S4 16 0 0 0 0 1 32
Z -20 -8 0 0 0 0 0
First iteration
❶
19-Mar-20 Dr. Abdulfatah Salem 30
1 -1/2 1/2 0 0 0 1
1
9
1
16
-20
1 -1/2 1/2 0 0 0 1
9 -9/2 9/2 0 0 0 9
1 -1/2 ½ 0 0 0 1
16 -8 8 0 0 0 16
-20 10 -10 0 0 0 -20
0 17/2 -9/2 1 0 0 27
0 3/2 -1/2 0 1 0 7
0 8 -8 0 0 1 16
0 -18 10 0 0 0 20
❷
❸
19-Mar-20 Dr. Abdulfatah Salem 31
X1 X2 S1 S2 S3 S4 RHS
X1 1 -1/2 1/2 0 0 0 1
S2 0 17/2 -9/2 1 0 0 27
S3 0 3/2 -1/2 0 1 0 7
X2 0 1 -1 0 0 1/8 2
Z 0 -18 10 0 0 0 20
Second iteration
0 1 -1 0 0 1/8 2
-1/2
17/2
3/2
1
-18
0 -1/2 1/2 0 0 -1/16 -1
0 17/2 -17/2 0 0 17/16 17
0 3/2 -3/2 0 0 3/16 3
0 1 -1 0 0 1/8 2
0 -18 18 0 0 -18/8 -36
❶
❷
19-Mar-20 Dr. Abdulfatah Salem 32
1 0 0 0 0 1/16 2
0 0 4 1 1 -17/16 10
0 0 1 0 0 -3/16 4
0 1 -1 0 0 1/8 2
0 0 -8 0 0 18/8 56
X1 X2 S1 S2 S3 S4 RHS
X1 1 0 0 0 0 1/16 2
S1 0 0 1 1/4 1/4 -17/64 10/4
S3 0 0 1 0 0 -3/16 4
X2 0 1 -1 0 0 1/8 2
Z 0 0 -8 0 0 18/8 56
Third iteration
❶
❸
19-Mar-20 Dr. Abdulfatah Salem 33
0
1
1
-1
-8
0 0 1 1/4 1/4 -17/64 10/4
0 0 O 0 0 0 0
0 0 1 1/4 1/4 -17/64 10/4
0 0 1 1/4 1/4 -17/64 10/4
0 0 -1 -1/4 -1/4 17/64 -10/4
0 0 -8 -2 -2 17/8 -20
1 0 0 0 0 1/16 2
0 0 1 1/4 1/4 -17/64 10/4
0 0 0 -1/4 -2/9 5/64 6/4
0 1 0 ¼ 2/9 -9/64 18/4
0 0 0 2 0 1/8 76
❷
19-Mar-20 Dr. Abdulfatah Salem 34
X1 X2 S1 S2 S3 S4 RHS
X1 1 0 0 0 0 1/16 2
S1 0 0 1 1/4 1/4 -17/64 10/4
S3 0 0 0 -1/4 -2/9 5/64 6/4
X2 0 1 0 ¼ 2/9 -9/64 18/4
Z 0 0 0 2 0 1/8 76
X1 2
X2 18/4
Z 76
❸
19-Mar-20 Dr. Abdulfatah Salem 35
Example :
Solution :
Min Z = X1 - 3X2 + 3X3
S.T.
3X1 - X2 + 2X3 ≤ 7
2X1 + 4X2 ≥ -12
4X1 - 3X2 - 8X3 ≥ -10
X1, X2, X3 ≥ 0
Min Z = X1 - 3X2 + 3X3
S.T.
3X1 - X2 + 2X3 ≤ 7
-2X1 + -4X2 ≤ 12
-4X1 + 3X2 + 8X3 ≤ 10
X1, X2, X3 ≥ 0
19-Mar-20 Dr. Abdulfatah Salem 36
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
1010083-4S3
0000-33-1Z
3X1 - X2 + 2X3 + S1 = 7
-2X1 - 4X2 + S2 = 12
-4X1 + 3X2 + 8X3 + S3 = 10
Z - X1 + 3X2 - 3X3 = 0
/3
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
1010083-4S3
0000-33-1Z
10/31/3008/31-4/3X2
19-Mar-20 Dr. Abdulfatah Salem 37
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
10/31/3008/31-4/3X2
0000-33-1Z
10/31/3008/31-4/3
-1
-4
1
3
-10/3-1/300-8/3-14/3
-40/3-4/30032/3-416/3
10/31/3008/31-4/3
1010083-4
❶
❷
RHSS3S2S1X3X2X1BV
31/31/30114/305/3S1
61/34/310-32/30-22/3S2
10/31/3008/31-4/3X2
-10-100-1103Z
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 38
RHSS3S2S1X3X2X1BV
31/51/503/514/501X1
61/34/310-32/30-22/3S2
10/31/3008/31-4/3X2
-10-100-1103Z
31/51/503/514/501
1
-22/3
-4/3
3
31/51/503/514/501
-682/15-22/150-66/15-305/150-22/3
-124/15-4/150-4/5-56/150-4/3
93/53/509/542/503
RHSS3S2S1X3X2X1BV
31/51/503/514/501X1
987/1542/15166/15000S2
58/519/1504/596/1510X2
-143/5-8/50-9/5-97/500Z
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 39
RHSS3S2S1X3X2X1BV
31/51/503/514/501X1
987/1542/15166/15000S2
58/519/1504/596/1510X2
-143/5-8/50-9/5-97/500Z
The optimal solution will be :
X1 = 31/5
X2 = 58/5
X3 = 0
Z = -143/5
19-Mar-20 Dr. Abdulfatah Salem 40
Example :
Solution :
Let P = -Z = -X1 + 3X2 - 3X3
Min Z = Min –P
Min Z = - Max P
Max P = -X1 + 3X2 - 3X3
S.T 3X1 - X2 + 2X3 ≤ 7,
2X1 + 4X2 ≥ -12,
-4X1 + 3X2 + 8X3 ≤ 10
X1, X2, X3 ≥ 0
Min Z = X1 - 3X2 + 3X3
S.T.
3X1 - X2 + 2X3 ≤ 7
2X1 + 4X2 ≥ -12
4X1 - 3X2 - 8X3 ≥ -10
X1, X2, X3 ≥ 0
19-Mar-20 Dr. Abdulfatah Salem 41
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
1010083-4S3
00003-31P
3X1 - X2 + 2X3 + S1 = 7
-2X1 - 4X2 + S2 = 12
-4X1 + 3X2 + 8X3 + S3 = 10
P X1 - 3X2 + 3X3 = 0
RHSS3S2S1X3X2X1BV
70012-13S1
0100-4-2S2
1010083-4S3
00003-31P
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
10/31/3008/31-4/3S3
00003-31P
/3
19-Mar-20 Dr. Abdulfatah Salem 42
RHSS3S2S1X3X2X1BV
70012-13S1
120100-4-2S2
10/31/3008/31-4/3X2
00003-31P
-1
-4
1
-3
10/31/3008/31-4/3
-10/3-1/300-8/3-14/3
-40/3-4/300-32/3-416/3
10/31/3008/31-4/3
-10-100-8-34
RHSS3S2S1X3X2X1BV
31/31/30114/305/3S1
76/34/31032/30-22/3S2
10/31/3008/31-4/3X2
10100110-3P
❶
❷
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 43
RHSS3S2S1X3X2X1BV
31/51/503/514/501X1
76/34/31032/30-22/3S2
10/31/3008/31-4/3X2
10100110-3P
1
-22/3
-4/3
-3
31/51/503/514/501
31/51/503/514/501
-682/15-22/150-66/15-308/150-22/3
-124/15-4/150-4/5-56/150-4/3
-93/5-3/50-9/5-42/50-3
RHSS3S2S1X3X2X1BV
31/51/503/514/501X1
324/542/15166/15468/1500S2
58/59/1504/596/1510X2
143/58/509/597/500P
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 44
The optimal solution will be :
X1 = 31/5
X2 = 58/5
X3 = 0
P = 143/5
Z = -P = -143/5
RHSS3S2S1X3X2X1BV
31/51/503/514/501S1
324/542/15166/15468/1500S2
58/59/1504/596/1510X2
143/58/509/597/500P
3/19/2020 Dr. Abdulfatah Salem 45
The Dual method
If standard form
The Big-M method
If not standard form
3/19/2020 Dr. Abdulfatah Salem 46
The Dual method
 In solving the linear programming problem, it helps to note that
each maximization problem is associated with a minimization
problem, and vice versa.
 The given problem is called the primal problem, and the related
problem is called the dual problem.
 The solution of maximizing (primal) problem produces the
solution of associated minimizing (dual) problem, and vice-
versa.
3/19/2020 Dr. Abdulfatah Salem 47
The Duality Theorem
 A primal problem has a solution if and only if the corresponding dual
problem has a solution.
 Furthermore, if a solution exists, then:
 The objective functions of both the primal and the dual problem attain
the same optimal value.
 When the dual optimal case reached, the optimal solution to the
primal problem appears under the slack variables in the last row of
the final simplex tableau associated with the dual problem.
3/19/2020 Dr. Abdulfatah Salem 48
The Dual Problem
Primalproblem Dualproblem
M variables N variables
N constraints M constraints
Coefficients of objective function Constants ( RHS)
Constants ( RHS) Coefficients of objective function
3/19/2020 Dr. Abdulfatah Salem 49
transpose
Min P = 8y1 + 16y2
St: y1 + 5y2  9
2y1 + 2y2  10
y1  0, y2  0.
Max Z = 9x1 + 10 x2
St: x1 + 2x2  8
5x1 + 2x2  16
x1  0 , x2  0
3/19/2020 Dr. Abdulfatah Salem 50
Min Z = 6X1 + 8X2
St. 40X1 + 10X2 ≥ 2400
10X1 + 15X2 ≥ 2100
5X1 + 15X2 ≥ 1500
X1 X2 Constant
40 10 ≥ 2400
10 15 ≥ 2100
5 15 ≥ 1500
6 8
S1 S2 S3 Constant
40 10 5 ≤ 6
10 15 15 ≤ 8
2400 2100 1500
Example
Solution
3/19/2020 Dr. Abdulfatah Salem 51
The dual problem (Max) associated with this problem:
Max Z = 2400S1 + 2100S2 + 1500S3
St. 40S1 + 10S2 + 5S3 ≤ 6
10S1 + 15S2 + 15S3 ≤ 8
S1 S2 S3
Constant
40 10 5 ≤ 6
10 15 15 ≤ 8
2400 2100 1500
Dual
3/19/2020 Dr. Abdulfatah Salem 52
The max. standard equations will be
P - 2400S1 - 2100S2 - 1500S3 = 0
40S1 + 10S2 + 5S3 + X1 = 6
10S1 + 15S2 + 15S3 + X2 = 8
RHSPX2X1S3S2S1
BV
600151040X1
8010151510X2
0100-1500-2100-2400P
RHSPX2X1S3S2S1
BV
600151040X1
8010151510X2
0100-1500-2100-2400P
3/20001/401/81/41S1 /40
3/19/2020 Dr. Abdulfatah Salem 53
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
8010151510X2
0100-1500-2100-2400P
3/20001/401/81/41
1
10
-2400
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
3/2001/45/45/210X2
-36000-60-300-600-2400P
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
13/201-1/425/425/20X2
3601060-1200-15000P
First
iteration
❶
❷
❸
3/19/2020 Dr. Abdulfatah Salem 54
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
13/201-1/425/425/20X2
3601060-1200-15000P
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
13/2502/25-1/501/210S2
3601060-1200-15000P
3/19/2020 Dr. Abdulfatah Salem 55
RHSPX2X1S3S2S1BV
3/20001/401/81/41S1
13/2502/25-1/501/210S2
3601060-1200-15000P
13/2502/25-1/501/210
1/4
1
-1500
RHSPX2X1S3S2S1BV
13/10001/50-1/1001/81/40S1
13/2502/25-1/501/210S2
-7800-12030-750-15000P
RHSPX2X1S3S2S1BV
-8/1000-1/5014/400001S1
13/2502/25-1/501/210S2
1140112030-45000P
Second
iteration
❶
❷
❸
3/19/2020 Dr. Abdulfatah Salem 56
Write the dual problem (Max) associated with this problem:
Min Z = 6X1 + 8X2
St. 40X1 + 10X2 ≥ 2400
10X1 + 15X2 ≥ 2100
5X1 + 15X2 ≥ 1500
Primal
X1 = 30
X2 = 120
Z = 1140
RHSPX2X1S3S2S1BV
-8/1000-1/5014/400001S1
13/2502/25-1/501/210S2
1140112030-45000P
3/19/2020 Dr. Abdulfatah Salem 57
Min Z = 150X1 + 80X2 + 50X3 + 8X4
St. 12X1 + 8X2 + 2X3 + X4 ≥ 25
10X1 + 4X2 + 4X3 + 2X4 ≥ 20
X1,X2 ,X3,X4 ≥ 0
S1 S2 Constant
12 10 ≤ 150
8 4 ≤ 80
2 4 ≤ 50
1 2 ≤ 8
25 20
X1 X2 X3 X4 Constant
12 8 2 1 ≥ 25
10 4 4 2 ≥ 20
150 80 50 8
Primal
Example
Solution
3/19/2020 Dr. Abdulfatah Salem 58
S1 S2 Constant
12 10 ≤ 150
8 4 ≤ 80
2 4 ≤ 50
1 2 ≤ 8
25 20
Max P = 25S1 + 20S2
St. 12S1 + 10S2 ≥ 150
8S1 + 4S2 ≥ 80
2S1 + 4S2 ≥ 50
S1 + 2S2 ≥ 8
Dual
3/19/2020 Dr. Abdulfatah Salem 59
Max P = 25S1 + 20S2
St. 12S1 + 10S2 ≥ 150
8S1 + 4S2 ≥ 80
2S1 + 4S2 ≥ 50
S1 + 2S2 ≥ 8
P - 25S1 + 20S2 = 0
12S1 + 10S2 + X1 = 150
8S1 + 4S2 + X2 = 80
2S1 + 4S2 + X3 = 50
S1 + 2S2 + X4 = 8
Dual
3/19/2020 Dr. Abdulfatah Salem 60
P - 25S1 - 20S2 = 0
12S1 + 10S2 + X1 = 150
8S1 + 4S2 + X2 = 80
2S1 + 4S2 + X3 = 50
S1 + 2S2 + X4 = 8
RHSX4X3X2X1S1S1
15000011012X1
80001048X2
50010042X3
8100021X4
00000-20-25P
3/19/2020 Dr. Abdulfatah Salem 61
RHSX4X3X2X1S1S1
15000011012X1
80001048X2
50010042X3
8100021X4
00000-20-25P
RHSX4X3X2X1S1S1
96120002412X1
648000168X2
16200042X3
8100021S1
-200-25000-50-25P
8100021
12
8
2
1
-25
First
iteration
❶
❷
❸
3/19/2020 Dr. Abdulfatah Salem 62
RHSX4X3X2X1
S1S1
54-12001-140X1
16-8010120X2
34-210000X3
8100021S1
20025000300P
❸
3/19/2020 Dr. Abdulfatah Salem 63
RHSX4X3X2X1S1S1
54-12001-140X1
16-8010120X2
34-210000X3
8100021S1
20025000300P
Min Z = 150X1 + 80X2 +50X3+ 8X4
St. 12X1 + 8X2 + 2X3 + X4 ≥ 25
10X1 + 4X2 + 4X3 + 2X4 ≥ 20
Z=200
X1 =0
X2 =0
X3 =0
X4 =25
Primal
19-Mar-20 Dr. Abdulfatah Salem 64
Max P= 5X1 + 12X2 + 4X3
S.T. X1 +2X2+X3 ≤ 10
2X1 - X2 + 3X3 ≤ 8
X1 , X2 , X3 ≥ 0
Min Z= 10Y1 + 8Y2
S.T. Y1 +2Y2  5
2Y1 - Y2  12
Y1 + 3Y2  4
Y1 , Y2 ≥ 0
Example :
Solution :
19-Mar-20 Dr. Abdulfatah Salem 65
RHSY2Y1X3X2X1BV
1001121Y1
8103-12Y2
000-4-12-5P
Max P= 5X1 + 12X2 + 4X3
S.T. X1 +2X2+X3 ≤ 10
2X1 - X2 + 3X3 ≤ 8
X1 , X2 , X3 ≥ 0
P - 5X1 - 12X2 - 4X3 = 0
X1 + 2X2 + X3 + Y1 = 10
2X1 - X2 + 3X3 + Y2 = 8
X2
2
-1
-12
1001121X2 501/21/221/2X2
19-Mar-20 Dr. Abdulfatah Salem 66
1001121
1
-1
-12
501/21/211/2
501/21/211/2
-50-1/2-1/2-1-1/2
-600-6-6-12-6
501/21/211/2
1311/27/205/2
6006201
RHSY2Y1X3X2X1BV
501/21/211/2Y1
8103-12Y2
000-4-12-5P
❶
❷
❸
19-Mar-20 Dr. Abdulfatah Salem 67
RHSY2Y1X3X2X1BV
501/21/211/2X2
1311/27/205/2Y2
6006201P
Min Z = 10Y1 + 8Y2
S.T. Y1 + 2Y2  5
2Y1 - Y2  12
Y1 + 3Y2  4
Y1 , Y2 ≥ 0
Y1 = 6
Y2 = 0
P = 60
Y1 Y2 Y3 X1 X2 RHS
X1 2 1 3 1 0 8
Y2 1/2 1 1/2 0 1/2 7/2
Z -6 -12 0 0 0 0
1/2 1 1/2 0 1/2 7/2
1
1
-12
1/2 1 1/2 0 1/2 7/2
1/2 1 1/2 0 1/2 7/2
-6 -12 -6 0 -6 -42
3/2 0 5/2 1 -1/2 9/2
1/2 1 1/2 0 1/2 7/2
0 0 6 0 6 42
Y1 Y2 Y3 X1 X2 RHS
X1 3/2 0 5/2 1 -1/2 9/2
Y2 1/2 1 1/2 0 1/2 7/2
Z 0 0 6 0 6 42
X1 X2
0 6
First iteration
19-Mar-20 Dr. Abdulfatah Salem 69
Solving the non standard LP model
The Method
Suppose that you add n artificial variables A1 , A2 , …. , An to the LP model
Build the initial tableau representing the LP model with rows representing the
constraints’ equations and last row representing the modified objective function
Ž where :
Model modification
Add M[A1 + A2 + …. + An]to the objective function Eqn. if the model is Min.
Subtract M[A1 + A2 + …. + An] from the objective function Eqn. if the model is Max.
Ž row = Z row + M[A1row + A2row + …. + Anrow] if the model is Min.
Ž row = Z row - M[A1row + A2row + …. + Anrow] if the model is Max.
19-Mar-20 Dr. Abdulfatah Salem 70
Solve the following linear programming problem by using the
simplex method:
Min Z = 12 X1 + 20 X2
S.t.
6X1 + 8X2  100
7X1 + 12X2  120
X1, X2  0
The Method
Artificial Variable Technique
Example :
19-Mar-20 Dr. Abdulfatah Salem 71
6X1 + 8X2 - S1 + A1 = 100
7X1 + 12X2 - S2 + A2 = 120
Z - 12 X1 - 20 X2 -M(A1 + A2) = 0
Solution:
RHSA2A1X2X1Basic Variable
1000186A1
12010127A2
0-M-M-20-12Z
19-Mar-20 Dr. Abdulfatah Salem 72
RHSA2A1X2X1Basic Variable
1000186A1
12010127A2
0-M-M-20-12Z
100M0M8M6MA1
120MM012M7MA2
220MMM20M13MA1 + A2
220M00-20 +20M-12+13MNew Z = old Z + A1 + A2
RHSA2A1X2X1Basic Variable
1000186A1
12010127A2
220M00-20 +20M-12+13MZ
19-Mar-20 Dr. Abdulfatah Salem 73
RHSA2A1X2X1Basic Variable
1000186A1
12010127X2
220M00-20 +20M-12 +13MZ
RHSA2A1X2X1Basic Variable
1000186A1
101/12017/12X2
220M00-20 +20M-12 +13MZ
/12
19-Mar-20 Dr. Abdulfatah Salem 74
RHSA1X2X1Basic Variable
100186A1
10017/12X2
220M020(M-1)-12 +13MZ
10017/12
8
1
20(M-1)
800856/12
10017/12
200(M-1)020(M-1)35/3(M-1)
RHSA1X2X1Basic Variable
20104/3A1
10017/12X2
20M+200001/3(4M-1)Z
❶
❷
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 75
RHSA1X2X1Basic Variable
20104/3A1
10017/12X2
20M+200001/3(4M-1)Z
RHSX2X1Basic Variable
1501X1
1017/12X2
20M+20001/3(4M-1)Z
*3/4
19-Mar-20 Dr. Abdulfatah Salem 76
RHSX2X1Basic Variable
1501X1
1017/12X2
20M+20001/3(4M-1)Z
1501
1
7/12
1/3(4M-1)
1501
35/407/12
5(4M-1)01/3(4M-1)
RHSX2X1Basic Variable
1501X1
5/410X2
20500Z
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 77
RHSX2X1Basic Variable
1501X1
5/410X2
20500Z
This solution is optimal, since there is no positive
value in the last row. The optimal solution is:
X1 = 15, X2 = 5/4 Z = 205
19-Mar-20 Dr. Abdulfatah Salem 78
MAX Z = 3X1 – X2
S.T.
2X1 + X2 ≤ 2,
X1 + 3X2 ≥ 3,
X1 ≤ 4
X1, X2 , ≥ 0
Example :
S.T.
2X1 + X2 + S1 = 2
X1 + 3X2 – S2 + A1 = 3
X1 + S3 = 4
MAX Z = 3X1 – X2 - MA1
Solution :
19-Mar-20 Dr. Abdulfatah Salem 79
S.T.
2X1 + X2 + S1 = 2
X1 + 3X2 – S2 + A1 = 3
X1 + S3 = 4
MAX Z - 3X1 + X2 + MA1 = 0
RHSA1S3S1X2X1BV
200112S1
310031A1
401001S3
0+M001-3Z
19-Mar-20 Dr. Abdulfatah Salem 80
RHSA1S3S1X2X1BV
200112S1
310031A1
401001S3
-3M0001-3M-3-MZ
RHSA1S3S1X2X1BV
200112S1
11/30011/3A1
401001S3
-3M0001-3M-3-MZ
/3
19-Mar-20 Dr. Abdulfatah Salem 81
RHSS3S1X2X1BV
20112S1
10011/3X2
41001S3
-3M001-3M-3-MZ
10011/3
1
1
0
1-3M
10011/3
10011/3
00000
1-3M001-3M1/3-M
RHSS3S1X2X1BV
10105/3S1
10011/3X2
41001S3
-1000-10/3Z
❶
❷
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 82
RHSS3S1X2X1BV
10105/3S1
10011/3X2
41001S3
-1000-10/3Z
RHSS3X2X1BV
3/5001X1
1011/3X2
4101S3
-100-10/3Z
*3/5
19-Mar-20 Dr. Abdulfatah Salem 83
RHSS3X2X1BV
3/5001X1
1011/3X2
4101S3
-100-10/3Z
3/5001
1
1/3
1
-10/3
3/5001
1/5001/3
3/5001
-200-10/3
RHSS3X2X1BV
3/5001X1
4/5010X2
17/5100S3
1000Z
❶
❷
❸
Second
iteration
RHSS3X2X1BV
3/5001X1
4/5010X2
17/5100S3
1000Z
19-Mar-20 Dr. Abdulfatah Salem 84
The optimal solution is
X1 = 3/5
X2 = 4/5
Z = 3 X1 – X2 = 1
19-Mar-20 Dr. Abdulfatah Salem 85
Min Z = 2 X1 + 3 X2
S.t.
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0
Example :
½ X1 + ¼ X2 + S1 = 4
X1 + 3X2 - S2 + A1 = 20
X1 + X2 + A2 = 10
Z – 2 X1 – 3 X2 - MA1 - MA2 = 0
Solution:
19-Mar-20 Dr. Abdulfatah Salem 86
Basic variables X1 X2 S1 S2 A1 A2 RHS
S1 1/2 1/4 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z -2 -3 0 0 -M -M 0
19-Mar-20 Dr. Abdulfatah Salem 87
Basic variables X1 X2 S1 S2 A1 A2 RHS
S1 1/2 1/4 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z -2 +2M -3 + 4M 0 -M 0 0 30M
Basic variables X1 X2 S1 A2 RHS
S1 1/2 1/4 1 0 4
X2 1/3 1 0 0 20/3
A2 1 1 0 1 10
Z -2 +2M -3 + 4M 0 0 30M
/3
19-Mar-20 Dr. Abdulfatah Salem 88
Basic variables X1 X2 S1 A2 RHS
S1 1/2 1/4 1 0 4
X2 1/3 1 0 0 20/3
A2 1 1 0 1 10
Z -2 +2M -3 + 4M 0 0 30M
1/3 1 0 0 20/3
1/4
1
1
-3 + 4M
1/12 1/4 0 0 5/3
1/3 1 0 0 20/3
1/3 1 0 0 20/3
4/3M-1 4M-3 0 0 80/3M-20
Basic variables X1 X2 S1 A2 RHS
S1 5/12 0 1 0 7/3
X2 1/3 1 0 0 20/3
A2 2/3 0 0 1 10/3
Z 2/3M-1 0 0 0 10/3M+20
❶
❷
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 89
Basic variables X1 X2 S1 A2 RHS
S1 5/12 0 1 0 7/3
X2 1/3 1 0 0 20/3
A2 2/3 0 0 1 10/3
Z 2/3M-1 0 0 0 10/3M+20
Basic variables X1 X2 S1 RHS
S1 5/12 0 1 7/3
X2 1/3 1 0 20/3
X1 1 0 0 5
Z 2/3M-1 0 0 10/3M+20
*3/2
19-Mar-20 Dr. Abdulfatah Salem 90
Basic variables X1 X2 S1 RHS
S1 5/12 0 1 7/3
X2 1/3 1 0 20/3
X1 1 0 0 5
Z 2/3M-1 0 0 10/3M+20
1 0 0 5
5/12
1/3
1
2/3M-1
5/12 0 0 25/12
1/3 0 0 5/3
1 0 0 5
2/3M-1 0 0 10/3M-5
Basic variables X1 X2 S1 RHS
S1 0 0 1 1/4
X2 0 1 0 5
X1 1 0 0 5
Z 0 0 0 25
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 91
X1 = 5
X2 = 5
Z = 25
Basic
variables
X1 X2 S1 RHS
S1 0 0 1 1/4
X2 0 1 0 5
X1 1 0 0 5
Z 0 0 0 25
19-Mar-20 Dr. Abdulfatah Salem 92
Min Z = 600X1 + 500X2
ST.
2X1 + X2 ≥ 80
X1 +2X2 ≥ 60
X1, X2 ≥ 0
2X1 + X2 - S1 + A1 = 80
X1 + 2X2 - S2 + A2 = 60
Z - 600X1 - 500X2 - M A1 - M A2 = 0
Example :
Solution:
Basic variables X1 X2 A1 A2 RHS
A1 2 1 1 0 80
A2 1 2 0 1 60
Z -600 -500 -M -M 0
19-Mar-20 Dr. Abdulfatah Salem 93
Basic
variables
X1 X2 A1 RHS
A1 2 1 1 80
X2 1 2 0 60
Z -600+3M -500+3M 0 140M
Basic
variables
X1 X2 A1 RHS
A1 2 1 1 80
X2 1/2 1 0 30
Z -600+3M -500+3M 0 140M
19-Mar-20 Dr. Abdulfatah Salem 94
Basic variables X1 X2 A1 RHS
A1 2 1 1 80
X2 1/2 1 0 30
Z -600+3M -500+3M 0 140M
1/2 1 0 30
1
1
-500+3M
1/2 1 0 30
1/2 1 0 30
3/2M-250 -500+3M 0 90M-15000
Basic variables X1 X2 A1 RHS
A1 3/2 0 1 50
X2 1/2 1 0 30
Z 3/2M-350 0 0 50M+15000
❶
❷
❸
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 95
Basic
variables
X1 X2 A1 RHS
A1 3/2 0 1 50
X2 1/2 1 0 30
New Z 3/2M-350 0 0 50M+15000
Basic
variables
X1 X2 RHS
X1 1 0 100/3
X2 1/2 1 30
New Z 3/2M-350 0 50M+15000
*2/3
19-Mar-20 Dr. Abdulfatah Salem 96
Basic
variables
X1 X2 RHS
X1 1 0 100/3
X2 1/2 1 30
New Z 3/2M-350 0 50M+15000
1
1/2
3/2M-350
1 0 100/3
1 0 100/3
1/2 0 50/3
3/2M-350 0 50M-35000/3
Basic variables X1 X2 RHS
X1 1 0 100/3
X2 0 1 40/3
New Z 0 0 80000/3
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 97
X1 = 100/3
X2 = 40/3
Z = 80000/3
Basic
variables
X1 X2 RHS
X1 1 0 100/3
X2 0 1 40/3
New Z 0 0 80000/3
19-Mar-20 Dr. Abdulfatah Salem 98
Min Z = 4X1 +X2
S.T:
3X1 +X2 = 3
4X1 +3X2 ≥ 6
X1 +2X2 ≤ 3
X1, X2 ≥ 0.
Min Z = 4X1 +X2 + M(A1 + A2)
S.T:
3X1 +X2 + A1= 3
4X1 +3X2 - S1 + A2 = 6
X1 +2X2 + S2 = 3
Example :
19-Mar-20 Dr. Abdulfatah Salem 99
Z - 4X1 - X2 - M(A1 + A2) = 0
3X1 +X2 + A1= 3
4X1 +3X2 - S1 + A2 = 6
X1 +2X2 + S2 = 3
B.V. X1 X2 S1 S2 A1 A2 RHS
A1 3 1 0 0 1 0 3
A2 4 3 -1 0 0 1 6
S2 1 2 0 1 0 0 3
Z -4 -1 0 0 -M -M 0
19-Mar-20 Dr. Abdulfatah Salem 100
B.V. X1 X2 S1 S2 A1 A2 RHS
A1 3 1 0 0 1 0 3
A2 4 3 -1 0 0 1 6
S2 1 2 0 1 0 0 3
Z -4 -1 0 0 -M -M 0
B.V. X1 X2 S2 A1 A2 RHS
A1 3 1 0 1 0 3
A2 4 3 0 0 1 6
S2 1 2 1 0 0 3
New Z -4+7M -1+4M 0 0 0 9M
19-Mar-20 Dr. Abdulfatah Salem 101
B.V. X1 X2 S2 A1 A2 RHS
A1 3 1 0 1 0 3
A2 4 3 0 0 1 6
S2 1 2 1 0 0 3
Z -4+7M -1+4M 0 0 0 9M
B.V. X1 X2 S2 A1 A2 RHS
A1 1 1/3 0 1/3 0 1
A2 4 3 0 0 1 6
S2 1 2 1 0 0 3
Z -4+7M -1+4M 0 0 0 9M
19-Mar-20 Dr. Abdulfatah Salem 102
B.V. X1 X2 S2 A2 RHS
X1 1 1/3 0 0 1
A2 4 3 0 1 6
S2 1 2 1 0 3
Z -4+7M -1+4M 0 0 9M
1 1/3 0 0 1
1
4
1
-4+7M
1 1/3 0 0 1
4 4/3 0 0 4
1 1/3 0 0 1
-4+7M -4+7M/3 0 0 -4+7M
❶
❷
❸
B.V. X1 X2 S2 A2 RHS
X1 1 1/3 0 0 1
A2 0 5/3 0 1 2
S2 0 5/3 1 0 2
Z 0 1+5M/3 0 0 4+2M
First
iteration
19-Mar-20 Dr. Abdulfatah Salem 103
B.V. X1 X2 S2 A2 RHS
X1 1 1/3 0 0 1
A2 0 5/3 0 1 2
S2 0 5/3 1 0 2
Z 0 1+5M/3 0 0 4+2M
B.V. X1 X2 S2 RHS
X1 1 1/3 0 1
X2 0 1 0 6/5
S2 0 5/3 1 2
Z 0 1+5M/3 0 4+2M
19-Mar-20 Dr. Abdulfatah Salem 104
B.V. X1 X2 S2 RHS
X1 1 1/3 0 1
X2 0 1 0 6/5
S2 0 5/3 1 2
Z 0 1+5M/3 0 4+2M
1/3
1
5/3
1+5M/3
0 1 0 6/5
0 1/3 0 2/5
0 1 0 6/5
0 5/3 0 2
0 1+5M/3 0 2/5 + 2M
B.V. X1 X2 S2 RHS
X1 1 0 0 3/5
X2 0 1 0 6/5
S2 0 0 1 0
Z 0 0 0 18/5
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 105
B.V. X1 X2 S2 RHS
X1 1 0 0 3/5
X2 0 1 0 6/5
S2 0 0 1 0
Z 0 0 0 18/5
X1 3/5
X2 6/5
Z 18/5
19-Mar-20 Dr. Abdulfatah Salem 106
B.V. X1 X2 S2 A2 RHS
X1 1 1/3 0 0 1
A2 0 5/3 0 1 2
S2 0 5/3 1 0 2
New Z 0 1+5M/3 0 0 4+2M
B.V. X1 X2 A2 RHS
X1 1 1/3 0 1
A2 0 5/3 1 2
X2 0 1 0 6/5
New Z 0 1+5M/3 0 4+2M
Other Solution
19-Mar-20 Dr. Abdulfatah Salem 107
B.V. X1 X2 A2 RHS
X1 1 1/3 0 1
A2 0 5/3 1 2
X2 0 1 0 6/5
New Z 0 1+5M/3 0 4+2M
0 1 0 6/5
1/3
5/3
1
1+5M/3
0 1/3 0 2/5
0 5/3 0 2
0 1 0 6/5
0 1+5M/3 0 2/5 + 2M
B.V. X1 X2 A2 RHS
X1 1 0 0 3/5
A2 0 0 1 0
X2 0 1 0 6/5
New Z 0 0 0 18/5
❶
❷
❸
Second
iteration
19-Mar-20 Dr. Abdulfatah Salem 108
B.V. X1 X2 A2 RHS
X1 1 0 0 3/5
A2 0 0 1 0
X2 0 1 0 6/5
Z 0 0 0 18/5
X1 3/5
X2 6/5
Z 18/5
19-Mar-20 Dr. Abdulfatah Salem 109
Min Z = 3X1 + 4X2
ST.
2X1 + X2 ≤ 16
2X1 + 6X2  40
X1 + X2 = 10
X1, X2  0
Z - 3X1 - 4X2 - MA1 - MA2 = 0
2X1 + X2 + S1 = 16
2X1 + 6X2 - S2 + A1 = 40
X1 + X2 + A2 = 10
RHSA2A1S1X2X1BV
1600112S1
4001062A1
1010011A2
0-M-M0-4-3Z
Example :
19-Mar-20 Dr. Abdulfatah Salem 110
RHSA2S1X2X1BV
160112S1
400062X2
101011A2
50M007M - 43M - 3New Z
RHSA2S1X2X1BV
160112S1
40/60011/3X2
101011A2
50M007M - 43M - 3New Z
/6
19-Mar-20 Dr. Abdulfatah Salem 111
RHSA2S1X2X1BV
160112S1
40/60011/3X2
101011A2
50M007M - 43M - 3Z
40/60011/3
1
1
1
7M - 4
40/60011/3
40/60011/3
40/60011/3
40/6(7M-4)007M - 41/3(7M – 4)
RHSA2S1X2X1BV
28/30105/3S1
40/60011/3X2
10/31002/3A2
10M/3 + 80/30002M/3-5/3Z
First
iteration
❶
❷
❸
19-Mar-20 Dr. Abdulfatah Salem 112
RHSS1X2X1BV
28/3105/3S1
40/6011/3X2
10/3002/3X1
10M/3 + 80/3002M/3-5/3New Z
RHSS1X2X1BV
28/3105/3S1
40/6011/3X2
5001X1
10M/3 + 80/3002M/3-5/3New Z
*3/2
19-Mar-20 Dr. Abdulfatah Salem 113
RHSS1X2X1BV
28/3105/3S1
40/6011/3X2
5001X1
10M/3 + 80/3002M/3-5/3Z
5/3
1/3
1
2M/3-5/3
5001
25/3005/3
5/3001/3
5001
10M/3 - 25/3002M/3-5/3
RHSS1X2X1BV
1100S1
5010X2
5001X1
35000Z
Second
iteration
❶
❷
❸
19-Mar-20 Dr. Abdulfatah Salem 114
RHSS1X2BV
110S1
501X2
500X1
3500New Z
X1 = 5
X2 = 5
Z = 35
Linear  programming simplex method

Linear programming simplex method

  • 2.
    3/19/2020 Dr. AbdulfatahSalem 2 For linear programming problems involving two variables, the graphical solution method introduced before is convenient. It is better to use solution methods that are adaptable to computers. One such method is called the simplex method, The simplex method is an iterative procedure developed by George Dantzig in 1946. It provides us with a systematic way of examining the vertices of the feasible region to determine the optimal value of the objective function. more than two variables problems involving a large number of constraints However, for problems involving
  • 3.
    3/19/2020 Dr. AbdulfatahSalem 3 Standard Minimization Form • The objective function is to be minimized. • All the RHS involved in the problem are nonnegative. • All other linear constraints may be written so that the expression involving the variables is greater than or equal to a nonnegative constant. Standard Maximization Form • The objective function is to be maximized. • All the RHS involved in the problem are nonnegative. • All other linear constraints may be written so that the expression involving the variables is less than or equal to a nonnegative constant.
  • 4.
    3/19/2020 Dr. AbdulfatahSalem 4 1) Be sure that the model is standard model 2) Be sure that the right hand side is +ve value 3) Convert each inequality in the set of constraints to an equation as follows: • Slack Variable added to a ≤ constraint to convert it to an equation (=). A slack variable represents unused resources A slack variable contributes nothing to the objective function value. • Surplus Variable subtracted from a ≥ constraint to convert it to an equation (=). A surplus variable represents an excess above a constraint requirement level. Surplus variables contribute nothing to the calculated value of the objective function. Simplex Algorithm
  • 5.
    3/19/2020 Dr. AbdulfatahSalem 5 4) Prepare the equations to make the unknowns in the left hand side and the fixed values in the right hand side 5) Create the initial simplex tableau 6) Select the pivot column. ( The column with the “most negative value” element in the last row. ) 7) Select the pivot row. (The row with the smallest non-negative result when the last element in the row is divided by the corresponding in the pivot column) 8) Use elementary row operations to make all numbers in the pivot column equal to 0 except for the pivot number equal to 1. 9) Check the optimality (entries in the bottom row are zero or positive, If so, this the final tableau (optimal solution) , If not, go back to step 6 10) The linear programming problem has been solved and maximum solution obtained, which is given by the entry in the lower-right corner of the tableau. Simplex Algorithm (cont.)
  • 6.
    3/19/2020 Dr. AbdulfatahSalem 6 = + Artificial (A) Constraint type Variable to be added ≥ + slack (s) ≤ - Surplus (s) + artificial (A) Simplex Algorithm (cont.)
  • 7.
    3/19/2020 Dr. AbdulfatahSalem 7 The national co. for assembling computer systems. assembles laptops and printers, Each laptop takes four hours of labor from the hardware department and two hours of labor from the software department. Each printer requires three hours of hardware and one hour of software. During the current week, 240 hours of hardware time are available and 100 hours of software time. Each laptop assembled gives a profit of $70 and each printer a profit of $50. How many printers and laptops should be assembled in order to maximize the profit? Example Solution ConstraintsprinterlaptopResource 24034hardware 10012software 5070Unit profit $ Max Z = 70x1 + 50x2 4x1 + 3x2 ≥ 240 2x1 + x2 ≥ 100 Z - 70x1 - 50x2 = 0 4x1 + 3x2 + s1 = 240 2x1 + x2 + s2 = 100
  • 8.
    3/19/2020 Dr. AbdulfatahSalem 8 4x1 + 3x2 + s1 = 240 2x1 + x2 + s2 = 100 Z - 70x1 - 50x2 = 0 Basic Variable X1 X2 S1 S2 Z Rhs S1 4 3 1 0 0 240 S2 2 1 0 1 0 100 Z -70 -50 0 0 1 0
  • 9.
    3/19/2020 Dr. AbdulfatahSalem 9 Basic Variable X1 X2 S1 S2 Z Rhs S1 4 3 1 0 0 240 S2 2 1 0 1 0 100 Z -70 -50 0 0 1 0 Basic Variable X1 X2 S1 S2 Z Rhs S1 4 3 1 0 0 240 S2 2 1 0 1 0 100 Z -70 -50 0 0 1 0 Ratio 60 50 0 Basic Variable X1 X2 S1 S2 Z Rhs S1 4 3 1 0 0 240 S2 2 1 0 1 0 100 Z -70 -50 0 0 1 0 X1 1 1/2 0 1/2 0 50 /2
  • 10.
    3/19/2020 Dr. AbdulfatahSalem 10 Basic Variable X1 X2 S1 S2 Z Rhs S1 4 3 1 0 0 240 X1 1 1/2 0 1/2 0 50 Z -70 -50 0 0 1 0 4 1 -70 ❶ ❷ 1 1/2 0 1/2 0 50 4 2 0 2 0 200 1 ½ 0 1/2 0 50 -70 -35 0 -35 0 -3500 Basic Variable X1 X2 S1 S2 Z Rhs S1 0 1 1 -2 0 40 X1 1 1/2 0 1/2 0 50 Z 0 -15 0 35 1 3500 ❸ First iteration
  • 11.
    3/19/2020 Dr. AbdulfatahSalem 11 1 1/2 -15 ❶ ❷ Basic Variable X1 X2 S1 S2 Z Rhs X2 0 1 1 -2 0 40 X1 1 1/2 0 1/2 0 50 Z 0 -15 0 35 1 3500 0 1 1 -2 0 40 0 1 1 -2 0 40 0 1/2 1/2 -1 0 20 0 -15 -15 30 0 -600 Basic Variable X1 X2 S1 S2 Z Rhs X2 0 1 1 -2 0 40 X1 1 0 -1/2 3/2 0 30 Z 0 0 15 5 1 4100 ❸ Second iteration
  • 12.
    3/19/2020 Dr. AbdulfatahSalem 12 BV X1 X2 S1 S2 Z Rhs X2 0 1 1 -2 0 40 X1 1 0 -1/2 3/2 0 30 Z 0 0 15 5 1 4100 X1 = 30 No of laptops = 30 X2 = 40 No of printers = 40 Z = 4100 The optimal profit = $4100
  • 13.
    3/19/2020 Dr. AbdulfatahSalem 13 Solve the following problem using the simplex method Max Z = 3X1+ 5X2 S.t. X1  4 2 X2  12 3X1 +2X2  18 X1 , X2  0 Example Solution Basic variables X1 X2 S1 S2 S3 Z RHS S1 1 0 1 0 0 0 4 S2 0 2 0 1 0 0 12 S3 3 2 0 0 1 0 18 Z -3 -5 0 0 0 1 0
  • 14.
    3/19/2020 Dr. AbdulfatahSalem 14 BV X1 X2 S1 S2 S3 Z RHS S1 1 0 1 0 0 0 4 X2 0 1 0 1/2 0 0 6 S3 3 2 0 0 1 0 18 Z -3 -5 0 0 0 1 0 0 1 2 -5 0 1 0 1/2 0 0 6 0 0 0 0 0 0 0 0 1 0 1/2 0 0 6 0 2 0 1 0 0 12 0 -5 0 -5/2 0 0 -30 ❶ ❷ BV X1 X2 S1 S2 S3 Z RHS S1 1 0 1 0 0 0 4 X2 0 1 0 1/2 0 0 6 S3 3 0 0 -1 1 0 6 Z -3 0 0 5/2 0 1 30 ❸ First iteration
  • 15.
    3/19/2020 Dr. AbdulfatahSalem 15 BV X1 X2 S1 S2 S3 Z RHS S1 1 0 1 0 0 0 4 X2 0 1 0 ½ 0 0 6 X1 1 0 0 -1/3 1/3 0 2 Z -3 0 0 5/2 0 1 30 1 0 1 -3 1 0 0 -1/3 1/3 0 2 1 0 0 -1/3 1/3 0 2 0 0 0 0 0 0 0 1 0 0 -1/3 1/3 0 2 -3 0 0 1 -1 0 -6 ❶ ❷ BV X1 X2 S1 S2 S3 Z RHS S1 0 0 1 1/3 -1/3 0 2 X2 0 1 0 1/2 0 0 6 X1 1 0 0 -1/3 1/3 0 2 Z 0 0 0 3/2 1 1 36 ❸ Second iteration
  • 16.
    3/19/2020 Dr. AbdulfatahSalem 16 BV X1 X2 S1 S2 S3 Z RHS S1 0 0 1 1/3 -1/3 0 2 X2 0 1 0 1/2 0 0 6 X1 1 0 0 -1/3 1/3 0 2 Z 0 0 0 3/2 1 1 36 X1 = 2 X2 = 6 Z = 36 ❸
  • 17.
    19-Mar-20 Dr. AbdulfatahSalem 17 Max. Z = 13X1+11X2 ST. 4X1 + 5X2 < 1500 5X1 + 3X2 < 1575 X1 + 2X2 < 420 X1, X2 > 0 Example Solution X1 + 2X2 + S3 = 420 Z = 13X1+11X2 4X1 + 5X2 < 1500 5X1 + 3X2 < 1575 X1 + 2X2 < 420 Z - 13X1 - 11X2 = 0 4X1 + 5X2 + S1 = 1500 5X1 + 3X2 + S2 = 1575
  • 18.
    19-Mar-20 Dr. AbdulfatahSalem 18 RHSS3S2S1X2X1BV 150000154S1 157501035X1 42010021S3 0000-11-13Z RHSS3S2S1X2X1BV 150000154S1 31501/503/51X1 42010021S3 0000-11-13Z RHSS3S2S1X2X1BV 150000154S1 157501035S2 42010021S3 0000-11-13Z /5
  • 19.
    19-Mar-20 Dr. AbdulfatahSalem 19 RHSS3S2S1X2X1BV 150000154S1 31501/503/51X1 42010021S3 0000-11-13Z 31501/503/51 4 1 1 -13 126004/5012/54 31501/503/51 31501/503/51 -40950-13/50-39/5-13 First iteration RHSS3S2S1X2X1BV 2400-4/5113/50S1 31501/503/51X1 1051-1/507/50S3 4095013/50-16/50Z
  • 20.
    19-Mar-20 Dr. AbdulfatahSalem 20 RHSS3S2S1X2X1BV 2400-4/5113/50S1 31501/503/51X1 755/7-1/7010X2 4095013/50-16/50Z RHSS3S2S1X2X1BV 2400-4/5113/50S1 31501/503/51X1 1051-1/507/50S3 4095013/50-16/50Z RHSS3S2S1X2X1BV 2400-4/5113/50S1 31501/503/51X1 1051-1/507/50X2 4095013/50-16/50Z *5/7
  • 21.
    19-Mar-20 Dr. AbdulfatahSalem 21 RHSS3S2S1X2X1BV 2400-4/5113/50S1 31501/503/51X1 755/7-1/7010X2 4095013/50-16/50Z 19513/7-13/35013/50 453/7-3/3503/50 755/7-1/7010 -240-16/3516/350-16/50 RHSS3S2S1X2X1BV 45-13/7-15/35100S1 270-3/710/35001X1 755/7-1/7010X2 433516/3575/35000Z 755/7-1/7010 13/5 3/5 1 -16/5 Second iteration
  • 22.
    19-Mar-20 Dr. AbdulfatahSalem 22 RHSS3S2S1X2X1BV 45-13/7-15/35100S1 270-3/710/35001X1 755/7-1/7010X2 433516/3575/35000Z RHSBV 45S1 270X1 75X2 4335Z 270X1 75X2 4335Z
  • 23.
    3/19/2020 Dr. AbdulfatahSalem 23 Max Z = 2X1 + 4X2 X1 + 4X2 ≥ 12 X1 + 3X2 ≥ 10 Z - 2X1 - 4X2 = 0 X1 + 4X2 + S1 = 12 X1 + 3X2 + S2 = 10 RHSS2S1X2X1BV 120141S1 101031S2 000-4--2Z Example Solution Z -2X1 - 4X2 = 0 X1 + 4X2 ≥ 12 X1 + 3X2 ≥ 10
  • 24.
    3/19/2020 Dr. AbdulfatahSalem 24 RHSS2S1X2X1BV 301/411/4X2 101031S2 000-4--2Z 301/411/4 1 3 -4 301/411/4 903/433/4 -120-1-4-1 ❶ ❷ ❸ First iteration RHSS2S1X2X1BV 301/411/4X2 11-3/401/4S2 12010-1Z
  • 25.
    3/19/2020 Dr. AbdulfatahSalem 25 RHSS2S1X2X1BV 301/411/4X2 44-301X1 12010-1Z 44-301 1/4 1 -1 11-3/401/4 44-301 -4-430-1 ❶ ❷ ❸ Second iteration RHSS2S1X2X1BV 2-1110X2 44-301X1 164-200Z
  • 26.
    3/19/2020 Dr. AbdulfatahSalem 26 RHSS2S1X2X1BV 2-1110S1 44-301X1 164-200Z 1 -3 -2 2-1110 2-1110 -63-3-30 -42-2-20 RHSS2S1X2X1BV 2-1110S1 101031X1 202020Z ❶ ❷ ❸ third iteration
  • 27.
    3/19/2020 Dr. AbdulfatahSalem 27 RHSS2S1X2X1BV 2-1110S1 101031X1 202020Z RHSBV 2S1 10X1 20Z 10X1 0X2 20Z
  • 28.
    19-Mar-20 Dr. AbdulfatahSalem 28 Example : Max 20X1 + 8X2 S.T. 9X1 + 4X2 ≤ 36 2X1 - X2 ≤ 2 X1 + X2 ≤ 8 16X1 ≤ 32 Z -20X1 - 8X2 =0 9X1 + 4X2 + S2 = 36 2X1 - X2 + S1 = 2 X1 + X2 + S3 = 8 16X1 + S4 = 32 Max 20X1 + 8X2 S.T. 9X1 + 4X2 ≤ 36 2X1 - X2 ≤ 2 X1 + X2 ≤ 8 16X1 ≤ 32 Solution :
  • 29.
    19-Mar-20 Dr. AbdulfatahSalem 29 X1 X2 S1 S2 S3 S4 RHS X1 2 -1 1 0 0 0 2 S2 9 4 0 1 0 0 36 S3 1 1 0 0 1 0 8 S4 16 0 0 0 0 1 32 Z -20 -8 0 0 0 0 0 X1 X2 S1 S2 S3 S4 RHS X1 1 -1/2 1/2 0 0 0 1 S2 9 4 0 1 0 0 36 S3 1 1 0 0 1 0 8 S4 16 0 0 0 0 1 32 Z -20 -8 0 0 0 0 0 First iteration ❶
  • 30.
    19-Mar-20 Dr. AbdulfatahSalem 30 1 -1/2 1/2 0 0 0 1 1 9 1 16 -20 1 -1/2 1/2 0 0 0 1 9 -9/2 9/2 0 0 0 9 1 -1/2 ½ 0 0 0 1 16 -8 8 0 0 0 16 -20 10 -10 0 0 0 -20 0 17/2 -9/2 1 0 0 27 0 3/2 -1/2 0 1 0 7 0 8 -8 0 0 1 16 0 -18 10 0 0 0 20 ❷ ❸
  • 31.
    19-Mar-20 Dr. AbdulfatahSalem 31 X1 X2 S1 S2 S3 S4 RHS X1 1 -1/2 1/2 0 0 0 1 S2 0 17/2 -9/2 1 0 0 27 S3 0 3/2 -1/2 0 1 0 7 X2 0 1 -1 0 0 1/8 2 Z 0 -18 10 0 0 0 20 Second iteration 0 1 -1 0 0 1/8 2 -1/2 17/2 3/2 1 -18 0 -1/2 1/2 0 0 -1/16 -1 0 17/2 -17/2 0 0 17/16 17 0 3/2 -3/2 0 0 3/16 3 0 1 -1 0 0 1/8 2 0 -18 18 0 0 -18/8 -36 ❶ ❷
  • 32.
    19-Mar-20 Dr. AbdulfatahSalem 32 1 0 0 0 0 1/16 2 0 0 4 1 1 -17/16 10 0 0 1 0 0 -3/16 4 0 1 -1 0 0 1/8 2 0 0 -8 0 0 18/8 56 X1 X2 S1 S2 S3 S4 RHS X1 1 0 0 0 0 1/16 2 S1 0 0 1 1/4 1/4 -17/64 10/4 S3 0 0 1 0 0 -3/16 4 X2 0 1 -1 0 0 1/8 2 Z 0 0 -8 0 0 18/8 56 Third iteration ❶ ❸
  • 33.
    19-Mar-20 Dr. AbdulfatahSalem 33 0 1 1 -1 -8 0 0 1 1/4 1/4 -17/64 10/4 0 0 O 0 0 0 0 0 0 1 1/4 1/4 -17/64 10/4 0 0 1 1/4 1/4 -17/64 10/4 0 0 -1 -1/4 -1/4 17/64 -10/4 0 0 -8 -2 -2 17/8 -20 1 0 0 0 0 1/16 2 0 0 1 1/4 1/4 -17/64 10/4 0 0 0 -1/4 -2/9 5/64 6/4 0 1 0 ¼ 2/9 -9/64 18/4 0 0 0 2 0 1/8 76 ❷
  • 34.
    19-Mar-20 Dr. AbdulfatahSalem 34 X1 X2 S1 S2 S3 S4 RHS X1 1 0 0 0 0 1/16 2 S1 0 0 1 1/4 1/4 -17/64 10/4 S3 0 0 0 -1/4 -2/9 5/64 6/4 X2 0 1 0 ¼ 2/9 -9/64 18/4 Z 0 0 0 2 0 1/8 76 X1 2 X2 18/4 Z 76 ❸
  • 35.
    19-Mar-20 Dr. AbdulfatahSalem 35 Example : Solution : Min Z = X1 - 3X2 + 3X3 S.T. 3X1 - X2 + 2X3 ≤ 7 2X1 + 4X2 ≥ -12 4X1 - 3X2 - 8X3 ≥ -10 X1, X2, X3 ≥ 0 Min Z = X1 - 3X2 + 3X3 S.T. 3X1 - X2 + 2X3 ≤ 7 -2X1 + -4X2 ≤ 12 -4X1 + 3X2 + 8X3 ≤ 10 X1, X2, X3 ≥ 0
  • 36.
    19-Mar-20 Dr. AbdulfatahSalem 36 RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 1010083-4S3 0000-33-1Z 3X1 - X2 + 2X3 + S1 = 7 -2X1 - 4X2 + S2 = 12 -4X1 + 3X2 + 8X3 + S3 = 10 Z - X1 + 3X2 - 3X3 = 0 /3 RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 1010083-4S3 0000-33-1Z 10/31/3008/31-4/3X2
  • 37.
    19-Mar-20 Dr. AbdulfatahSalem 37 RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 10/31/3008/31-4/3X2 0000-33-1Z 10/31/3008/31-4/3 -1 -4 1 3 -10/3-1/300-8/3-14/3 -40/3-4/30032/3-416/3 10/31/3008/31-4/3 1010083-4 ❶ ❷ RHSS3S2S1X3X2X1BV 31/31/30114/305/3S1 61/34/310-32/30-22/3S2 10/31/3008/31-4/3X2 -10-100-1103Z ❸ First iteration
  • 38.
    19-Mar-20 Dr. AbdulfatahSalem 38 RHSS3S2S1X3X2X1BV 31/51/503/514/501X1 61/34/310-32/30-22/3S2 10/31/3008/31-4/3X2 -10-100-1103Z 31/51/503/514/501 1 -22/3 -4/3 3 31/51/503/514/501 -682/15-22/150-66/15-305/150-22/3 -124/15-4/150-4/5-56/150-4/3 93/53/509/542/503 RHSS3S2S1X3X2X1BV 31/51/503/514/501X1 987/1542/15166/15000S2 58/519/1504/596/1510X2 -143/5-8/50-9/5-97/500Z ❶ ❷ ❸ Second iteration
  • 39.
    19-Mar-20 Dr. AbdulfatahSalem 39 RHSS3S2S1X3X2X1BV 31/51/503/514/501X1 987/1542/15166/15000S2 58/519/1504/596/1510X2 -143/5-8/50-9/5-97/500Z The optimal solution will be : X1 = 31/5 X2 = 58/5 X3 = 0 Z = -143/5
  • 40.
    19-Mar-20 Dr. AbdulfatahSalem 40 Example : Solution : Let P = -Z = -X1 + 3X2 - 3X3 Min Z = Min –P Min Z = - Max P Max P = -X1 + 3X2 - 3X3 S.T 3X1 - X2 + 2X3 ≤ 7, 2X1 + 4X2 ≥ -12, -4X1 + 3X2 + 8X3 ≤ 10 X1, X2, X3 ≥ 0 Min Z = X1 - 3X2 + 3X3 S.T. 3X1 - X2 + 2X3 ≤ 7 2X1 + 4X2 ≥ -12 4X1 - 3X2 - 8X3 ≥ -10 X1, X2, X3 ≥ 0
  • 41.
    19-Mar-20 Dr. AbdulfatahSalem 41 RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 1010083-4S3 00003-31P 3X1 - X2 + 2X3 + S1 = 7 -2X1 - 4X2 + S2 = 12 -4X1 + 3X2 + 8X3 + S3 = 10 P X1 - 3X2 + 3X3 = 0 RHSS3S2S1X3X2X1BV 70012-13S1 0100-4-2S2 1010083-4S3 00003-31P RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 10/31/3008/31-4/3S3 00003-31P /3
  • 42.
    19-Mar-20 Dr. AbdulfatahSalem 42 RHSS3S2S1X3X2X1BV 70012-13S1 120100-4-2S2 10/31/3008/31-4/3X2 00003-31P -1 -4 1 -3 10/31/3008/31-4/3 -10/3-1/300-8/3-14/3 -40/3-4/300-32/3-416/3 10/31/3008/31-4/3 -10-100-8-34 RHSS3S2S1X3X2X1BV 31/31/30114/305/3S1 76/34/31032/30-22/3S2 10/31/3008/31-4/3X2 10100110-3P ❶ ❷ ❸ First iteration
  • 43.
    19-Mar-20 Dr. AbdulfatahSalem 43 RHSS3S2S1X3X2X1BV 31/51/503/514/501X1 76/34/31032/30-22/3S2 10/31/3008/31-4/3X2 10100110-3P 1 -22/3 -4/3 -3 31/51/503/514/501 31/51/503/514/501 -682/15-22/150-66/15-308/150-22/3 -124/15-4/150-4/5-56/150-4/3 -93/5-3/50-9/5-42/50-3 RHSS3S2S1X3X2X1BV 31/51/503/514/501X1 324/542/15166/15468/1500S2 58/59/1504/596/1510X2 143/58/509/597/500P ❶ ❷ ❸ Second iteration
  • 44.
    19-Mar-20 Dr. AbdulfatahSalem 44 The optimal solution will be : X1 = 31/5 X2 = 58/5 X3 = 0 P = 143/5 Z = -P = -143/5 RHSS3S2S1X3X2X1BV 31/51/503/514/501S1 324/542/15166/15468/1500S2 58/59/1504/596/1510X2 143/58/509/597/500P
  • 45.
    3/19/2020 Dr. AbdulfatahSalem 45 The Dual method If standard form The Big-M method If not standard form
  • 46.
    3/19/2020 Dr. AbdulfatahSalem 46 The Dual method  In solving the linear programming problem, it helps to note that each maximization problem is associated with a minimization problem, and vice versa.  The given problem is called the primal problem, and the related problem is called the dual problem.  The solution of maximizing (primal) problem produces the solution of associated minimizing (dual) problem, and vice- versa.
  • 47.
    3/19/2020 Dr. AbdulfatahSalem 47 The Duality Theorem  A primal problem has a solution if and only if the corresponding dual problem has a solution.  Furthermore, if a solution exists, then:  The objective functions of both the primal and the dual problem attain the same optimal value.  When the dual optimal case reached, the optimal solution to the primal problem appears under the slack variables in the last row of the final simplex tableau associated with the dual problem.
  • 48.
    3/19/2020 Dr. AbdulfatahSalem 48 The Dual Problem Primalproblem Dualproblem M variables N variables N constraints M constraints Coefficients of objective function Constants ( RHS) Constants ( RHS) Coefficients of objective function
  • 49.
    3/19/2020 Dr. AbdulfatahSalem 49 transpose Min P = 8y1 + 16y2 St: y1 + 5y2  9 2y1 + 2y2  10 y1  0, y2  0. Max Z = 9x1 + 10 x2 St: x1 + 2x2  8 5x1 + 2x2  16 x1  0 , x2  0
  • 50.
    3/19/2020 Dr. AbdulfatahSalem 50 Min Z = 6X1 + 8X2 St. 40X1 + 10X2 ≥ 2400 10X1 + 15X2 ≥ 2100 5X1 + 15X2 ≥ 1500 X1 X2 Constant 40 10 ≥ 2400 10 15 ≥ 2100 5 15 ≥ 1500 6 8 S1 S2 S3 Constant 40 10 5 ≤ 6 10 15 15 ≤ 8 2400 2100 1500 Example Solution
  • 51.
    3/19/2020 Dr. AbdulfatahSalem 51 The dual problem (Max) associated with this problem: Max Z = 2400S1 + 2100S2 + 1500S3 St. 40S1 + 10S2 + 5S3 ≤ 6 10S1 + 15S2 + 15S3 ≤ 8 S1 S2 S3 Constant 40 10 5 ≤ 6 10 15 15 ≤ 8 2400 2100 1500 Dual
  • 52.
    3/19/2020 Dr. AbdulfatahSalem 52 The max. standard equations will be P - 2400S1 - 2100S2 - 1500S3 = 0 40S1 + 10S2 + 5S3 + X1 = 6 10S1 + 15S2 + 15S3 + X2 = 8 RHSPX2X1S3S2S1 BV 600151040X1 8010151510X2 0100-1500-2100-2400P RHSPX2X1S3S2S1 BV 600151040X1 8010151510X2 0100-1500-2100-2400P 3/20001/401/81/41S1 /40
  • 53.
    3/19/2020 Dr. AbdulfatahSalem 53 RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 8010151510X2 0100-1500-2100-2400P 3/20001/401/81/41 1 10 -2400 RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 3/2001/45/45/210X2 -36000-60-300-600-2400P RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 13/201-1/425/425/20X2 3601060-1200-15000P First iteration ❶ ❷ ❸
  • 54.
    3/19/2020 Dr. AbdulfatahSalem 54 RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 13/201-1/425/425/20X2 3601060-1200-15000P RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 13/2502/25-1/501/210S2 3601060-1200-15000P
  • 55.
    3/19/2020 Dr. AbdulfatahSalem 55 RHSPX2X1S3S2S1BV 3/20001/401/81/41S1 13/2502/25-1/501/210S2 3601060-1200-15000P 13/2502/25-1/501/210 1/4 1 -1500 RHSPX2X1S3S2S1BV 13/10001/50-1/1001/81/40S1 13/2502/25-1/501/210S2 -7800-12030-750-15000P RHSPX2X1S3S2S1BV -8/1000-1/5014/400001S1 13/2502/25-1/501/210S2 1140112030-45000P Second iteration ❶ ❷ ❸
  • 56.
    3/19/2020 Dr. AbdulfatahSalem 56 Write the dual problem (Max) associated with this problem: Min Z = 6X1 + 8X2 St. 40X1 + 10X2 ≥ 2400 10X1 + 15X2 ≥ 2100 5X1 + 15X2 ≥ 1500 Primal X1 = 30 X2 = 120 Z = 1140 RHSPX2X1S3S2S1BV -8/1000-1/5014/400001S1 13/2502/25-1/501/210S2 1140112030-45000P
  • 57.
    3/19/2020 Dr. AbdulfatahSalem 57 Min Z = 150X1 + 80X2 + 50X3 + 8X4 St. 12X1 + 8X2 + 2X3 + X4 ≥ 25 10X1 + 4X2 + 4X3 + 2X4 ≥ 20 X1,X2 ,X3,X4 ≥ 0 S1 S2 Constant 12 10 ≤ 150 8 4 ≤ 80 2 4 ≤ 50 1 2 ≤ 8 25 20 X1 X2 X3 X4 Constant 12 8 2 1 ≥ 25 10 4 4 2 ≥ 20 150 80 50 8 Primal Example Solution
  • 58.
    3/19/2020 Dr. AbdulfatahSalem 58 S1 S2 Constant 12 10 ≤ 150 8 4 ≤ 80 2 4 ≤ 50 1 2 ≤ 8 25 20 Max P = 25S1 + 20S2 St. 12S1 + 10S2 ≥ 150 8S1 + 4S2 ≥ 80 2S1 + 4S2 ≥ 50 S1 + 2S2 ≥ 8 Dual
  • 59.
    3/19/2020 Dr. AbdulfatahSalem 59 Max P = 25S1 + 20S2 St. 12S1 + 10S2 ≥ 150 8S1 + 4S2 ≥ 80 2S1 + 4S2 ≥ 50 S1 + 2S2 ≥ 8 P - 25S1 + 20S2 = 0 12S1 + 10S2 + X1 = 150 8S1 + 4S2 + X2 = 80 2S1 + 4S2 + X3 = 50 S1 + 2S2 + X4 = 8 Dual
  • 60.
    3/19/2020 Dr. AbdulfatahSalem 60 P - 25S1 - 20S2 = 0 12S1 + 10S2 + X1 = 150 8S1 + 4S2 + X2 = 80 2S1 + 4S2 + X3 = 50 S1 + 2S2 + X4 = 8 RHSX4X3X2X1S1S1 15000011012X1 80001048X2 50010042X3 8100021X4 00000-20-25P
  • 61.
    3/19/2020 Dr. AbdulfatahSalem 61 RHSX4X3X2X1S1S1 15000011012X1 80001048X2 50010042X3 8100021X4 00000-20-25P RHSX4X3X2X1S1S1 96120002412X1 648000168X2 16200042X3 8100021S1 -200-25000-50-25P 8100021 12 8 2 1 -25 First iteration ❶ ❷ ❸
  • 62.
    3/19/2020 Dr. AbdulfatahSalem 62 RHSX4X3X2X1 S1S1 54-12001-140X1 16-8010120X2 34-210000X3 8100021S1 20025000300P ❸
  • 63.
    3/19/2020 Dr. AbdulfatahSalem 63 RHSX4X3X2X1S1S1 54-12001-140X1 16-8010120X2 34-210000X3 8100021S1 20025000300P Min Z = 150X1 + 80X2 +50X3+ 8X4 St. 12X1 + 8X2 + 2X3 + X4 ≥ 25 10X1 + 4X2 + 4X3 + 2X4 ≥ 20 Z=200 X1 =0 X2 =0 X3 =0 X4 =25 Primal
  • 64.
    19-Mar-20 Dr. AbdulfatahSalem 64 Max P= 5X1 + 12X2 + 4X3 S.T. X1 +2X2+X3 ≤ 10 2X1 - X2 + 3X3 ≤ 8 X1 , X2 , X3 ≥ 0 Min Z= 10Y1 + 8Y2 S.T. Y1 +2Y2  5 2Y1 - Y2  12 Y1 + 3Y2  4 Y1 , Y2 ≥ 0 Example : Solution :
  • 65.
    19-Mar-20 Dr. AbdulfatahSalem 65 RHSY2Y1X3X2X1BV 1001121Y1 8103-12Y2 000-4-12-5P Max P= 5X1 + 12X2 + 4X3 S.T. X1 +2X2+X3 ≤ 10 2X1 - X2 + 3X3 ≤ 8 X1 , X2 , X3 ≥ 0 P - 5X1 - 12X2 - 4X3 = 0 X1 + 2X2 + X3 + Y1 = 10 2X1 - X2 + 3X3 + Y2 = 8 X2 2 -1 -12 1001121X2 501/21/221/2X2
  • 66.
    19-Mar-20 Dr. AbdulfatahSalem 66 1001121 1 -1 -12 501/21/211/2 501/21/211/2 -50-1/2-1/2-1-1/2 -600-6-6-12-6 501/21/211/2 1311/27/205/2 6006201 RHSY2Y1X3X2X1BV 501/21/211/2Y1 8103-12Y2 000-4-12-5P ❶ ❷ ❸
  • 67.
    19-Mar-20 Dr. AbdulfatahSalem 67 RHSY2Y1X3X2X1BV 501/21/211/2X2 1311/27/205/2Y2 6006201P Min Z = 10Y1 + 8Y2 S.T. Y1 + 2Y2  5 2Y1 - Y2  12 Y1 + 3Y2  4 Y1 , Y2 ≥ 0 Y1 = 6 Y2 = 0 P = 60
  • 68.
    Y1 Y2 Y3X1 X2 RHS X1 2 1 3 1 0 8 Y2 1/2 1 1/2 0 1/2 7/2 Z -6 -12 0 0 0 0 1/2 1 1/2 0 1/2 7/2 1 1 -12 1/2 1 1/2 0 1/2 7/2 1/2 1 1/2 0 1/2 7/2 -6 -12 -6 0 -6 -42 3/2 0 5/2 1 -1/2 9/2 1/2 1 1/2 0 1/2 7/2 0 0 6 0 6 42 Y1 Y2 Y3 X1 X2 RHS X1 3/2 0 5/2 1 -1/2 9/2 Y2 1/2 1 1/2 0 1/2 7/2 Z 0 0 6 0 6 42 X1 X2 0 6 First iteration
  • 69.
    19-Mar-20 Dr. AbdulfatahSalem 69 Solving the non standard LP model The Method Suppose that you add n artificial variables A1 , A2 , …. , An to the LP model Build the initial tableau representing the LP model with rows representing the constraints’ equations and last row representing the modified objective function Ž where : Model modification Add M[A1 + A2 + …. + An]to the objective function Eqn. if the model is Min. Subtract M[A1 + A2 + …. + An] from the objective function Eqn. if the model is Max. Ž row = Z row + M[A1row + A2row + …. + Anrow] if the model is Min. Ž row = Z row - M[A1row + A2row + …. + Anrow] if the model is Max.
  • 70.
    19-Mar-20 Dr. AbdulfatahSalem 70 Solve the following linear programming problem by using the simplex method: Min Z = 12 X1 + 20 X2 S.t. 6X1 + 8X2  100 7X1 + 12X2  120 X1, X2  0 The Method Artificial Variable Technique Example :
  • 71.
    19-Mar-20 Dr. AbdulfatahSalem 71 6X1 + 8X2 - S1 + A1 = 100 7X1 + 12X2 - S2 + A2 = 120 Z - 12 X1 - 20 X2 -M(A1 + A2) = 0 Solution: RHSA2A1X2X1Basic Variable 1000186A1 12010127A2 0-M-M-20-12Z
  • 72.
    19-Mar-20 Dr. AbdulfatahSalem 72 RHSA2A1X2X1Basic Variable 1000186A1 12010127A2 0-M-M-20-12Z 100M0M8M6MA1 120MM012M7MA2 220MMM20M13MA1 + A2 220M00-20 +20M-12+13MNew Z = old Z + A1 + A2 RHSA2A1X2X1Basic Variable 1000186A1 12010127A2 220M00-20 +20M-12+13MZ
  • 73.
    19-Mar-20 Dr. AbdulfatahSalem 73 RHSA2A1X2X1Basic Variable 1000186A1 12010127X2 220M00-20 +20M-12 +13MZ RHSA2A1X2X1Basic Variable 1000186A1 101/12017/12X2 220M00-20 +20M-12 +13MZ /12
  • 74.
    19-Mar-20 Dr. AbdulfatahSalem 74 RHSA1X2X1Basic Variable 100186A1 10017/12X2 220M020(M-1)-12 +13MZ 10017/12 8 1 20(M-1) 800856/12 10017/12 200(M-1)020(M-1)35/3(M-1) RHSA1X2X1Basic Variable 20104/3A1 10017/12X2 20M+200001/3(4M-1)Z ❶ ❷ ❸ First iteration
  • 75.
    19-Mar-20 Dr. AbdulfatahSalem 75 RHSA1X2X1Basic Variable 20104/3A1 10017/12X2 20M+200001/3(4M-1)Z RHSX2X1Basic Variable 1501X1 1017/12X2 20M+20001/3(4M-1)Z *3/4
  • 76.
    19-Mar-20 Dr. AbdulfatahSalem 76 RHSX2X1Basic Variable 1501X1 1017/12X2 20M+20001/3(4M-1)Z 1501 1 7/12 1/3(4M-1) 1501 35/407/12 5(4M-1)01/3(4M-1) RHSX2X1Basic Variable 1501X1 5/410X2 20500Z ❶ ❷ ❸ Second iteration
  • 77.
    19-Mar-20 Dr. AbdulfatahSalem 77 RHSX2X1Basic Variable 1501X1 5/410X2 20500Z This solution is optimal, since there is no positive value in the last row. The optimal solution is: X1 = 15, X2 = 5/4 Z = 205
  • 78.
    19-Mar-20 Dr. AbdulfatahSalem 78 MAX Z = 3X1 – X2 S.T. 2X1 + X2 ≤ 2, X1 + 3X2 ≥ 3, X1 ≤ 4 X1, X2 , ≥ 0 Example : S.T. 2X1 + X2 + S1 = 2 X1 + 3X2 – S2 + A1 = 3 X1 + S3 = 4 MAX Z = 3X1 – X2 - MA1 Solution :
  • 79.
    19-Mar-20 Dr. AbdulfatahSalem 79 S.T. 2X1 + X2 + S1 = 2 X1 + 3X2 – S2 + A1 = 3 X1 + S3 = 4 MAX Z - 3X1 + X2 + MA1 = 0 RHSA1S3S1X2X1BV 200112S1 310031A1 401001S3 0+M001-3Z
  • 80.
    19-Mar-20 Dr. AbdulfatahSalem 80 RHSA1S3S1X2X1BV 200112S1 310031A1 401001S3 -3M0001-3M-3-MZ RHSA1S3S1X2X1BV 200112S1 11/30011/3A1 401001S3 -3M0001-3M-3-MZ /3
  • 81.
    19-Mar-20 Dr. AbdulfatahSalem 81 RHSS3S1X2X1BV 20112S1 10011/3X2 41001S3 -3M001-3M-3-MZ 10011/3 1 1 0 1-3M 10011/3 10011/3 00000 1-3M001-3M1/3-M RHSS3S1X2X1BV 10105/3S1 10011/3X2 41001S3 -1000-10/3Z ❶ ❷ ❸ First iteration
  • 82.
    19-Mar-20 Dr. AbdulfatahSalem 82 RHSS3S1X2X1BV 10105/3S1 10011/3X2 41001S3 -1000-10/3Z RHSS3X2X1BV 3/5001X1 1011/3X2 4101S3 -100-10/3Z *3/5
  • 83.
    19-Mar-20 Dr. AbdulfatahSalem 83 RHSS3X2X1BV 3/5001X1 1011/3X2 4101S3 -100-10/3Z 3/5001 1 1/3 1 -10/3 3/5001 1/5001/3 3/5001 -200-10/3 RHSS3X2X1BV 3/5001X1 4/5010X2 17/5100S3 1000Z ❶ ❷ ❸ Second iteration
  • 84.
    RHSS3X2X1BV 3/5001X1 4/5010X2 17/5100S3 1000Z 19-Mar-20 Dr. AbdulfatahSalem 84 The optimal solution is X1 = 3/5 X2 = 4/5 Z = 3 X1 – X2 = 1
  • 85.
    19-Mar-20 Dr. AbdulfatahSalem 85 Min Z = 2 X1 + 3 X2 S.t. ½ X1 + ¼ X2 ≤ 4 X1 + 3X2  20 X1 + X2 = 10 X1, X2  0 Example : ½ X1 + ¼ X2 + S1 = 4 X1 + 3X2 - S2 + A1 = 20 X1 + X2 + A2 = 10 Z – 2 X1 – 3 X2 - MA1 - MA2 = 0 Solution:
  • 86.
    19-Mar-20 Dr. AbdulfatahSalem 86 Basic variables X1 X2 S1 S2 A1 A2 RHS S1 1/2 1/4 1 0 0 0 4 A1 1 3 0 -1 1 0 20 A2 1 1 0 0 0 1 10 Z -2 -3 0 0 -M -M 0
  • 87.
    19-Mar-20 Dr. AbdulfatahSalem 87 Basic variables X1 X2 S1 S2 A1 A2 RHS S1 1/2 1/4 1 0 0 0 4 A1 1 3 0 -1 1 0 20 A2 1 1 0 0 0 1 10 Z -2 +2M -3 + 4M 0 -M 0 0 30M Basic variables X1 X2 S1 A2 RHS S1 1/2 1/4 1 0 4 X2 1/3 1 0 0 20/3 A2 1 1 0 1 10 Z -2 +2M -3 + 4M 0 0 30M /3
  • 88.
    19-Mar-20 Dr. AbdulfatahSalem 88 Basic variables X1 X2 S1 A2 RHS S1 1/2 1/4 1 0 4 X2 1/3 1 0 0 20/3 A2 1 1 0 1 10 Z -2 +2M -3 + 4M 0 0 30M 1/3 1 0 0 20/3 1/4 1 1 -3 + 4M 1/12 1/4 0 0 5/3 1/3 1 0 0 20/3 1/3 1 0 0 20/3 4/3M-1 4M-3 0 0 80/3M-20 Basic variables X1 X2 S1 A2 RHS S1 5/12 0 1 0 7/3 X2 1/3 1 0 0 20/3 A2 2/3 0 0 1 10/3 Z 2/3M-1 0 0 0 10/3M+20 ❶ ❷ ❸ First iteration
  • 89.
    19-Mar-20 Dr. AbdulfatahSalem 89 Basic variables X1 X2 S1 A2 RHS S1 5/12 0 1 0 7/3 X2 1/3 1 0 0 20/3 A2 2/3 0 0 1 10/3 Z 2/3M-1 0 0 0 10/3M+20 Basic variables X1 X2 S1 RHS S1 5/12 0 1 7/3 X2 1/3 1 0 20/3 X1 1 0 0 5 Z 2/3M-1 0 0 10/3M+20 *3/2
  • 90.
    19-Mar-20 Dr. AbdulfatahSalem 90 Basic variables X1 X2 S1 RHS S1 5/12 0 1 7/3 X2 1/3 1 0 20/3 X1 1 0 0 5 Z 2/3M-1 0 0 10/3M+20 1 0 0 5 5/12 1/3 1 2/3M-1 5/12 0 0 25/12 1/3 0 0 5/3 1 0 0 5 2/3M-1 0 0 10/3M-5 Basic variables X1 X2 S1 RHS S1 0 0 1 1/4 X2 0 1 0 5 X1 1 0 0 5 Z 0 0 0 25 ❶ ❷ ❸ Second iteration
  • 91.
    19-Mar-20 Dr. AbdulfatahSalem 91 X1 = 5 X2 = 5 Z = 25 Basic variables X1 X2 S1 RHS S1 0 0 1 1/4 X2 0 1 0 5 X1 1 0 0 5 Z 0 0 0 25
  • 92.
    19-Mar-20 Dr. AbdulfatahSalem 92 Min Z = 600X1 + 500X2 ST. 2X1 + X2 ≥ 80 X1 +2X2 ≥ 60 X1, X2 ≥ 0 2X1 + X2 - S1 + A1 = 80 X1 + 2X2 - S2 + A2 = 60 Z - 600X1 - 500X2 - M A1 - M A2 = 0 Example : Solution: Basic variables X1 X2 A1 A2 RHS A1 2 1 1 0 80 A2 1 2 0 1 60 Z -600 -500 -M -M 0
  • 93.
    19-Mar-20 Dr. AbdulfatahSalem 93 Basic variables X1 X2 A1 RHS A1 2 1 1 80 X2 1 2 0 60 Z -600+3M -500+3M 0 140M Basic variables X1 X2 A1 RHS A1 2 1 1 80 X2 1/2 1 0 30 Z -600+3M -500+3M 0 140M
  • 94.
    19-Mar-20 Dr. AbdulfatahSalem 94 Basic variables X1 X2 A1 RHS A1 2 1 1 80 X2 1/2 1 0 30 Z -600+3M -500+3M 0 140M 1/2 1 0 30 1 1 -500+3M 1/2 1 0 30 1/2 1 0 30 3/2M-250 -500+3M 0 90M-15000 Basic variables X1 X2 A1 RHS A1 3/2 0 1 50 X2 1/2 1 0 30 Z 3/2M-350 0 0 50M+15000 ❶ ❷ ❸ First iteration
  • 95.
    19-Mar-20 Dr. AbdulfatahSalem 95 Basic variables X1 X2 A1 RHS A1 3/2 0 1 50 X2 1/2 1 0 30 New Z 3/2M-350 0 0 50M+15000 Basic variables X1 X2 RHS X1 1 0 100/3 X2 1/2 1 30 New Z 3/2M-350 0 50M+15000 *2/3
  • 96.
    19-Mar-20 Dr. AbdulfatahSalem 96 Basic variables X1 X2 RHS X1 1 0 100/3 X2 1/2 1 30 New Z 3/2M-350 0 50M+15000 1 1/2 3/2M-350 1 0 100/3 1 0 100/3 1/2 0 50/3 3/2M-350 0 50M-35000/3 Basic variables X1 X2 RHS X1 1 0 100/3 X2 0 1 40/3 New Z 0 0 80000/3 ❶ ❷ ❸ Second iteration
  • 97.
    19-Mar-20 Dr. AbdulfatahSalem 97 X1 = 100/3 X2 = 40/3 Z = 80000/3 Basic variables X1 X2 RHS X1 1 0 100/3 X2 0 1 40/3 New Z 0 0 80000/3
  • 98.
    19-Mar-20 Dr. AbdulfatahSalem 98 Min Z = 4X1 +X2 S.T: 3X1 +X2 = 3 4X1 +3X2 ≥ 6 X1 +2X2 ≤ 3 X1, X2 ≥ 0. Min Z = 4X1 +X2 + M(A1 + A2) S.T: 3X1 +X2 + A1= 3 4X1 +3X2 - S1 + A2 = 6 X1 +2X2 + S2 = 3 Example :
  • 99.
    19-Mar-20 Dr. AbdulfatahSalem 99 Z - 4X1 - X2 - M(A1 + A2) = 0 3X1 +X2 + A1= 3 4X1 +3X2 - S1 + A2 = 6 X1 +2X2 + S2 = 3 B.V. X1 X2 S1 S2 A1 A2 RHS A1 3 1 0 0 1 0 3 A2 4 3 -1 0 0 1 6 S2 1 2 0 1 0 0 3 Z -4 -1 0 0 -M -M 0
  • 100.
    19-Mar-20 Dr. AbdulfatahSalem 100 B.V. X1 X2 S1 S2 A1 A2 RHS A1 3 1 0 0 1 0 3 A2 4 3 -1 0 0 1 6 S2 1 2 0 1 0 0 3 Z -4 -1 0 0 -M -M 0 B.V. X1 X2 S2 A1 A2 RHS A1 3 1 0 1 0 3 A2 4 3 0 0 1 6 S2 1 2 1 0 0 3 New Z -4+7M -1+4M 0 0 0 9M
  • 101.
    19-Mar-20 Dr. AbdulfatahSalem 101 B.V. X1 X2 S2 A1 A2 RHS A1 3 1 0 1 0 3 A2 4 3 0 0 1 6 S2 1 2 1 0 0 3 Z -4+7M -1+4M 0 0 0 9M B.V. X1 X2 S2 A1 A2 RHS A1 1 1/3 0 1/3 0 1 A2 4 3 0 0 1 6 S2 1 2 1 0 0 3 Z -4+7M -1+4M 0 0 0 9M
  • 102.
    19-Mar-20 Dr. AbdulfatahSalem 102 B.V. X1 X2 S2 A2 RHS X1 1 1/3 0 0 1 A2 4 3 0 1 6 S2 1 2 1 0 3 Z -4+7M -1+4M 0 0 9M 1 1/3 0 0 1 1 4 1 -4+7M 1 1/3 0 0 1 4 4/3 0 0 4 1 1/3 0 0 1 -4+7M -4+7M/3 0 0 -4+7M ❶ ❷ ❸ B.V. X1 X2 S2 A2 RHS X1 1 1/3 0 0 1 A2 0 5/3 0 1 2 S2 0 5/3 1 0 2 Z 0 1+5M/3 0 0 4+2M First iteration
  • 103.
    19-Mar-20 Dr. AbdulfatahSalem 103 B.V. X1 X2 S2 A2 RHS X1 1 1/3 0 0 1 A2 0 5/3 0 1 2 S2 0 5/3 1 0 2 Z 0 1+5M/3 0 0 4+2M B.V. X1 X2 S2 RHS X1 1 1/3 0 1 X2 0 1 0 6/5 S2 0 5/3 1 2 Z 0 1+5M/3 0 4+2M
  • 104.
    19-Mar-20 Dr. AbdulfatahSalem 104 B.V. X1 X2 S2 RHS X1 1 1/3 0 1 X2 0 1 0 6/5 S2 0 5/3 1 2 Z 0 1+5M/3 0 4+2M 1/3 1 5/3 1+5M/3 0 1 0 6/5 0 1/3 0 2/5 0 1 0 6/5 0 5/3 0 2 0 1+5M/3 0 2/5 + 2M B.V. X1 X2 S2 RHS X1 1 0 0 3/5 X2 0 1 0 6/5 S2 0 0 1 0 Z 0 0 0 18/5 ❶ ❷ ❸ Second iteration
  • 105.
    19-Mar-20 Dr. AbdulfatahSalem 105 B.V. X1 X2 S2 RHS X1 1 0 0 3/5 X2 0 1 0 6/5 S2 0 0 1 0 Z 0 0 0 18/5 X1 3/5 X2 6/5 Z 18/5
  • 106.
    19-Mar-20 Dr. AbdulfatahSalem 106 B.V. X1 X2 S2 A2 RHS X1 1 1/3 0 0 1 A2 0 5/3 0 1 2 S2 0 5/3 1 0 2 New Z 0 1+5M/3 0 0 4+2M B.V. X1 X2 A2 RHS X1 1 1/3 0 1 A2 0 5/3 1 2 X2 0 1 0 6/5 New Z 0 1+5M/3 0 4+2M Other Solution
  • 107.
    19-Mar-20 Dr. AbdulfatahSalem 107 B.V. X1 X2 A2 RHS X1 1 1/3 0 1 A2 0 5/3 1 2 X2 0 1 0 6/5 New Z 0 1+5M/3 0 4+2M 0 1 0 6/5 1/3 5/3 1 1+5M/3 0 1/3 0 2/5 0 5/3 0 2 0 1 0 6/5 0 1+5M/3 0 2/5 + 2M B.V. X1 X2 A2 RHS X1 1 0 0 3/5 A2 0 0 1 0 X2 0 1 0 6/5 New Z 0 0 0 18/5 ❶ ❷ ❸ Second iteration
  • 108.
    19-Mar-20 Dr. AbdulfatahSalem 108 B.V. X1 X2 A2 RHS X1 1 0 0 3/5 A2 0 0 1 0 X2 0 1 0 6/5 Z 0 0 0 18/5 X1 3/5 X2 6/5 Z 18/5
  • 109.
    19-Mar-20 Dr. AbdulfatahSalem 109 Min Z = 3X1 + 4X2 ST. 2X1 + X2 ≤ 16 2X1 + 6X2  40 X1 + X2 = 10 X1, X2  0 Z - 3X1 - 4X2 - MA1 - MA2 = 0 2X1 + X2 + S1 = 16 2X1 + 6X2 - S2 + A1 = 40 X1 + X2 + A2 = 10 RHSA2A1S1X2X1BV 1600112S1 4001062A1 1010011A2 0-M-M0-4-3Z Example :
  • 110.
    19-Mar-20 Dr. AbdulfatahSalem 110 RHSA2S1X2X1BV 160112S1 400062X2 101011A2 50M007M - 43M - 3New Z RHSA2S1X2X1BV 160112S1 40/60011/3X2 101011A2 50M007M - 43M - 3New Z /6
  • 111.
    19-Mar-20 Dr. AbdulfatahSalem 111 RHSA2S1X2X1BV 160112S1 40/60011/3X2 101011A2 50M007M - 43M - 3Z 40/60011/3 1 1 1 7M - 4 40/60011/3 40/60011/3 40/60011/3 40/6(7M-4)007M - 41/3(7M – 4) RHSA2S1X2X1BV 28/30105/3S1 40/60011/3X2 10/31002/3A2 10M/3 + 80/30002M/3-5/3Z First iteration ❶ ❷ ❸
  • 112.
    19-Mar-20 Dr. AbdulfatahSalem 112 RHSS1X2X1BV 28/3105/3S1 40/6011/3X2 10/3002/3X1 10M/3 + 80/3002M/3-5/3New Z RHSS1X2X1BV 28/3105/3S1 40/6011/3X2 5001X1 10M/3 + 80/3002M/3-5/3New Z *3/2
  • 113.
    19-Mar-20 Dr. AbdulfatahSalem 113 RHSS1X2X1BV 28/3105/3S1 40/6011/3X2 5001X1 10M/3 + 80/3002M/3-5/3Z 5/3 1/3 1 2M/3-5/3 5001 25/3005/3 5/3001/3 5001 10M/3 - 25/3002M/3-5/3 RHSS1X2X1BV 1100S1 5010X2 5001X1 35000Z Second iteration ❶ ❷ ❸
  • 114.
    19-Mar-20 Dr. AbdulfatahSalem 114 RHSS1X2BV 110S1 501X2 500X1 3500New Z X1 = 5 X2 = 5 Z = 35