The basic idea

For an upper-bound constraint, slack measures the distance between the current value and the allowed maximum. If a team can spend at most 100 units and spends 75, the slack is 25 units. A slack of zero means that upper bound is binding at that point.

Writing the equation

For a constraint ax ≤ b, define a nonnegative slack variable s = b − ax. The inequality can then be written as ax + s = b, with s ≥ 0. The units of s are the same as the units of the constraint’s two sides.

Avoid a common mix-up

For a lower-bound constraint ax ≥ b, the difference ax − b is often called surplus rather than slack, though terminology varies by text. Neither term should be confused with an application or brand that happens to use a similar name.

Worked example: a production limit

A workshop can use at most 40 machine hours this week. Its current plan uses 28 hours, so the slack is 40 − 28 = 12 hours. If the plan changes to 40 hours, slack becomes zero and the constraint is binding. If the plan requires 43 hours, the computed difference is −3; that plan violates the upper bound and is not feasible under the stated limit. Slack describes a constraint at a particular solution, not an entire model in isolation.

Choose the next step

SituationWhat to check
28 hours used, limit 40Slack = 12 hours; the upper bound is not binding.
40 hours used, limit 40Slack = 0; the upper bound is binding.
43 hours used, limit 40The plan exceeds the limit by 3 hours and is infeasible.

A practical checklist

  1. Identify whether the constraint is an upper or lower bound.
  2. Subtract the current value from the upper bound.
  3. Check that the resulting slack is nonnegative.
  4. Interpret zero slack as a binding upper bound at that point.