Q to ChatGPT5: How hard is elevator control software algoritms for 2 lifts and 10 floors?
Short answer: for a small mid-rise (2 cars, 10 floors), a competent engineer can build a good dispatcher with standard heuristics; building a provably optimal or generally state-of-the-art controller is a hard stochastic control problem that researchers still publish on.
Why it’s (surprisingly) hard
- It’s a stochastic, multi-objective, multi-agent control problem. Arrivals vary by time (up-peak, lunch, down-peak), goals conflict (waiting time vs. ride time vs. energy), and decisions are coupled across cars. Classic work in RL framed elevator dispatching as a partially observable, nonstationary decision process.
- Combinatorics explode. Even for 2×10: positions (10²), directions (3²), door states (2²), hall-call lamps (18 buttons → 2¹⁸), in-car buttons (2×10 → 2²⁰). Multiplying these gives ~9.9×10¹⁴ distinct (coarse) states – before modelling loads or travel times.
- “Obvious” rules interact badly. Simple “nearest car” or even ETA-only dispatch can cause bunching and unfairness without extra logic (zoning, penalties, lookahead). 
What’s usually done (and good enough for 2×10)
- Collective control with ETA cost (a.k.a. “nearest/soonest car with smarts”): Assign each new hall call to the car that minimizes a cost like
\(J = w_{wait} \times \Delta(estimated\ wait) + w_{incar} \times \Delta(stops\ added) + w_{dir} \times (direction\ mismatch) + w_{load} \times (load\ factor)\)
with small lookahead (simulate inserting the stop in each car’s queue). This, plus anti-bunching (small penalty if cars are within N floors) and simple peak-mode switches, yields robust performance in a small building. 2. Lightweight zoning/sectoring during peaks (e.g., car A favors floors 1–5, car B favors 6–10, but either can “steal” if much better). Helps fairness and reduces ping-ponging. 3. Destination control (DCS) (passengers key in floor before boarding) is often overkill for 2×10 but useful when traffic is bursty; it batches similar destinations and avoids unnecessary stops. Beware “reverse journeys” edge cases and good UI. 
How “optimal” gets hard
- Exact optimal control is intractable in practice due to the state/action explosion and uncertain arrivals. Research uses simulation optimization, multi-objective/metaheuristics, and RL to beat hand-tuned heuristics—mostly on larger groups (e.g., 4+ cars, 15–40 floors).
- Destination-dispatch assignment itself is a nontrivial combinatorial routing/assignment problem with time-dependent costs and constraints.
A practical recipe for 2 lifts × 10 floors
- Traffic modes: up-peak, inter-floor, down-peak, off-peak; switch weights (w_wait, w_incar, w_dir) by mode (time-of-day + simple real-time triggers). 
- Costed ETA assignment with 1–2 stop lookahead, door-open/close timing and jerk-limited motion model.
- Anti-bunching & parking: mild penalties when cars are close; when idle, park cars at strategic “home” floors (e.g., 3 and 8).
- Fairness: cap maximum predicted wait; if exceeded, allow “stealing” across zones.
- Diagnostics: log predicted vs. actual waits/ride times to tune weights.
- (Optional) DCS kiosk prototype for peak-hour batching if your building can accept it.
If you want to go beyond heuristics
- Reinforcement learning: Crites & Barto showed RL can beat strong heuristics in simulation; modern variants continue to appear (but require careful state design and simulators).
- Multi-objective optimization: explicitly balance average/percentile wait, ride time, and energy; evolutionary/submodular approaches exist.
Primary sources to start from
- Crites, R.H., & Barto, A.G. “Improving Elevator Performance Using Reinforcement Learning.” NeurIPS (1995/1996). Seminal RL treatment; clear statement of elevator-control challenges. 
- Fernández, J.R., & Cortés, P. “A Survey of Elevator Group Control Systems for Vertical Transportation.” IEEE Control Systems Magazine 35(4), 2015. Authoritative survey of heuristics and advanced methods. 
- Koehler, J., & Ottiger, D. “An AI-Based Approach to Destination Control in Elevators.” AI Magazine 23(3), 2002. Classic DCS ideas and batching rationale. 
- Ruokokoski, M., et al. “Assignment formulation for the Elevator Dispatching Problem in destination controls.” European Journal of Operational Research (2016). Formal assignment formulations. 
- Peters Research note on dispatching heuristics (nearest car, ETA, bunching) — concise practitioner overview. 
Bottom line: For 2 cars and 10 floors, you can get very good service with a well-tuned ETA-based heuristic plus a dash of zoning and anti-bunching. The difficulty ramps up quickly if you chase theoretical optimality, add destination dispatch, or require strong guarantees across all traffic regimes – which is why it remains an active research area.