You are on page 1of 26

15-01-2024

Solving Linear Programming


Problems: Simplex Method
Sessions 5 - 8

The Simplex Method

 A general procedure for solving linear programming problems.


 Developed by George Dantzig in 1947
 The Simplex method is an algebraic procedure. However, its underlying
concepts are geometric

1
15-01-2024

The essence of the Simplex Method

 Let us consider the following


optimization problem:
 Maximize Z = 3𝑥1 + 5𝑥2
 Subject to:
 𝑥1 ≤ 4
 2𝑥2 ≤ 12
 3𝑥1 + 2 𝑥2 ≤ 18
 𝑥1 , 𝑥2 ≥ 0

Source: Hillier et al. (2022: 108)

The essence of the Simplex Method

 Each constraint boundary is a line that forms the boundary of what is


permitted by the corresponding constraint.
 The points of intersection are the corner-point solutions of the problem.
 Each corner point solution lies at the intersection of two constraint
boundaries.
 The five points which lie on the corners of the feasible region—(0,0), (0,6),
(2,6), (4,3), and (4,0)—are the corner-point feasible solutions (CPF solutions)
 The other three—(0,9), (4,6), and (6,0)—are called corner-point infeasible
solutions.
 Certain pairs of the CPF solutions share a constraint boundary, and other
pairs do not

2
15-01-2024

The essence of the Simplex Method


 In the given example, with two decision variables, two CPF solutions are
adjacent if they share one constraint boundary.
 (0,0) and (0,6) are adjacent because they share the 𝑥1 = 0 constraint boundary.
 The feasible region has 5 edges, consisting of five line segments forming the
boundary of this region
 Each CPF solution has two adjacent CPF solutions (each lying at the other
end of one of the two edges)

CPF Solution Its Adjacent CPF Solution


(0,0) (0,6) and (4,0)
(0,6) (2,6) and (0,0)
(2,6) (4,3) and (0,6)
(4,3) (4,0) and (2,6)
(4,0) (0,0) and (4,3)

Optimality test

 Consider any linear programming problem that possesses at least one


optimal solution. If a CPF solution has no adjacent CPF solutions that are
better (as measured by Z), then it must be an optimal solution.
 In the given example, (2,6) must be optimal simply because its Z = 36 is
larger than Z = 30 for (0,6) and Z = 27 for (4,3).

3
15-01-2024

How Simplex finds the optimal solution

 Initialization: Choose (0,0) as the initial CPF solution to examine


 Optimality Test: Conclude that (0,0) is not an optimal solution (Adjacent CPF
solutions are better)
 Iteration 1: Move to a better adjacent CPF solution, (0,6), by performing the
following steps
 Step 1: Considering the two edges of the feasible region that emanate from (0,0),
choose to move along the edge that leads up the 𝑥2 axis. (With an objective function
of Z = 3𝑥1+ 5𝑥2 , moving up the 𝑥2 axis increases Z at a faster rate than moving along
the 𝑥1 axis)
 Step 2: Stop at the first new constraint boundary: 2𝑥1 = 12. Moving further would lead
to leaving the feasible region.
 Step 3: Solve for the intersection of the new set of constraint boundaries: (0,6). The
equation for these constraint boundaries, 𝑥1= 0 and 2𝑥1 = 12, immediately yields a
solution
 Optimality test: Conclude that (0,6) is not an optimal solution (An adjacent CPF
solution is better)

How Simplex finds the optimal solution

 Iteration 2: Move to a better adjacent CPF solution, (2,6), by performing the


following steps:
 Step 1: Considering the two edges of the feasible region that emanate from (0,6),
choose to move along the edge that leads to the right. (Moving along this edge
increases Z, whereas backtracking to move back down the 𝑥2 axis decreases Z.)
 Step 2: Stop at the first new constraint boundary encountered when moving in
that direction: 3𝑥1 + 2 𝑥2 = 18. Moving further leaves the feasible region.
 Step 3: Solve for the interaction of the new set of constraint boundaries: (2,6).
 Optimality test: Conclude that (2,6) is an optimal solution, so stop. (None of
the adjacent CPF solutions are better).

4
15-01-2024

Setting up the Simplex Method

 The Simplex Method is an iterative algorithm (a systematic solution


procedure that keeps repeating a fixed series of steps, called an iteration,
until a desired result has been obtained) with the following structure.

 The algebraic procedure is based on solving systems of equations.

The Simplex Method

 The development of the simplex method computations is facilitated by imposing two


requirements on the LP model:
1. All the constraints are equations with nonnegative right-hand side.
2. All the variables are nonnegative
 To convert a (≤)-inequality to an equation, a nonnegative slack variable is added to the
left-hand side of the constraint.
 For example, the constraint 𝑥1 ≤ 4 can be written is 𝑥1 + 𝑠1 = 4, where 𝑠1 ≥ 0.
 Conversion from ≥ is achieved by subtracting a nonnegative surplus variable from the left-
hand side of the inequality.
 For example, the constraint 𝑥1 + 𝑥2 ≥ 800 can be written is 𝑥1 + 𝑥2 - 𝑆1 = 800, where 𝑆1 ≥ 0.
 In the algebraic solution space (defined by m x n equations, m < n), basic solutions
correspond to the corner points in the graphical solution space. They are determined by
setting n - m variables equal to zero and solving the m equations for the remaining m
variables, provided the resulting solution is unique.

5
15-01-2024

The Simplex Method

 The first step in setting up the Simplex method is to convert the functional
inequality constraints into equivalent equality constraints.
 Non-negativity constraints are left as inequalities because they are treated
separately.
 Upon introduction of slack variables for the other functional constraints, the
original linear programming model can now be replaced by the equivalent
model (called augmented form of the model)
 The term “augmented form” indicates that the original form has been
augmented by some supplementary variables needed to apply the simplex
method.

Original and Augmented forms

Original form Augmented form of the model


 Maximize Z = 3𝑥1 + 5𝑥2  Maximize Z = 3𝑥1 + 5𝑥2 + 0𝑠1 + 0𝑠2 + 0𝑠3
 Subject to:  Subject to:
 𝑥1 ≤ 4  𝑥1 + 𝑠1 = 4
 2𝑥2 ≤ 12  2𝑥2 + 𝑠2 =12
 3𝑥1 + 2 𝑥2 ≤ 18  3𝑥1 + 2 𝑥2 + 𝑠3 = 18
 𝑥1 , 𝑥2 ≥ 0 and
 𝑥1 , 𝑥2 ≥ 0 and 𝑠𝑗 ≥ 0, for j = 1, 2, 3

6
15-01-2024

Solution to the optimization problem

 A basic solution is an augmented corner-point solution.


 A basic feasible (BF) solution is an augmented CPF solution.
 Thus, the CPF solution (0, 6) in the example is equivalent to the BF solution (0, 6, 4, 0, 6)
for the problem in augmented form.
 A basic solution has the following properties:
 Each variable is designated as either a basic variable or non-basic variable
 The number of basic variables equals the number of functional constraints (or
equations). Therefore, the number of non-basic variables equals the total number of
variables minus the number of functional constraints.
 The non-basic variables are set equal to zero.
 The values of the basic variables are obtained as the simultaneous solution of the
system of equations. The set of basic variables is often referred to as the basis.
 If the basic variables satisfy the non-negativity constraints, the basic solution is a basic
feasible solution.

Example 1

 Maximize z = 5𝑥1 + 4𝑥2


 Subject to:
 6 𝑥1 +4 𝑥2 ≤ 24
 𝑥1 + 2𝑥2 ≤ 6
 −𝑥1 + 𝑥2 ≤ 1
 𝑥2 ≤ 2
 𝑥1 , 𝑥2 ≥ 0

7
15-01-2024

Example 1 Augmented form

 Maximize z = 5𝑥1 + 4𝑥2 + 0𝑠1 + 0𝑠2 + 0𝑠3 + 0𝑠4


 Subject to:
 6 𝑥1 +4 𝑥2 + 𝑠1 = 24
 𝑥1 + 2𝑥2 + 𝑠2 =6
 −𝑥1 + 𝑥2 + 𝑠3 =1
 𝑥2 + 𝑠4 = 2
 𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 , 𝑠3 , 𝑠4 ≥ 0

Solution to Example 1 contd…

 The objective equation can be written as


 z - 5𝑥1 - 4𝑥2 = 0
 The starting Simplex tableau can be represented as below:

Basic z 𝑥1 𝑥2 𝑠1 𝑠2 𝑠3 𝑠4 Solution
z 1 -5 -4 0 0 0 0 0 z-row
𝑠1 0 6 4 1 0 0 0 24 𝑠1 -row
𝑠2 0 1 2 0 1 0 0 6 𝑠2 -row
𝑠3 0 -1 1 0 0 1 0 1 𝑠3 -row
𝑠4 0 0 1 0 0 0 1 2 𝑠4-row

8
15-01-2024

Solution to Example 1 contd…

 The solution starts at the origin [(𝑥1 , 𝑥2 ) = (0, 0)], thus defining (𝑥1 , 𝑥2 ) as the
nonbasic variables and (𝑠1 , 𝑠2 , 𝑠3 , 𝑠4) as the basic variables.
 The associated objective z and the basic variables (𝑠1 , 𝑠2 , 𝑠3 , 𝑠4) are listed in
the leftmost Basic-column.
 Their values, z = 0, 𝑠1 = 24, 𝑠2 = 6, 𝑠3 =1, 𝑠4 = 2, appearing in the rightmost
Solution-column, are given directly by the right-hand sides of the model’s
equations
 Is the starting solution optimal?
 The objective function z = 5𝑥1 + 4𝑥2 shows that the solution can be improved
by increasing the value of nonbasic 𝑥1 or 𝑥2 above zero.

Solution to Example 1 contd…

 In the simplex tableau where the objective function is written as z - 5𝑥1 - 4𝑥2
= 0, the selected variable is the nonbasic variable with the most negative
coefficient in the objective equation. This rule defines the so-called simplex
optimality condition.
 In the terminology of the simplex algorithm, 𝑥1 is known as the entering
variable because it enters the basic solution.
 If 𝑥1 is the entering variable, one of the current basic variables must leave—
that is, it becomes nonbasic at zero level.
 The mechanics for determining the leaving variable calls for computing the
ratios of the righthand side of the equations (Solution column) to the
corresponding (strictly) positive constraint coefficients under the entering
variable, 𝑥1

9
15-01-2024

Entering and leaving variable

The swapping process is based on the Gauss-Jordan row operations. It


identifies the entering variable column as the pivot column and the leaving
variable row as the pivot row with their intersection being the pivot element.

Pivot row and Pivot column

10
15-01-2024

New Basic Solution

New Basic Solution

11
15-01-2024

New Tableau

Iteration 2

12
15-01-2024

Final Tableau

Optimal solution

13
15-01-2024

Method 2

Source: Sharma (2016: p. 103)

Example 2

 A company makes two kinds of leather belts, belt A and belt B. Belt
A is a high quality belt and belt B is of lower quality. The respective
profits are Rs 4 and Rs 3 per belt. The production of each of type A
requires twice as much time as a belt of type B, and if all belts were
of type B, the company could make 1,000 belts per day. The supply
of leather is sufficient for only 800 belts per day (both A and B
combined). Belt A requires a fancy buckle and only 400 of these are
available per day. There are only 700 buckles a day available for
belt B. What should be the daily production of each type of belt?
Formulate this problem as an LP model and solve it using the simplex
method.

14
15-01-2024

Example 2 Solution

 Maximize z = 4𝑥1 + 3𝑥2 + 0𝑠1 + 0𝑠2 + 0𝑠3 + 0𝑠4


 Subject to:
 2 𝑥1 + 𝑥2 + 𝑠1 = 1000
 𝑥1 + 𝑥2 + 𝑠2 = 800
 𝑥1 + 𝑠3 = 400
 𝑥2 + 𝑠4 = 700
 𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 , 𝑠3 , 𝑠4 ≥ 0

Initial solution

15
15-01-2024

Improved solution
𝑅3 (new) = 𝑅3 (old) / pivot element; 𝑅1 (new) = 𝑅1 (old) – 2* 𝑅3 (new)
𝑅2 (new) = 𝑅2 (old) – 1* 𝑅3 (new)

Improved solution

16
15-01-2024

Optimal solution

Exercise 1

 Maximize z = 𝑥1 + 2𝑥2 + 4𝑥3


 Subject to
 3𝑥1 + 𝑥2 + 5𝑥3 ≤ 10
 𝑥1 + 4𝑥2 + 𝑥3 ≤ 8
 2𝑥1 + 2𝑥3 ≤ 7
 𝑥1 , 𝑥2 , 𝑥3 ≥ 0

17
15-01-2024

Exercise 2

 Maximize z = 2𝑥1 + 4𝑥2 + 3𝑥3


 Subject to
 3𝑥1 + 4𝑥2 + 2𝑥3 ≤ 60
 2𝑥1 + 𝑥2 + 2𝑥3 ≤ 40
 𝑥1 + 3𝑥2 + 2𝑥3 ≤ 80
 𝑥1 , 𝑥2 , 𝑥3 ≥ 0

Exercise 3

 A company produces three products A, B, and C. These products require


three ores 𝑂1, 𝑂2, and 𝑂3. The maximum quantities of the ores 𝑂1, 𝑂2, and
𝑂3 available are 22 tons, 14 tons, and 14 tons, respectively. For one ton of
each of these products, the ore requirements are:
A B C
𝑂1 3 3
𝑂2 1 2 3
𝑂3 3 2 3
Profit per ton (Rs. in ‘000) 1 4 5

 The company makes a profit of Rs. 1,000, Rs. 4,000, and Rs. 5,000 on each
ton of the products A, B, and C respectively. How many tons of each
product should the company produce to maximize its profits

18
15-01-2024

Exercise 4

 A pharmaceutical company has 100 kg of A, 180 kg of B and 120 kg of C


ingredients available per month. The company can use these materials to make
three basic pharmaceutical products namely 5-10-5, 5-5-10 and 20-5-10, where
the numbers in each case represent the percentage of weight of A, B and C,
respectively, in each of the products. The cost of these raw materials is as
follows:
Ingredient Cost per kg (₹)
A 80
B 20
C 50
Inert ingredients 20
 The selling prices of these products are Rs 40.5, Rs 43 and 45 per kg ,
respectively. There is a capacity restriction of the company for product 5-10-5,
because of which the company cannot produce more than 30 kg per month.
Determine how much of each of the products the company should produce in
order to maximize its monthly profit.

Exercise 4 hint

Product Product Ingredients


A B C Inert
𝑃1 5% 10% 5% 80%
𝑃2 5% 5% 10% 80%
𝑃3 20% 5% 10% 65%
Cost per kg (Rs.) 80 20 50 20

Cost of 𝑃1 = 0.05*80 + 0.1*20+0.05*50+0.8*20 = ₹ 24.50 per kg

19
15-01-2024

Solution to Minimization Problems

 Consider the following example


 Minimize Z = 40𝑥1 + 24𝑥2
Augmented form:
 Subject to: ▪ Minimize Z = 40𝑥1 + 24𝑥2 + 0𝑆1 + 0𝑆2
▪ Subject to:
 20𝑥1 + 50𝑥2 ≥ 4,800
20𝑥1 + 50𝑥2 - 𝑆1 = 4,800
 80𝑥1 + 50𝑥2 ≥ 7,200 80𝑥1 + 50𝑥2 - 𝑆2 = 7,200
 𝑥1 , 𝑥2 ≥ 0 𝑥1 , 𝑥2 , 𝑆1 , 𝑆2 ≥ 0

 The augmented form leads to a problem because in the initial Simplex


solution when 𝑥1 = 0 and 𝑥2 = 0, we get 𝑆1 = -4,800 and 𝑆2= -7,200, which is
not feasible because it violates the non-negativity restriction.

Big M Method

 In a case where an identity is not obtained, a variant of the simplex


method called the Big-M method is employed.
 In this method, we add artificial variables into the model to obtain an initial
solution.
 Unlike slack or surplus variables, artificial variables have no tangible
relationships with the decision problem. Their sole purpose is to provide an
initial solution to the given problem.
 When artificial variables are introduced in the problem under
consideration, its constraints appear as:
 20𝑥1 + 50𝑥2 - 𝑆1 + 𝐴1 = 4,800
 80𝑥1 + 50𝑥2 - 𝑆2 + 𝐴2 = 7,200

20
15-01-2024

The Big M Method

 The artificial variables are introduced for the limited purpose of obtaining
an initial solution and are required for the constraints of ‘≥’ type, or with
constraints with ‘=’ sign.
 Since artificial variables do not represent any quantity relating to the
decision problem, they must be driven out of the system and must not show
in the final solution.
 This can be ensured by assigning an extremely high cost to them.
 Generally a value M is assigned to each artificial variable, where M represents a
number higher than any finite number (therefore, we call it Big-M Method).
 When the problem is of minimization nature, we assign in the objective function a
coefficient of +M to each artificial variable
 For problems with the objective function of maximization type, each of the
artificial variables introduced has a coefficient –M.

The Big M Method

 Step 1: Express the LP problem in the augmented form by adding slack


variables, surplus variables, and artificial variables. Assign a zero coefficient to
both slack and surplus variables and a very large positive coefficient +M
(minimization case) and –M (maximization case) to artificial variable in the
objective function.
 Step 2: The initial basic feasible solution is obtained by assuming zero value to
original variables.
 Step 3: Calculate the 𝑐𝑗 − 𝑧𝑗 values of in the last row of the simplex table and
examine these values
 If all 𝑐𝑗 − 𝑧𝑗 ≥ 0, then the current basic feasible solution is optimal.
 If for a column, k, 𝑐𝑘 − 𝑧𝑘 is most negative and all entries in this column are negative,
then the problem has an unbounded optimal solution.
 If one or more 𝑐𝑗 − 𝑧𝑗 < 0 (minimization case), then select the variables to enter into
the basis with the largest negative 𝑐𝑗 − 𝑧𝑗 value (largest per unit reduction in the
objective function value)

21
15-01-2024

The Big M Method

 Step 4: Determine the key row and key element in the same manner as the
simplex algorithm of the maximization case
 Step 5: Continue with the procedure to update solution at each iteration till
optimal solution is obtained.
 Remarks
 If at any iteration, at least one artificial variable is present in the basis with zero
value and the coefficient of M in each 𝑐𝑗 − 𝑧𝑗 (j = 1,2,…,n) values is non-negative,
then the given LP problem has no solution. That is, the current basic feasible
solution is degenerate.
 If any iteration, as least one artificial variable is present in the basis with a positive
value and the coefficient of M in each 𝑐𝑗 − 𝑧𝑗 (j = 1,2,…,n) values is non-negative,
then given LP problem has no optimum basic feasible solution.

Example 3

 Using Big M method, solve the following LP problem


 Minimize Z = 5𝑥1 + 3𝑥2
 Subject to
 2𝑥1 + 4𝑥2 ≤ 12
 2𝑥1 + 2𝑥2 = 10
 5𝑥1 + 2𝑥2 ≥ 10
 𝑥1 , 𝑥2 ≥ 10

22
15-01-2024

Solution to Example 3

 Minimize Z = 5𝑥1 + 3𝑥2 +0𝑠1 + 0𝑠2 + 𝑀𝐴1 + 𝑀𝐴2


 Subject to
 2𝑥1 + 4𝑥2 + 𝑠1 = 12
 2𝑥1 + 2𝑥2 + 𝐴1 = 10
 5𝑥1 + 2𝑥2 − 𝑠2 + 𝐴2 = 10
 𝑥1 , 𝑥2, 𝑠1 , 𝑠2 , 𝐴1 , 𝐴2 ≥ 10

Solution contd…

23
15-01-2024

Solution contd…

Solution contd…

24
15-01-2024

Optimal Solution

Exercise 4

 A person requires 10, 12, and 12 units of chemicals A, B, and C, respectively


for his garden. A liquid product contains 5, 2, and 1 units of A, B, and C,
respectively per jar. A dry product contains 1, 2, and 4 units of A, B, and C
per unit. If the liquid product sells for Rs. 3 per jar and the dry product for Rs.
2 per carton, how many of each should be purchased in order to minimize
the cost and meet the requirement?

25
15-01-2024

Exercise 5

 A furniture company can produce four types of chairs. Each chair is first
made in the carpentry shop and then furnished, waxed and polished in the
finishing shop. Man-hours required for each are:
Chair types
1 2 3 4
Carpentry shop 4 9 7 10
Finishing shop 1 1 3 40
Contribution per chair (Rs.) 12 20 18 40

 Total number of man-hours available per month in carpentry and finishing


shops are 6,000 and 4,000 respectively. Assuming abundant supply of raw
material and demand for finished products, determine the number of each
type of chairs to be produced for profit maximization.

26

You might also like