Hybrid Classical-Quantum Metaheuristic Framework for Scheduling Optimization
This repository implements a quantum‑enhanced hyperheuristic framework where a shallow QAOA‑based quantum operator is integrated with classical heuristics to solve identical machine scheduling problems.
The goal is not to replace classical heuristics, but to augment them with quantum search primitives and evaluate how they interact with adaptive hyperheuristic controllers.
This project demonstrates a hybrid classical-quantum metaheuristic pipeline:
- Classical scheduling heuristics
- Quantum subproblem formulation
- QAOA solution via quantum simulation
- Hybrid operator integration
- Hyperheuristic control (bandit)
- Empirical evaluation across seeds
- Integration adapter for external RL controller (Repo 1: https://github.com/Dipesh-Lc/rl-hyperheuristic )
The repository is intentionally independent of the RL system (Repo 1) but includes an adapter allowing seamless integration.
Large scheduling problems are difficult to solve globally. Instead we:
- Extract a small local subproblem
- Encode it as a QUBO
- Solve using shallow QAOA
- Convert the result back into a scheduling move
This produces a quantum‑inspired local search operator.
We consider identical machine scheduling with objective:
where
-
$p_j$ : processing time of job$j$ -
$M_i$ : set of jobs assigned to machine$i$
The goal is to minimize makespan.
At each step we identify:
- the most loaded machine
- the least loaded machine
Define load imbalance:
Select a subset of jobs
from the overloaded machine.
Binary variable:
New imbalance after move:
We minimize squared imbalance:
which expands to a QUBO:
This QUBO is solved with QAOA.
Convert QUBO to Ising Hamiltonian:
giving
QAOA ansatz:
where
Mixer Hamiltonian:
Parameters
The QAOA operator works as:
- Extract job subset
- Build QUBO
- Run shallow QAOA
- Decode best bitstring
- Apply job moves to schedule
This becomes a low‑level heuristic inside the hyperheuristic framework.
Implemented baseline heuristics:
- move_max_to_min
- two_smallest_from_max
- swap_two_jobs
These provide the classical baseline.
Two adaptive controllers are evaluated.
First steps use QAOA, then classical heuristics.
Operators treated as arms:
Selection uses UCB1:
where
-
$\bar r_a$ = average reward -
$n_a$ = number of pulls
Reward:
src/qehh
├── adapters
├── core
├── experiments
├── operators
└── quantum
Scheduling primitives.
Classical heuristics and operator registry.
QAOA pipeline:
- QUBO builder
- Ising conversion
- circuit execution
- decoding
Reproducible experiment scripts.
conda env create -f environment.yml
conda activate qehh
pip install -e .
pip install -r requirements.txt
pip install -e .
python -m qehh.experiments.run_operator_only --seed 0
Generate plots
python -m qehh.experiments.plot_results
python -m qehh.experiments.run_static_hybrid --seed 0
python -m qehh.experiments.run_hh_bandit --seed 0 --policy ucb1
python -m qehh.experiments.aggregate_operator_only
python -m qehh.experiments.aggregate_static_hybrid
python -m qehh.experiments.compare_methods
Average across 10 seeds:
| Method | Final Makespan | Steps to 1% | Runtime |
|---|---|---|---|
| move_max_to_min | 281.48 | 22.6 | 0.002s |
| two_smallest_from_max | 271.05 | 22.3 | 0.002s |
| QAOA operator | 268.05 | 6.7 | 80.7s |
| Static Hybrid | 266.43 | 8.9 | 3.65s |
| Bandit HH | 265.96 | 17.3 | ~4s |
Key findings:
- QAOA achieves fastest convergence
- Classical heuristics are efficient for refinement
- Hybrid control provides best trade‑off
The full raw experiment outputs and aggregated statistics used to produce these tables are available in the results/ directory of this repository.
Sanity check implementation:
python -m qehh.experiments.sanity_maxcut
Parameter sweep:
python -m qehh.experiments.maxcut_param_sweep
This repository provides an adapter:
qehh.adapters.repo1_operator
which exposes the QAOA operator as a standard operator for the RL controller.
Add to Repo 1 operator list:
make_repo1_qaoa_operator(k=10, reps=1, n_param_samples=16)
Then retrain RL.
pytest
Includes tests for:
- QUBO energy correctness
- schedule invariants
- decode logic
- QAOA operator smoke test
Quantum heuristics are not universally superior.
Instead they are valuable for specific search states, particularly:
- large imbalance
- early exploration phases
Hybrid metaheuristics can therefore leverage quantum operators selectively.
- RL‑driven operator selection
- Larger scheduling benchmarks
- Hardware execution on real quantum devices
- Parameter‑learning QAOA
The mathematical models and algorithms used in this project build upon established research in scheduling theory, hyper-heuristics, combinatorial optimization, and quantum optimization.
-
Pinedo, M. L.
Scheduling: Theory, Algorithms, and Systems (5th Edition).
Springer, 2016.
https://doi.org/10.1007/978-3-319-26580-3 -
Graham, R. L., Lawler, E. L., Lenstra, J. K., & Rinnooy Kan, A. H. G.
Optimization and Approximation in Deterministic Sequencing and Scheduling.
Annals of Discrete Mathematics, 1979. -
Brucker, P.
Scheduling Algorithms (5th Edition).
Springer, 2007.
-
Burke, E. K., Hyde, M., Kendall, G., Ochoa, G., Özcan, E., & Woodward, J.
A Classification of Hyper-Heuristic Approaches.
In Handbook of Metaheuristics, Springer, 2010. -
Cowling, P., Kendall, G., & Soubeiga, E.
A Hyperheuristic Approach to Scheduling a Sales Summit.
In Practice and Theory of Automated Timetabling, 2001.
-
Lucas, A.
Ising formulations of many NP problems.
Frontiers in Physics, 2014.
https://doi.org/10.3389/fphy.2014.00005 -
Glover, F., Kochenberger, G., & Du, Y.
A Tutorial on Formulating and Using QUBO Models.
arXiv:1811.11538
-
Farhi, E., Goldstone, J., & Gutmann, S.
A Quantum Approximate Optimization Algorithm.
arXiv:1411.4028 -
Hadfield, S. et al.
From the Quantum Approximate Optimization Algorithm to a Quantum Alternating Operator Ansatz.
Algorithms, 2019.
-
Preskill, J.
Quantum Computing in the NISQ era and beyond.
Quantum, 2018.
https://doi.org/10.22331/q-2018-08-06-79 -
Cerezo, M. et al.
Variational Quantum Algorithms.
Nature Reviews Physics, 2021.
-
Auer, P., Cesa-Bianchi, N., & Fischer, P.
Finite-time Analysis of the Multiarmed Bandit Problem.
Machine Learning, 2002. -
Sutton, R. S., & Barto, A. G.
Reinforcement Learning: An Introduction (2nd Edition).
MIT Press, 2018.