Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 42

Introduction to the Big M Method

In this section, we will present a generalized version of the


simplex method that will solve both maximization and
minimization problems with any combination of ≤, ≥, =
constraints

1
Example

Maximize
P = 2x1 + x2
subject to
x1 + x2 < 10
–x1 + x2 > 2
x 1, x 2 > 0
To form an equation out of the first inequality, we introduce
a slack variable s1, as before, and write
x1 + x2 + s1 = 10.
2
Example
(continued)

To form an equation out of the second inequality we


introduce a second variable s2 and subtract it from the left
side so that we can write
–x1 + x2 – s2 = 2.
The variable s2 is called a surplus variable, because it is the
amount (surplus) by which the left side of the inequality
exceeds the right side.

3
Example
(continued)
We now express the linear programming problem as a system of
equations:
x1 + x2 + s1 = 10
–x1 + x2 – s2 =2
–2x1 – x2 +P=0
x1, x2, s1, s2 > 0

4
Example
(continued)
It can be shown that a basic solution of a system is not feasible if
any of the variables (excluding P) are negative. Thus a surplus
variable is required to satisfy the nonnegative constraint.
An initial basic solution is found by setting the nonbasic variables
x1 and x2 equal to 0. That is, x1 = 0, x2,= 0,, s1= 10, s2 = -2, P = 0.
This solution is not feasible because the surplus variable s2 is
negative.

5
Artificial Variables

In order to use the simplex method on problems with mixed


constraints, we turn to a device called an artificial variable.
This variable has no physical meaning in the original problem
and is introduced solely for the purpose of obtaining a basic
feasible solution so that we can apply the simplex method.
An artificial variable is a variable introduced into each
equation that has a surplus variable. To ensure that we
consider only basic feasible solutions, an artificial variable is
required to satisfy the nonnegative constraint.

6
Example
(continued)

Returning to our example, we introduce an artificial variable a1 into


the equation involving the surplus variable s2:

x1 + x2 – s2 + a1 = 2
To prevent an artificial variable from becoming part of an optimal
solution to the original problem, a very large “penalty” is
introduced into the objective function. This penalty is created by
choosing a positive constant M so large that the artificial variable is
forced to be 0 in any final optimal solution of the original problem.

7
Example
(continued)
We then add the term –Ma1 to the objective function:
P = 2x1 + x2 – Ma1
We now have a new problem, called the modified problem:
Maximize
P = 2x1 + x2 - Ma1
subject to
x1 + x2 + s1 = 10
x1 + x2 – s2 + a1 = 2
x1, x2, s1, s2, a1 > 0

8
Big M Method:
Form the Modified Problem

 If any problem constraints have negative constants on the right


side, multiply both sides by -1 to obtain a constraint with a
nonnegative constant. Remember to reverse the direction of
the inequality if the constraint is an inequality.
 Introduce a slack variable for each constraint of the form ≤.
 Introduce a surplus variable and an artificial variable in
each ≥ constraint.
 Introduce an artificial variable in each = constraint.
 For each artificial variable a, add –Ma to the objective
function. Use the same constant M for all artificial variables.

9
Key Steps for Solving a Problem
Using the Big M Method

Now that we have learned the steps for finding the modified
problem for a linear programming problem, we will turn our
attention to the procedure for actually solving such problems.
The procedure is called the Big M Method.

10
Example
(continued)
The initial system for the modified problem is
x 1 + x 2 + s1 = 10
–x1 + x2 – s2 + a1 = 2
–2x1 – x2 + Ma1 + P = 0
x1, x2, s1, s2, a1 > 0
We next write the augmented coefficient matrix for this system,
which we call the preliminary simplex tableau for the modified
problem.

11
Example
(continued)

x1 x2 s1 s2 a1 P

1 1 1 0 0 0 10 
 
 1 1 0 1 1 0 2
 2 1 0 0 M 1 0 

To start the simplex process we require an initial simplex
tableau, described on the next slide. The preliminary simplex
tableau should either meet these requirements, or it needs to be
transformed into one that does.

12
Definition:
Initial Simplex Tableau

For a system tableau to be considered an initial simplex


tableau, it must satisfy the following two requirements:
1. The requisite number of basic variables must be selectable.
Each basic variable must correspond to a column in the
tableau with exactly one nonzero element. Different basic
variables must have the nonzero entries in different rows.
The remaining variables are then selected as non-basic
variables.
2. The basic solution found by setting the non-basic variables
equal to zero is feasible.

13
Example
(continued)

The preliminary simplex tableau from our example


satisfies the first requirement, since s1, s2, and P can be
selected as basic variables according to the criterion
stated.
However, it does not satisfy the second requirement since
the basic solution is not feasible (s2 = -2.)
To use the simplex method, we must first use row
operations to transform the tableau into an equivalent
matrix that satisfies all initial simplex tableau
requirements. This transformation is not a pivot
operation.
14
Example
(continued)
x1 x2 s1 s2 a1 P

1 1 1 0 0 0 10 
 
 1 1 0 1 1 0 2
 2 1 0 0 M 1 0 

If you inspect the preliminary tableau, you realize that the


problem is that s2 has a negative coefficient in its column.
We need to replace s2 as a basic variable by something
else with a positive coefficient. We choose a1.

15
Example
(continued)

We want to use a1 as a basic variable instead of s2. We proceed


to eliminate M from the a1 column using row operations:
x1 x2 s1 s2 a1 P
1 1 1 0 0 0 10 
 
(-M)R2 + R3 ->R3  1 1 0 1 1 0 2
 2 1 0 0 M 1 0 

 1 1 1 0 0 0 10 
 
 1 1 0 1 1 0 2 
 M  2  M  1 0 M 0 1 2M 
 

16
Example
(continued)

From the last matrix we see that the basic variables are s1, a1,
and P because those are the columns that meet the
requirements for basic variables.
The basic solution found by setting the nonbasic variables
x1, x2, and s2 equal to 0 is
x1 = 0, x2 = 0, s1 = 10, s2 = 0, a1 =2, P = –2M.
The basic solution is feasible (P can be negative) and all
requirements are met.

17
Example
(continued)

We now continue with the usual simplex process, using pivot


operations. When selecting the pivot columns, keep in mind that
M is unspecified, but we know it is a very large positive number.

 1 1 1 0 0 0 10 
 
 1 1 0 1 1 0 2 
 M  2  M  1 0 M 0 1 2 M 
 

In this example, M – 2 and M are positive, and –M – 1 is


negative. The first pivot column is column 2.

18
Example
(continued)
If we pivot on the second row, second column, and then on the
first row, first column, we obtain:
x1 x2 s1 s2 a1 P
 1 1 1 
x1 1 0 0 4
 2 2 2 
0 1 1 1 1
x2
 0 6 
2 2 2
 
0 0 3 1 1
M 1 14 
P  2 2 2 
Since all the indicators in the last row are nonnegative, we have
the optimal solution:
Max P = 14 at x1 = 4, x2 = 6, s1 = 0, s2 = 0, a1 = 0.
19
Big M Method:
Summary

To summarize:
1. Form the preliminary simplex tableau for the modified
problem.
2. Use row operations to eliminate the Ms in the bottom
row of the preliminary simplex tableau in the columns
corresponding to the artificial variables. The resulting
tableau is the initial simplex tableau.
3. Solve the modified problem by applying the simplex
method to the initial simplex tableau found in the second
step.

20
Big M Method: Summary
(continued)

4. Relate the optimal solution of the modified problem to the


original problem.
A) if the modified problem has no optimal solution, the
original problem has no optimal solution.
B) if all artificial variables are 0 in the optimal solution
to the modified problem, delete the artificial variables
to find an optimal solution to the original problem
C) if any artificial variables are nonzero in the optimal
solution, the original problem has no optimal solution.

21
 Maximize z = x1 + 5x2
 subject to
 3x1 +4x2 ≤6
x1 + 3x2 ≥ 2
 x1, x2 ≥ 0
 Maximize z = -4x1 - 2x2
 subject to
 3x1 +x2 ≥27
x1 +x2 ≥21
x1 + 2x2 ≥ 30
 x1, x2 ≥ 0

22
Notes on the Simplex tableau
1. In any Simplex tableau, the intersection of any basic variable with itself is always one
and the rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of the
nonbasic variables. This means that under any basic variable (in any tableau) there is a
zero in the Z row. For the non basic there is no condition ( it can take any value in this
row).
3. If there is a zero under one or more nonbasic variables in the last tableau (optimal solution
tableau), then there is a multiple optimal solution.
4. When determining the leaving variable of any tableau, if there is no positive ratio (all the
entries in the pivot column are negative and zeroes), then the solution is unbounded.
5. If there is a tie (more than one variables have the same most negative or positive) in
determining the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the leaving
variable. In this case a zero will appear in RHS column; therefore, a “cycle” will occur,
this means that the value of the objective function will be the same for several iterations.
7. A Solution that has a basic variable with zero value is called a “degenerate solution”.
8. If there is no Artificial variables in the problem, there is no room for “infeasible solution”

23
Simplex method incase of
Artificial variables
“Big M method”
 Solve the following linear programming problem by using
the simplex method:
 Min Z =2 X1 + 3 X2
S.t.
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0

24
Big M method

 Solution
Step 1: standard form
Min Z,
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X2 + S1 =4
X1 + 3X2 - S 2 + A1 = 20
X1 + X2 + A2 = 10
X1, X2 ,S1, S2, A1, A2  0
Where: M is a very large number

25
Big M method

 Notes
M, a very large number, is used to ensure that the values of A1 and A2, …, and An will be zero in
the final (optimal) tableau as follows:
1. If the objective function is Minimization, then A1, A2, …, and An must be added to the RHS of
the objective function multiplied by a very large number (M).
Example: if the objective function is Min Z = X1+2X2, then the obj. function should be Min Z =
X1 + X2+ MA1 + MA2+ …+ MAn
OR
Z – X1 - X2- MA1 - MA2- …- MAn = 0

2. If the objective function is Maximization, then A1, A2, …, and An must be subtracted from the
RHS of the objective function multiplied by a very large number (M).
Example: if the objective function is Max Z = X1+2X2, then the obj. function should be Max Z =
X1 + X2- MA1 - MA2- …- MAn
OR
Z - X1 - X2+ MA1 + MA2+ …+ MAn = 0

N.B.: When the Z is transformed to a zero equation, the signs are changed

26
Big
 Step 2: Initial tableau M method

Basic X1 X2 S1 S2 A1 A2 RHS
variable
2 3 0 0 M M
s
S1 ½ ¼ 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
Note that one of the simplex rules is violated, which is the
basic variables A1, and A2 have a non zero value in the z
row; therefore, this violation must be corrected before 27
Big M method

 To correct this violation before starting the simplex algorithm, the


elementary row operations are used as follows:
New (Z row) = old (z row) ± M (A1 row) ± M (A2 row)
In our case, it will be positive since M is negative in the Z
row, as following:
Old (Z row): -2 -3 0 0 -M -M 0
M (A1 row): M 3M 0 -M M o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M

It becomes 28
Big M method

 The Basic
initial tableau
X1 X will
2 S1 S2 A1 A2 RHS
be:variable
2 3 0 0 M M
s
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 2M- 4M-3 0 -M 0 0 30M
• Since there is a positive value in the last row, this
2
solution is not optimal
• The entering variable is X2 (it has the most positive value
29
Big M method
 First iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variable
2 3 0 0 M M
s
S1 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3

A2 2/3 0 0 1/3 -1/3 1 10/3

Z 2/3M- 0 0 1/3M-1 1-4/3M 0 20+10/3


1 M
• Since there is a positive value in the last row, this
solution is not optimal
30
Big M method
 Second iteration

Basic X1 X S1 S2 A1 A2 RHS
variabl 2
es
S1 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5

X1 1 0 0 1/2 -1/2 3/2 5

Z 0 0 0 -1/2 ½-M 3/2- 25


M
This solution is optimal, since there is no positive value
in the last row. The optimal solution is: 31
Note for the Big M method

 In the final tableau, if one or more artificial variables (A1,


A2, …) still basic and has a nonzero value, then the
problem has an infeasible solution.
 All other notes are still valid in the Big M method.

32
Special cases

 In the final tableau, if one or more artificial variables (A1,


A2, …) still basic and has a nonzero value, then the
problem has an infeasible solution
 If there is a zero under one or more nonbasic variables in
the last tableau (optimal solution tableau), then there is a
multiple optimal solution.
 When determining the leaving variable of any tableau, if
there is no positive ratio (all the entries in the pivot column
are negative and zeroes), then the solution is unbounded.

33
Simplex method incase of
 Artificial
Solve the following variables
linear programming problem by using the
simplex method:“Big M method”
 Min Z =2 X1 + 3 X2
S.t.
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0

34
 Solution Big M method
Step 1: standard form
Min Z,
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X2 + S1 =4
X1 + 3X2 - S2 + A1 = 20
X1 + X2 + A2 = 10
X1, X2 ,S1, S2, A1, A2  0
Where: M is a very large number

35
 Notes Big M method
M, a very large number, is used to ensure that the values of A1 and A2, …, and An will
be zero in the final (optimal) tableau as follows:
1. If the objective function is Minimization, then A1, A2, …, and An must be added to
the RHS of the objective function multiplied by a very large number (M).
Example: if the objective function is Min Z = X1+2X2, then the obj. function should
be Min Z = X1 + X2+ MA1 + MA2+ …+ MAn
OR
Z – X1 - X2- MA1 - MA2- …- MAn = 0

2. If the objective function is Maximization, then A1, A2, …, and An must be


subtracted from the RHS of the objective function multiplied by a very large
number (M).
Example: if the objective function is Max Z = X1+2X2, then the obj. function should
be Max Z = X1 + X2- MA1 - MA2- …- MAn
OR
Z - X1 - X2+ MA1 + MA2+ …+ MAn = 0

N.B.: When the Z is transformed to a zero equation, the signs are changed
36
Big
 Step 2: Initial tableau M method
Basic X1 X2 S1 S2 A1 A2 RHS
variables
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

Note that one of the simplex rules is violated, which is the


basic variables A1, and A2 have a non zero value in the z
row; therefore, this violation must be corrected before 37
Bigbefore
 To correct this violation M method
starting the simplex algorithm, the
elementary row operations are used as follows:
New (Z row) = old (z row) ± M (A1 row) ± M (A2 row)
In our case, it will be positive since M is negative in the Z
row, as following:
Old (Z row): -2 -3 0 0 -M -M 0
M (A1 row): M 3M 0 -M M o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M

It becomes 38
Big M method
Basic X1 X2 S1 S2 A1 A2 RHS
 The initial tableau will
variables
be:
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 2M-2 4M-3 0 -M 0 0 30M

• Since there is a positive value in the last row, this


solution is not optimal
• The entering variable is X2 (it has the most positive value
39
Big M method
Basic X1 X2 S1 S2 A1 A2 RHS
 First iteration
variables
S1 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3

A2 2/3 0 0 1/3 -1/3 1 10/3

Z 2/3M-1 0 0 1/3M-1 1-4/3M 0 20+10/3M

• Since there is a positive value in the last row, this


solution is not optimal
• The entering variable is X1 (it has the most positive value
40
Big M method
Basic X1 X2 S1 S2 A1 A2 RHS
 Second iteration
variables
S1 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5

X1 1 0 0 1/2 -1/2 3/2 5

Z 0 0 0 -1/2 ½-M 3/2-M 25

This solution is optimal, since there is no positive value in


the last row. The optimal solution is:
X1 = 5, X2 = 5, S1 = ¼
41
Note for the Big M method

 In the final tableau, if one or more artificial variables (A1,


A2, …) still basic and has a nonzero value, then the
problem has an infeasible solution.
 All other notes are still valid in the Big M method.

42

You might also like