D1, C7 - This Simplex Algorithm Flashcards
How do you turn inequalities into equations when formulating linear programming problems (what is added)
Add a slack variable
Rewrite the inequality x1 + 3x2 + 5x3 <= 23 using the slack variable, r
x1 + 3x2 + 5x3 + r = 23
What does the simplex algorithm do
Finds the optimal solution to a linear programming problem
When would we use the simplex method
When you have more than 2 variables (x, y, z, …)
What are the steps of the simplex algorithm
1) Write in standard form
2) Set up tableau
3) Are there -ve’s on bottom row (No = optimal solution, yes –> step 4)
4) Select largest -ve as pivot column
5) Are there -ve’s in pivot column (No = optimal solution, yes = step 6)
6) Select pivot element and do pivot operations
7) Return to step 3 and repeat
What is the significance of slack variables in graphical representations of linear programming problems
The borders of the feasible region are when all of the variables (including slack) are equal to zero [x, y, r, s = 0]
How would you write the following in the ‘standard form’ for the simplex algorithm?
P = 3x + 2y
5x + 7y >= 70
P - 3x - 2y = 0
5x + 7y + r = 70
How would you write an equation for minimising P = 3x - y in ‘standard form’
Multiply all by -1 to make it a ‘maximising’ equation
-P = -3x + y
Q + 3x - y = 0
How do you find integer solutions to maximising functions
Consider the box of integer coordinate points around the optimal solution
If all constraints are valid, coordinate is correct
When more than one integer coordinate point satisfy all of the constraints, how do you determine the optimal solution
Sub in all values into maximising function and highest value of P is maximising coordinate
When do we use the two-stage simplex method
When we have >= constraints
What happens to slack variables in the two-stage simplex method
They become surplus variables
(subtracted from inequality)
…-s1 …-s2 …-s3
How do you avoid surplus variables being negative
Add on an artificial variable
…+a1 …a2 …+a3
What are the steps of the two-stage simplex algorithm
Stage 1
1) Slack variables become surplus variables
2) To avoid surplus variables becoming -ve, add artificial variables
3) Create a temporary objective function I, to minimise sum of the artificial variables (a1 + a2 + a3 + …)
4) Apply simplex algorithm to get I = 0, if I not equal to 0, no feasible solution
Stage 2
1) Remove artificial variables from tableau and apply the simplex algorithm
What happens if I cannot be equal to 0
No feasible solution to two-stage simplex algorithm