# Slack, Surplus, Entering and Leaving Variable

Posted by   on

Entering Variable:
The entering Variable in a maximization/minimization problem is the non-basic variable having the most negative/positive coefficient in the z-cj row.
Ties are broken arbitrarily.
Leaving Variable:
For both maximization & minimization problems, the leaving variable is the basic variable associated with smallest non-negative ratio (with strongly positive denominator). Ties are broken arbitrarily.
The optimum is reached at the iteration where all the z-cj rows coefficients of the non-basic variables are non-negative (for maximizing problem) or non-positive (minimizing).
Slack variables:
When the constraints are inequations connected by the sign ≤, then in each equation an extra variable is added to the left hand side of the equation to convert it into an equation. These variables are known as slack variables. For example,
X1-2x2+x3≤5
=>x1-2x2+x3+s1=5
The variable s1 is known as slack variable which is non-negative.
Surplus variables:
When the constraints are inequations connected by the sign , then in each equation an extra variable is subtracted to the left hand side of the equation to convert it into an equation. These variables are known as surplus variables. For example,
X1-2x2+x35
=>x1-2x2+x3-s1=5
The variable s1 is known as surplus variable which is non-negative.