Skip to content

Slack Variable

Definition

For a constraint ∑jaijxj≤bi\displaystyle \sum_ja_{ij}x_j\le b_i, a slack variable sis_i converts it into

∑jaijxj+si=bi,si≥0.\sum_ja_{ij}x_j+s_i=b_i,\qquad s_i\ge0.

Thus si=bi−∑jaijxj\displaystyle s_i=b_i-\sum_ja_{ij}x_j measures the unused allowance in the inequality.


Interpretation

A slack variable measures how much of an allowance is left unused: the gap between the limit bib_i and the amount ∑jaijxj\displaystyle \sum_ja_{ij}x_j actually used. Adding it turns the inequality into an equation, the form the simplex method works with, without changing which decisions are allowed.

The feasible pentagon with the constraint equations including slack variables, an interior point with three positive slacks, and the optimal corner where two slacks are 0.

Each constraint line of the Giapetto model carries its slack equation. At the interior point (20,20)(20,20) all three slacks are positive: s1=40s_1=40, s2=40s_2=40, s3=20s_3=20. At the optimal corner (20,60)(20,60) the first two constraints are binding, s1=s2=0s_1=s_2=0, while s3=20s_3=20.

Drag the decision point: si=bi−∑jaijxj\displaystyle s_i=b_i-\sum_j a_{ij}x_j is the unused amount of resource ii. A slack of 00 means the constraint is binding.

The nonnegativity constraint si≥0s_i\ge0 carries the direction of the original inequality: a negative slack would put the point outside the feasible region. With nonnegative right-hand sides the slacks give the first basic feasible solution, at the origin. A ≥\ge constraint needs a surplus variable, subtracted instead.


Key Results

  • A zero slack means the constraint is binding at that solution.
  • The introduced slack has zero coefficient in the original objective.
  • With nonnegative right-hand sides, slack variables can form an initial feasible basis.

Examples

  • 2x1+x2≤102x_1+x_2\le10 becomes 2x1+x2+s1=102x_1+x_2+s_1=10.
  • At (x1,x2)=(3,4)(x_1,x_2)=(3,4) this slack equals zero.

Prerequisites

Sources

Symbols: sum

Last updated: 20 October 2026 03:02