Slack variable


In an optimization problem, a slack variable is a variable that added to an inequality constraint to transform it into an equality. Introducing a slack variable replaces an inequality constraint with an equality constraint and a non-negativity constraint on the slack variable.
Slack variables are used in particular in linear programming. As with the other variables in the augmented constraints, the slack variable cannot take on negative values, as the simplex algorithm requires them to be positive or zero.
By introducing the slack variable, the inequality
can be converted to the equation

Embedding in orthant

Slack variables give an embedding of a polytope into the standard f-orthant, where f is the number of constraints. This map is one-to-one but not onto, and is expressed in terms of the constraints.
Slack variables are dual to generalized barycentric coordinates, and, dually to generalized barycentric coordinates, are uniquely determined, but cannot all be realized.
Dually, generalized barycentric coordinates express a polytope with n vertices, regardless of dimension, as the image of the standard -simplex, which has n vertices – the map is onto: and expresses points in terms of the vertices. The map is one-to-one if and only if the polytope is a simplex, in which case the map is an isomorphism; this corresponds to a point not having unique generalized barycentric coordinates.