A hospital or university with several specialized labs faces a scheduling headache that looks simple until you try to solve it: bookings must avoid double-booking rooms, avoid double-booking people, and — critically — avoid spreading the limited technical staff for a given type of lab across multiple departments at the same time. A worked example from AMPL's model library, solved with the open-source HiGHS solver, shows how to handle this cleanly by treating it as two objectives with a strict priority order rather than one blended score.

The setup: a set of researchers submit requests, each naming a person and the lab types they need in a single sitting. Departments each host one lab of each type, and time is split into discrete slots. The rules are intuitive — every request gets scheduled exactly once, a department handles one request per slot, and no person can be double-booked even across departments — but the twist is a staffing constraint: because each lab type has a limited pool of trained staff, running the same lab type simultaneously in two departments is allowed only when there's no better alternative.

That staffing rule is what turns a straightforward assignment problem into a genuine multi-objective one. The model wants to minimize how often a lab type gets used in parallel across departments, but it also wants to finish scheduling everyone as early as possible, and those two goals can pull in different directions. Rather than combine them into a single weighted cost function — which forces an analyst to guess an exchange rate between 'extra lab usage' and 'extra delay' — the model keeps them separate and ranks them.

The core decision variable is a binary $x_{t,s,r}$ equal to 1 if request $r$ is assigned to department $s$ at time $t$. Three constraints do the basic bookkeeping: every request is assigned exactly once, $\sum_{t,s} x_{t,s,r} = 1$ for each request $r$; each department handles at most one request per slot, $\sum_r x_{t,s,r} \le 1$ for every $(t,s)$; and each person is assigned to at most one department per slot, summing $x_{t,s,r}$ over all requests $r$ sharing that person's name.

The staffing penalty is where the model gets interesting mathematically. Usage of lab $c$ at time $t$ is counted as $y_{t,c} = \sum_{s,r:\, c \in \text{labs}(r)} x_{t,s,r}$, and the objective wants to penalize any slot where a lab type is used more than once: $$\text{Penalty\_Usage} = \sum_{t,c} \big(\text{if } y_{t,c} \le 1 \text{ then } 0 \text{ else } 1\big).$$ That conditional expression is not linear as written, but AMPL's MP interface automatically reformulates it into linear constraints behind the scenes before handing the problem to HiGHS — sparing the modeler from writing the big-M logic by hand. The second objective, $\text{Penalty\_Time} = \sum_{t,s,r} t \cdot x_{t,s,r}$, simply rewards scheduling requests earlier rather than later.

Instead of merging these into one cost function, the model declares them as two separate objectives and assigns each an objpriority suffix — 10 for Penalty_Usage, 1 for Penalty_Time — telling HiGHS's multi-objective mode (obj:multi=2) to solve them lexicographically: fully optimize the higher-priority objective first, then optimize the second objective without letting it degrade the first. On the twelve-slot, three-department example in the notebook, that ordering produced a schedule with only 6 instances of parallel same-type lab usage; when the priorities were flipped to chase the fewest timeslots instead, HiGHS found a 7-slot schedule but at the cost of 8 parallel-usage penalties — a concrete demonstration that the two goals genuinely trade off against each other.

This is a small illustrative instance — twenty-odd requests across three departments — but the pattern scales to real staffing and room-booking problems in hospitals, universities, and shared research facilities, where the actual bottleneck is often specialized personnel rather than physical space. The broader lesson for practitioners is about how to express priorities honestly: many scheduling problems have a goal that must not be compromised (safety, staffing limits, regulatory constraints) and a secondary goal that's merely nice to optimize (speed, cost, convenience). Lexicographic multi-objective optimization, as implemented here through solver-level objective priorities rather than penalty weights bolted onto a single objective, lets a modeler state that hierarchy directly instead of tuning weights by trial and error.

The mechanism itself — AMPL's objpriority suffix combined with a solver's native multi-objective mode — isn't unique to this lab-scheduling example; the same pattern appears in AMPL's multi-objective knapsack notebook and rests on well-established theory for lexicographically ordered ('priority chain') multi-objective problems. What the lab scheduling example adds is a believable operational story: it shows a modeler translating a fuzzy real-world instruction ('don't split staff across departments unless you truly have to') into a hard first-priority objective, then layering timeliness on top — a template worth reaching for whenever one constraint in a scheduling problem is genuinely non-negotiable and another is just preferred.

Sources: AMPL Colaboratory, 'Labs scheduling', https://ampl.com/colab/notebooks/labs-scheduling.html · AMPL MP Documentation, 'Multiple objectives', https://mp.ampl.com/modeling-mo.html · AMPL Colaboratory, 'Multi-Objective Knapsack Problem with AMPLPY', https://colab.ampl.com/notebooks/multi-objective-knapsack-problem-with-amplpy.html · HiGHS - High-performance parallel linear optimization software, https://highs.dev/ · 'HiGHS optimization solver', Wikipedia, https://en.wikipedia.org/wiki/HiGHS_optimization_solver · 'Optimal Scheduling for Laboratory Automation of Life Science Experiments with Time Constraints', PMC, https://pmc.ncbi.nlm.nih.gov/articles/PMC8641030/ · 'Solving mixed Pareto-Lexicographic multi-objective optimization problems: The case of priority chains', ScienceDirect, https://sciencedirect.com/science/article/pii/S2210650219303086