In an
optimization problem
In mathematics, engineering, computer science and economics
Economics () is a behavioral science that studies the Production (economics), production, distribution (economics), distribution, and Consumption (economics), consumption of goo ...
, a slack variable is a variable that is added to an
inequality constraint to transform it into an equality constraint. A non-negativity constraint on the slack variable is also added.
Slack variables are used in particular in
linear programming
Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements and objective are represented by linear function#As a polynomia ...
. As with the other variables in the augmented constraints, the slack variable cannot take on negative values, as the
simplex algorithm
In mathematical optimization, Dantzig's simplex algorithm (or simplex method) is a popular algorithm for linear programming.
The name of the algorithm is derived from the concept of a simplex and was suggested by T. S. Motzkin. Simplices are ...
requires them to be positive or zero.
* If a slack variable associated with a constraint is ''zero'' at a particular
candidate solution
In mathematical optimization and computer science, a feasible region, feasible set, or solution space is the set of all possible points (sets of values of the choice variables) of an optimization problem that satisfy the problem's constraints, ...
, the
constraint is
binding there, as the constraint restricts the possible changes from that point.
* If a slack variable is ''positive'' at a particular candidate solution, the constraint is
non-binding there, as the constraint does not restrict the possible changes from that point.
* If a slack variable is ''negative'' at some point, the point is
infeasible (not allowed), as it does not satisfy the constraint.
Slack variables are also used in the
Big M method.
Example
By introducing the slack variable
, the inequality
can be converted to the equation
.
Embedding in orthant
Slack variables give an embedding of a
polytope
In elementary geometry, a polytope is a geometric object with flat sides ('' faces''). Polytopes are the generalization of three-dimensional polyhedra to any number of dimensions. Polytopes may exist in any general number of dimensions as an ...
into the standard ''f''-
orthant
In geometry, an orthant or hyperoctant is the analogue in ''n''-dimensional Euclidean space of a quadrant in the plane or an octant in three dimensions.
In general an orthant in ''n''-dimensions can be considered the intersection of ''n'' mutu ...
, where
is the number of constraints (facets of the polytope). This map is one-to-one (slack variables are uniquely determined) but not onto (not all combinations can be realized), and is expressed in terms of the ''constraints'' (linear functionals, covectors).
Slack variables are ''
dual'' to
generalized barycentric coordinates, and, dually to generalized barycentric coordinates (which are not unique but can all be realized), are uniquely determined, but cannot all be realized.
Dually, generalized barycentric coordinates express a polytope with
vertices (dual to facets), regardless of dimension, as the ''image'' of the standard
-simplex, which has
vertices – the map is onto:
and expresses points in terms of the ''vertices'' (points, vectors). 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.
References
{{reflist
External links
Slack Variable Tutorial- Solve slack variable problems online
Linear programming