Simplex Algorithm - Slack Variables & Initial Tableau (Edexcel A Level Further Maths: Decision 1): Revision Note

Exam code: 9FM0

Paul

Written by: Paul

Reviewed by: Dan Finlay

Updated on

Introduction to the simplex algorithm

What is the simplex algorithm?

  • The simplex algorithm is an alternative to the graphical method for solving linear programming problems

    • It is particularly useful when there are more than 2 decision variables as these cannot be drawn graphically (Not very easily at least!)

    • Essentially the simplex algorithm works by considering each vertex of the basic feasible region in turn until an optimal solution is found

  • Initially the simplex algorithm can only be applied to an LP problem that has a basic feasible solution

    • For problems where the basic feasible region contains the origin, the basic feasible solution is the origin

      • In practical situations though, this is often not realistic

        • For example, the number of chairs and tables made by a furniture manufacturer trying to maximise their profit

        • if they make no chairs and no tables, they won't make any profit!

        • but the origin would satisfy all constraints if it is in the feasible region 

    • For problems where the basic feasible region does not contain the origin the algorithm is adapted such that a basic feasible solution is found first

      • then the simplex algorithm can be applied as usual

Slack variables

What are slack variables?

  • In the first instance, the simplex algorithm deals with constraints (inequalities) involving (excluding the non-negativity constraints)

    • Slack variables are used to turn inequalities involving  into equations

  • A slack variable, as the name implies, takes up the spare (slack) that a function falls short on in "less than or equal to" constraints

    • A slack variable will be added to (the left hand side of) each constraint so will be non-negative

  • The number of slack variables required in a problem will be the same as the number of (non-negativity) constraints involving

Worked Example

The following linear programming problem is to be solved using the simplex algorithm.

Maximise

P=8x+5y+7z

subject to

2x+3y10x+2y+5z605y+3z40x, y, z0

Use slack variables to write the constraints (except the non-negativity constraint) of the linear programming problem as equations.

 

Use s1 to 'use up the slack' in the inequality 2x+3y10

2x+3y+s1=10

use s2 for x+2y+5z60

x+2y+5x+s2=60

and s3 for 5y+3z40

5y+3z+s3=40

The constraints as equations using slack variables are

2x+3y+s1=10x+2y+5x+s2=605y+3z+s3=40

Initial tableau

What is the initial tableau?

  • The simplex algorithm is performed by creating a series of matrices, or tables, showing the values of each decision variable, each slack variable and the objective function until an optimal solution is found

  • The first of these tables is called the initial tableau

  • To set up the initial tableau, the equations derived from the inequalities (constraints) are needed along with a rearrangement of the objective function such that zero is on one side

    • e.g. P=8x+5y+7z becomes P8x5y7z=0

  • The initial tableau is created by

    • columns represent the basic variable (b.v.), the decision variables (x, y, z), the slack variables (s1, s2, s3) and the value (the RHS of each equation)

    • rows are completed with the coefficients of each equation/constraint

      • the last row is the (rearranged) objective function

    • the basic variable column is completed last

      • the basic variable for each row is the variable that has a 1 in that row but 0's in all other rows of that column

      • the last row is always the objective row

e.g.

Constructing the initial tableau for the objective function

P8x5y7z=0

and equations (constraints)

2x+3y+s1=10x+2y+5x+s2=605y+3z+s3=40

x~6afLSG_initial-tableau

Simplex algorithm

How do I apply the simplex algorithm?

  • Once the initial tableau is set up the first iteration can begin

  • STEP 1 For each row (except the objective row), find the θ-value by dividing the 'Value' by the entry in the pivot column

    • Deduce the pivot column by looking for the most negative entry in the objective row (excluding 'Value')

  • STEP 2 Find the pivot element (often just called the pivot) by finding where the pivot column and pivot row meet

    • Deduce the pivot row by selecting the row with the least positive θ-value

  • STEP 3 Use a series of row operations to update the tableau

    • manipulate the pivot row so that the pivot element is 1

    • for each 'old row' (i.e. each row from the previous tableau) use a multiple of the 'new pivot row' to make each entry in the pivot column zero, including the objective row

  • STEP 4 Complete the updated tableau by completing the header column of basic variables (b.v.)

    • to do this look for the column with one 1 and all other entries 0

Worked Example

The initial tableau for using the simplex algorithm is given below.  Apply the first iteration of the simplex algorithm.

b.v.

x

y

z

s1

s2

s3

Value

s1

2

3

0

1

0

0

10

s2

1

2

5

0

1

0

60

s3

0

5

3

0

0

1

40

P

-8

-5

-7

0

0

0

0

  • STEP 1 The most negative entry in the objective row is -8, so column 1 (C1) is the pivot column
    The θ-values for each row are

R1:  θ1=10÷2=5
R2:  θ2=60÷1=60
R3:   - n/a since division by zero is undefined

  • STEP 2 The least positive θ-value is θ1=5 so the pivot row is row 1 (R1)
    The pivot element is R1C1

Pivot is 2

  • STEP 3 Use the row operation 0.5'R1' to make the pivot element 1
    (The apostrophes indicate 'old row 1' - i.e. the row from the previous tableau.)
    For every other row use a row operation that makes the entry in the pivot column 0 (e.g.  the objective row (R4) will be 'old row 4 plus 8 lots of new row 1' ('R4'+8R1))

  • STEP 4 Complete the b.v. column by looking for a column with one 1 and all others 0

b.v.

x

y

z

s1

s2

s3

Value

Row Op.

x

1

1.5

0

0.5

0

0

5

0.5'R1'

s2

0

0.5

5

-0.5

1

0

55

'R2'R1

s3

0

5

3

0

0

1

40

'R3'

P

0

7

-7

4

0

0

40

'R4'+8R1

How do I know when the simplex algorithm is complete?

  • The simplex algorithm is compete when there are no negative entries in the objective row (excluding 'Value')

    • This tableau is called the final tableau

    • The optimal solution can be found from the final tableau

How do I find the optimal solution from the final tableau?

  • The basic variable (b.v.) and value column indicate the optimal solution

    • The variables in the basic value column take the value in their value column

    • The objective function will then have a maximum value of the entry in its value column

    • All other variables are non-basic and take the value of 0, regardless of values in the table

Worked Example

Apply one more iteration of the simplex algorithm to the tableau below and hence find the optimal solution to the linear programming problem it represents.

b.v.

x

y

z

s1

s2

s3

Value

x

1

1.5

0

0.5

0

0

5

s2

0

0.5

5

-0.5

1

0

55

s3

0

5

3

0

0

1

40

P

0

7

-7

4

0

0

40

First find the pivot column; -7 in C3 is the most negative entry in the objective row

Find the θ-values for each row

θ1 = n/aθ2=55÷5=11θ3=40÷3=13.333...

11 is the least positive so the pivot is 5 (R2C3)

Use row operations to make the pivot 1 and other entries in its column 0 Complete the b.v. column

b.v.

x

y

z

s1

s2

s3

Value

Row Op.

x

1

1.5

0

0.5

0

0

5

'R1'

z

0

0.1

1

-0.1

0.2

0

11

0.2'R2'

s3

0

4.7

0

0.3

-0.6

1

7

'R3'3R2

P

0

7.7

0

3.3

1.4

0

117

'R4'+7R2

There are no negative entries in the objective row so the algorithm is complete and the optimal solution can be read from the final tableau

Basic variables (in header column) take the values from their 'Value' column Non-basic variable take the value zero The maximum value of the objective function is the 'Value' in its row

x=5, z=11, s3=7y=0, s1=0, s2=0

P has a maximum value of 117

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Paul

Author: Paul

Expertise: Maths Content Creator

Paul has taught mathematics for 20 years and has been an examiner for Edexcel for over a decade. GCSE, A level, pure, mechanics, statistics, discrete – if it’s in a Maths exam, Paul will know about it. Paul is a passionate fan of clear and colourful notes with fascinating diagrams.

Dan Finlay

Reviewer: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.