Approximation Algorithms for Scheduling

From WFM Labs

Approximation Algorithms for Scheduling addresses a core reality of production workforce management: many scheduling problems are NP-hard, meaning exact optimal solutions become computationally infeasible as problem size grows. Approximation algorithms provide solutions with provable quality guarantees — a mathematical certificate that the solution is within a known factor of optimal. This page explains when and why approximate solutions outperform exact ones in WFM contexts, and how to reason about the trade-off between solution quality and computation time.

Overview

WFM practitioners encounter a paradox: the scheduling software says "optimal," but the solve took 10 seconds on a problem that would require days to solve exactly. What happened? The software found a good solution — possibly very good — but almost certainly not the mathematical optimum. It used heuristics, time limits, or approximation techniques to produce a high-quality answer within a practical time budget.

Understanding approximation algorithms illuminates this process. Rather than treating the optimizer as a black box, practitioners who understand approximation guarantees can:

  • Set appropriate solver time limits based on the quality-time trade-off
  • Choose between competing solution methods for different problem types
  • Recognize when a "95% optimal" solution in 10 seconds is operationally superior to a "99.5% optimal" solution in 10 hours
  • Evaluate vendor claims about solution quality

The field of approximation algorithms provides the theoretical framework for these decisions.

Mathematical Foundation

Approximation Ratios

An algorithm ALG has an approximation ratio ρ for a minimization problem if, for every instance:

ALG(I)OPT(I)ρ

where ALG(I) is the algorithm's solution cost and OPT(I) is the true optimum. A ρ=1.5 guarantee means the solution is never more than 50% worse than optimal. For maximization problems, the ratio is inverted: OPT(I)ALG(I)ρ.

Critically, ρ is a worst-case guarantee. On typical instances, the algorithm usually performs much better. The guarantee says: "even on the hardest possible input, the solution won't be terrible."

Greedy Algorithms with Guarantees

Set Cover Problem: Given a universe of elements and a collection of subsets, find the minimum number of subsets that cover all elements. The greedy algorithm — repeatedly choose the subset covering the most uncovered elements — achieves an approximation ratio of Hn=lnn+O(1), where n is the number of elements.

This is directly relevant to shift scheduling: the "elements" are intervals requiring coverage, the "subsets" are available shifts (each covering a set of intervals), and the goal is to select the minimum number of shifts to cover all requirements. The greedy approach — assign the shift covering the most uncovered intervals, repeat — gives a logarithmic guarantee.

Johnson (1974) proved this greedy ratio is essentially the best possible for set cover unless P = NP (a (1ϵ)lnn inapproximability result).

LP Relaxation and Rounding

Many scheduling problems are naturally formulated as integer linear programs (ILPs). The LP relaxation drops the integrality constraint, replacing xi{0,1} with 0xi1. The LP optimal value provides a lower bound on the ILP optimal value (for minimization).

Rounding techniques convert the fractional LP solution to an integer solution:

Deterministic rounding: Round variables above a threshold to 1, others to 0. For vertex cover, rounding at threshold 0.5 yields a 2-approximation.

Randomized rounding: Set xi=1 with probability equal to the LP value xi*. For set cover, randomized rounding with repetition achieves an O(lnn) ratio matching the greedy guarantee.

Iterative rounding: Solve the LP, fix variables that are integral, re-solve on the remaining variables. Jain's iterative rounding gives a 2-approximation for the survivable network design problem and related scheduling variants.

In WFM shift assignment: solve the LP relaxation (which may assign "0.3 of shift A" and "0.7 of shift B"), then use rounding to obtain an integer assignment. The LP relaxation gap — the difference between LP and ILP optimal values — determines how well rounding can perform.

Polynomial-Time Approximation Schemes (PTAS)

A PTAS is a family of algorithms parameterized by ϵ>0 such that for any ϵ, the algorithm runs in polynomial time and achieves a (1+ϵ)-approximation. In principle, you can get arbitrarily close to optimal — but the running time grows as ϵ shrinks.

For scheduling on identical parallel machines (minimizing makespan), there exists a PTAS. The running time is O(nf(1/ϵ)) — polynomial in n for fixed ϵ, but the exponent depends on the desired accuracy. For ϵ=0.05 (5% from optimal), the algorithm is practical. For ϵ=0.001, it may not be.

An FPTAS (fully polynomial-time approximation scheme) has running time polynomial in both n and 1/ϵ. The knapsack problem admits an FPTAS, relevant to scheduling scenarios where agents have capacity constraints.

Competitive Analysis for Online Problems

When decisions must be made before all information is available (the online setting — see Online Optimization and Real-Time Decisions), competitive analysis measures the worst-case ratio between the online algorithm's cost and the optimal offline solution (which has perfect foresight):

Competitive ratio=maxIALGonline(I)OPToffline(I)

This is the online analogue of the approximation ratio.

WFM Applications

When "Good Enough" Beats "Optimal"

Consider three scenarios where approximate solutions dominate:

Real-time re-optimization: An intraday optimizer re-runs every 15 minutes to adjust agent-to-queue assignments based on current conditions. An exact solver might need 20 minutes — the solution is stale before it's implemented. A greedy algorithm with a 1.15 approximation ratio solves in 3 seconds, and the result is applied while still relevant.

Large-scale weekly scheduling: A 5,000-agent multi-site operation with complex shift rules generates an ILP with millions of variables. The exact solver reaches the time limit (2 hours) with a 3% optimality gap. A problem-specific heuristic achieves a 4% gap in 10 minutes. The extra hour and 50 minutes could be spent on what-if scenarios, sensitivity analysis, or schedule refinement — more operationally valuable than closing a 1% gap.

Iterative planning: During the bidding process, schedulers want to test dozens of constraint configurations. Waiting 30 minutes per run means testing 4 configurations per day. An approximation algorithm that runs in 2 minutes enables 30+ configurations — the exploration value exceeds the per-run quality sacrifice.

Greedy Shift Assignment

The greedy set-cover algorithm maps directly to a WFM problem:

  1. Sort available shifts by the number of uncovered intervals they cover (most to least)
  2. Assign the shift covering the most uncovered intervals
  3. Update coverage counts
  4. Repeat until all intervals are covered (or no further improvement possible)

This greedy approach has an O(lnn) approximation guarantee. For a 96-interval day, ln964.6 — the greedy solution uses at most 4.6× the minimum number of shifts. In practice, the ratio is far better (typically 1.1–1.3) because real WFM instances have structure that adversarial worst-case instances lack.

LP Relaxation for Multi-Skill Scheduling

Multi-skill scheduling — assigning agents with heterogeneous skill sets to queues across time intervals — is particularly hard (NP-hard with skill constraints). LP relaxation and rounding provides a practical approach:

  1. Formulate the ILP: xijk=1 if agent i is assigned to queue j in interval k
  2. Solve the LP relaxation (fractional assignments)
  3. Use randomized rounding with skill-feasibility constraints
  4. Repair any constraint violations with a local search

The LP lower bound tells you exactly how far your rounded solution is from optimal. If the gap is 2%, you know no algorithm — however sophisticated — can improve by more than 2%.

Worked Example

Problem: A center with 15 distinct shift types must cover 48 half-hour intervals. Minimum staffing ranges from 12 to 45 agents per interval. The ILP has 720 binary variables and 48 coverage constraints plus labor law constraints.

Approach comparison:

Method Solution (FTE) Time Gap to LP lower bound
LP relaxation lower bound 127.3 (fractional) 0.1s
Greedy set cover 141 0.3s 10.8%
LP relaxation + rounding 134 0.8s 5.3%
ILP solver (10s limit) 131 10.0s 2.9%
ILP solver (5 min limit) 130 5:00 2.1%
ILP solver (1 hr limit) 129 1:00:00 1.3%

The quality-time trade-off is clear: the first 10 seconds capture 97% of the possible improvement. The remaining 3% requires 360× more computation time. For a daily re-optimization, 10 seconds is the right budget. For annual bid schedule generation, the extra hour may be justified.

The LP lower bound of 127.3 is critical: it proves that no algorithm can find a solution below 128 FTE (since FTE must be integer). The 129-FTE solution is at most 1 FTE from optimal — further optimization effort is provably wasted.

Quality-Time Trade-Off Curves

The relationship between computation time and solution quality follows a characteristic pattern:

  1. Rapid initial improvement (0–10 seconds): LP relaxation, greedy, or first feasible ILP solution
  2. Diminishing returns (10 seconds – 10 minutes): Branch-and-bound prunes the search tree; each improvement is smaller
  3. Asymptotic tail (10 minutes – hours): Closing the final 1-2% gap requires exhaustive search of near-optimal solutions

Plotting this curve for your specific problem class is one of the most valuable exercises a WFM analytics team can perform. It answers the question: "how long should we let the optimizer run?"

Maturity Model Position

Level Description
Level 1 (Manual) No optimizer; schedules built by hand or simple rules
Level 2 (Developing) Solver used but time limits set arbitrarily; no understanding of solution quality
Level 3 (Defined) LP relaxation gap monitored; time limits set based on quality-time trade-off analysis
Level 4 (Quantitative) Problem-specific approximation algorithms selected; formal quality guarantees understood and tracked
Level 5 (Optimizing) Algorithm portfolio: exact solvers for small problems, approximation algorithms for large/time-critical ones; automated algorithm selection based on problem characteristics

See Also

References

  • Vazirani, V.V. (2001). Approximation Algorithms. Springer.
  • Williamson, D.P. & Shmoys, D.B. (2011). The Design of Approximation Algorithms. Cambridge University Press.
  • Cormen, T.H., Leiserson, C.E., Rivest, R.L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press.
  • Garey, M.R. & Johnson, D.S. (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman.
  • Hochbaum, D.S. (1997). Approximation Algorithms for NP-Hard Problems. PWS Publishing.