Mohamed Gacha Software Engineer
Back to projects

Case study

Euro-Information Code Contest

3rd of 177: deciding which AI models to train under an energy budget.

Role
Individual participant
Timeline
50 hours, 2026
Stack
  • Python
  • NumPy
  • SciPy
  • HiGHS
  • OR-Tools CP-SAT
  • SCIP
  • C
  • C++
  • Bash
of 177 participants
3rd
of competition
50 h
datasets in the largest instance
250,000
instances with different constraints
7
  1. 01LP relaxationbound and guide selection
  2. 02Interval bin packingrealize assignments
  3. 03CP-SAT · MIPexact sub-problems, repairs
  4. 04Column generationmost constrained instance
  5. 05LNS · C/C++improve, hot loops
  6. 06Distributed searchseveral machines, merge
Size of the 7 instances (datasets, linear scale)
InstanceModelsDatasets
Q1 “Example”5 models
5
Q2 “So it begins.”3,000 models
10,000
Q3 “Everything is free!”5,000 models
20,000
Q4 “Those models are demanding!”8,000 models
40,000
Q5 “Looks like there's a discount on our electricity bill.”11,000 models
100,000
Q6 “Where are the files?”15,000 models
5,000
Q7 “We're in the endgame now.”50,000 models
250,000

The problem

A data centre must train AI models without exceeding an energy cap. Each model has a value, an energy cost and data requirements per type (numerical, text, image, code), each within a range: below it the model is under-trained, above it energy is wasted.

Each dataset can feed only one model. Using copyrighted data, or data generated by another model, halves the value. A single-requirement model can act as a generator, but a model fed that way cannot feed another.

Seven instances, from 5 models up to 50,000 models and 250,000 datasets. Ranking compares each solution to the best one.

Approach

  • LP relaxation over each model's “modes” (clean, degraded, generator) to bound the optimum and guide selection.
  • Realization through interval bin packing: fill each requirement with dataset sizes inside its range.
  • Exact sub-problems and repairs with CP-SAT (OR-Tools) and MIP (HiGHS, SCIP).
  • Column generation with exact dynamic-programming pricing on the most constrained instance.
  • Large neighbourhood search (LNS) to improve solutions, with hot loops in C and C++.
  • Distributed search: several machines running in parallel, with scripts syncing and merging the best solutions.

Result

3rd of 177 participants. Thanks to Euro-Information for organising it.