Sensitivity Analysis and Duality in WFM

From WFM Labs

Sensitivity analysis and duality answer the question every WFM leader eventually asks: "what happens if I change one thing?" Linear programming produces an optimal schedule, but the optimal schedule is only as stable as the inputs that built it. Sensitivity analysis reveals how much each input — offered load, handle time, shrinkage — can shift before the optimal plan breaks. Duality reveals what each constraint is worth: the exact dollar cost of one more agent in interval 47, or the value of relaxing a minimum-rest requirement by one hour.

Together, these tools transform optimization from a black box into a diagnostic instrument. The staffing plan is no longer just a set of numbers; it becomes a map of trade-offs, costs, and risks.

Overview

Shadow prices and constraint marginal values

Every WFM optimization problem has two faces. The primal problem finds the best allocation of resources subject to constraints. The dual problem assigns a value to every constraint — answering "what would I pay for one unit of relief on this constraint?" These two perspectives are mathematically inseparable: solving one solves both. The dual variables (shadow prices) that emerge from the dual problem are among the most actionable outputs any WFM optimizer can produce.

Sensitivity analysis extends this by asking: over what range of parameter values does the current optimal basis remain optimal? If AHT increases by 10%, does the entire staffing plan need to be rebuilt, or does the current schedule absorb the change with minimal degradation?

Robust optimization takes the next step: instead of optimizing for a single forecast and then checking sensitivity after the fact, it builds hedges directly into the formulation, optimizing for a set of plausible scenarios simultaneously.

Mathematical Foundation

The Primal-Dual Pair

Consider a standard LP formulation for shift scheduling:

Primal (resource allocation):

min𝐜T𝐱subject toA𝐱𝐛,𝐱0

where 𝐱 is a vector of shift quantities, 𝐜 is the cost per shift, A maps shifts to interval coverage, and 𝐛 is the staffing requirement per interval.

Dual (constraint valuation):

max𝐛T𝐲subject toAT𝐲𝐜,𝐲0

Each dual variable yi is the shadow price of constraint i — the rate at which the objective function improves per unit increase in bi.

Strong duality theorem: At optimality, the primal and dual objective values are equal:

𝐜T𝐱*=𝐛T𝐲*

This is not an approximation. It is an exact identity.

Shadow Prices

The shadow price of a constraint is:

yi*=z*bi

where z* is the optimal objective value. In WFM terms: if interval 47 requires 23 agents and the shadow price is $42, then relaxing that requirement to 22 agents saves exactly $42 (within the range of validity). Tightening it to 24 costs exactly $42 more.

Shadow prices are only valid over a range — the allowable increase and decrease of the right-hand side for which the current basis remains optimal. Beyond that range, the basis changes, new constraints become binding, and shadow prices shift.

Reduced Costs

For non-basic variables (shifts not currently used in the optimal solution), the reduced cost c¯j answers: by how much would this shift's cost need to decrease before it enters the optimal basis?

c¯j=cj𝐲TAj

where Aj is the column of A corresponding to shift j. If a candidate shift type has a reduced cost of $15, its hourly rate must drop by at least $15/hour before the optimizer would select it. This directly informs decisions about whether to create new shift templates.

Parametric Sensitivity

Parametric analysis varies a single parameter continuously and traces the optimal objective value as a function of that parameter. For a right-hand side parameter:

z*(θ)=z*+yi*θfor θ[θ,θ+]

The function z*(θ) is piecewise linear and convex (for minimization), with breakpoints wherever the optimal basis changes. Each segment has a slope equal to the shadow price in that region.

Robust Optimization

Rather than optimizing for a single forecast 𝐛, robust optimization optimizes over an uncertainty set 𝒰:

min𝐱max𝐛𝒰𝐜T𝐱subject toA𝐱𝐛,𝐱0

Common uncertainty sets:

  • Box uncertainty: bi[b¯ib^i,b¯i+b^i] — each interval varies independently within a range
  • Ellipsoidal uncertainty: (𝐛𝐛¯)TΣ1(𝐛𝐛¯)Γ2 — correlated deviations bounded by a budget of uncertainty
  • Budget uncertainty (Bertsimas-Sim): at most Γ intervals deviate simultaneously from nominal — a practical middle ground that avoids worst-case conservatism

WFM Applications

Shadow Prices for Staffing Decisions

After solving a shift-scheduling LP, the shadow price vector directly answers:

  • "Interval 47 has the highest shadow price at $68/agent. Investing in coverage here — partial shifts, overtime, VTO cancellation — yields the highest return."
  • "Weekend overnight intervals have shadow prices near zero. The minimum staffing constraint is slack; we have more agents than needed."
  • "The shadow price for the maximum-overtime constraint is $25/hour. Each additional overtime hour we permit saves $25 in overall cost."

This transforms budget conversations from intuition to arithmetic.

Reduced Costs for Shift Design

When evaluating whether to introduce a new shift type (e.g., a 6-hour shift starting at 11:00):

  1. Model the new shift as an additional column in the LP
  2. Compute its reduced cost: the gap between its per-hour cost and the combined shadow prices of the intervals it covers
  3. If the reduced cost is negative, the shift improves the solution immediately
  4. If positive, the shift's cost premium must decrease by that amount before it becomes viable

This replaces trial-and-error shift design with targeted analysis.

Parametric Sensitivity for AHT Changes

AHT enters the staffing requirements through the Erlang formula. A 10% AHT increase changes 𝐛 nonlinearly, but within the LP's sensitivity range, the cost impact is:

Δziyi*Δbi

If this approximation breaks (because Δ𝐛 exceeds the allowable range), the problem must be re-solved — but the sensitivity analysis tells you in advance whether re-solving is necessary.

Robust Scheduling Against Forecast Error

A robust formulation with budget uncertainty (Γ=5) means: the schedule is feasible as long as no more than 5 intervals simultaneously experience demand at the upper bound of the forecast confidence interval. The cost premium over the nominal solution is the price of robustness — typically 3-8% for practical WFM problems, a modest insurance premium.

Worked Example

Problem: A contact center operates 48 half-hour intervals per day. Three shift types are available:

Shift Start Duration Hourly Cost
A (full-time) 08:00 8 hours $22
B (part-time) 11:00 5 hours $18
C (split) 08:00-12:00, 16:00-20:00 8 hours $24

After solving the LP relaxation:

Shadow prices (selected intervals):

Interval Time Requirement Shadow Price
22 11:00-11:30 35 agents $0 (slack)
34 17:00-17:30 52 agents $47
36 18:00-18:30 48 agents $38
47 23:30-00:00 12 agents $62

Interpretation:

  • Interval 22 is over-covered — adding or removing a requirement of 1 agent costs nothing
  • Interval 47 has the highest shadow price despite the lowest requirement — few shift types cover late night, making marginal coverage expensive
  • The evening peak (intervals 34-36) has moderate shadow prices — multiple shift types compete for coverage

Reduced cost of a new shift type D (18:00-23:00, $20/hr):

c¯D=5×$20icoveredyi*=$100$187=$87

The reduced cost is negative. This shift type would improve the solution by approximately $87 per shift assigned. Recommendation: introduce shift type D immediately.

Maturity Model Position

Sensitivity analysis and duality map to the WFM Maturity Model as follows:

  • Level 2 (Developing): Managers run "what-if" scenarios manually — changing one input, re-running the optimizer, comparing results
  • Level 3 (Advanced): Shadow prices are extracted from the optimizer and used to prioritize interval coverage investments
  • Level 4 (Leading): Parametric sensitivity reports accompany every staffing plan, showing breakpoints and risk ranges
  • Level 5 (Innovating): Robust optimization is standard; the price of robustness is a managed parameter; dual information drives automated shift-design recommendations

See Also

References

  • Bertsimas, D. & Tsitsiklis, J.N. (1997). Introduction to Linear Optimization. Athena Scientific.
  • Bertsimas, D. & Sim, M. (2004). "The Price of Robustness." Operations Research, 52(1), 35-53.
  • Dantzig, G.B. (1963). Linear Programming and Extensions. Princeton University Press.
  • Vanderbei, R.J. (2020). Linear Programming: Foundations and Extensions. 5th ed. Springer.
  • Ben-Tal, A., El Ghaoui, L. & Nemirovski, A. (2009). Robust Optimization. Princeton University Press.