There are constantly new terms when studying linear programming, or any programming, for that matter.
Studying programming has a difficult learning curve, and you must have all the facts before digging into a problem.
To have all the information, you must constantly research and keep your motivation on a certain level.
In this article, find out about slack/surplus variables, and satisfy your daily need for gathering all the facts about linear programming.
What is Slack in Linear Programming?
Before checking out the rest of the article, you should click here if you want to find out basic and most important details about linear programming.
A slack variable is a new variable that is added to the optimization problem in linear programming. The point is to change inequalities into equalities.
The change is in constraints, so, the point is to change the inequality constraint to a quality one.
This method is frequently used to turn linear optimization problems into a form that can be quickly solved using the simplex algorithm.
The simplex approach requires that variables be positive; hence a slack variable must always be positive.
If you want to learn more about why variables cannot be negative, click here!
To put it differently, inequalities [Less than] are removed from an equation by adding slack variables.
Check the example:
Maximize z-5x-6y = 0, which is subjected to 2x+y <= 4 , x+2y <= 4, x >= 0, y>=0.
In the XY plane, an unlimited number of ordered pairs satisfy the inequality 2x+y = 4.
To make the LHS* equal to the RHS*, we first assume that the statement that LHS is smaller than RHS is true.
Now that the equations have been changed, it is easier to solve for the goal since 2x + y + s1 = 4; x+2y+s2 = 4 accordingly.
* split an equation into two pieces, the left-hand side, and the right-hand side. We like to refer to the LHS and RHS of the equation in abbreviated form.
If the LHS and RHS are identical, then the equation is true; otherwise, the equation does not hold for at least some real number values.
The Difference Between Slack and Surplus
You can see if you are near meeting a condition as equality in the Slack or Surplus column.
Slack refers to the amount which is equal to or less than (≤) constraints.
On the other hand, Surplus refers to the amount which is equal to or greater than (≥), constraints.
Both values will be equal to 0 if a constraint is perfectly met as an equivalence.
Also, it is good to mention that the slack or excess value will be negative if a constraint is broken, as would occur in an impossible solution.
This information can be useful for easier finding the contravene constraints in an infeasible model.
If you wondered what is an infeasible model, here is the answer.
An infeasible model is one for which there isn’t a set of variable values that pleases all constraints, all at once.
Nonbinding constraints will have positive, non-zero values in this column, as will constraints with slack or excess (surplus) values higher than zero.
What are Slack/Surplus Variables in Linear Programming?
Slack variables are introduced to an unequal constraint in an optimization problem to change it into equality.
An equality requirement and a non-negativity constraint are replaced by an inequity constraint on the slack variable when a slack variable is introduced.
For a surplus variable, you can also say that it is called a negative slack variable.
A surplus variable is a variable that is subtracted from an inequity constraint in an optimization problem to make it equal.
An equality constraint and a non-negativity constraint are replaced by an inequality constraint on the surplus variable when a surplus variable is introduced.
What is Slack in Equation?
When you import a slack variable into linear programming, there are usually more equations than variables.
If you have n more variables than equations, you can find the solution if you set some combinations of n variables to 0.
This reduces the number of variables to the number of equations.
Variables are added to linear programming problems to replace the inequalities describing the constraints with equations.
For each available equation, you will add a slack variable.
For instance, if 2x+3y≤30, we would add a slack variable “s” that would fulfill 2x+3y+s−30=0.
This enables the application of the simplex method, an algebraic solution technique.
What is Slack Value?
Each restriction has a stated slack or excess (surplus) value.
When there are fewer or equal restrictions, it is said that there is “slack,” and when there are more constraints, it is said that there is “surplus.”
This was covered at the beginning of the article, but repetition is everything!
Basically, the matching slack or surplus value will be equal to zero if a constraint is binding.
Now you know for sure what slack/surplus value is!
Check this video if you want to find out more cool details about slack in linear programming!