Solver Parameter Tuning (cpmpy.tools.tune_solver)

This file implements parameter tuning for constraint solvers based on SMBO and using adaptive capping. Based on the following paper: Ignace Bleukx, Senne Berden, Lize Coenen, Nicholas Decleyre, Tias Guns (2022). Model-Based Algorithm Configuration with Adaptive Capping and Prior Distributions. In: Schaus, P. (eds) Integration of Constraint Programming, Artificial Intelligence, and Operations Research. CPAIOR 2022. Lecture Notes in Computer Science, vol 13292. Springer, Cham. https://doi.org/10.1007/978-3-031-08011-1_6

This code currently only implements the author’s ‘Hamming’ surrogate function. The parameter tuner iteratively finds better hyperparameters close to the current best configuration during the search. Searching and time-out start at the default configuration for a solver (if available in the solver class)

class cpmpy.tools.tune_solver.GridSearchTuner(solvername, model, all_params=None, defaults=None)[source]
tune(time_limit=None, max_tries=None, fix_params={})[source]
Parameters:
  • time_limit – Time budget to run tuner in seconds. Solver will be interrupted when time budget is exceeded

  • max_tries – Maximum number of configurations to test

  • fix_params – Non-default parameters to run solvers with.

class cpmpy.tools.tune_solver.ParameterTuner(solvername, model, all_params=None, defaults=None)[source]

Parameter tuner based on DeCaprio method [ref_to_decaprio]

tune(time_limit=None, max_tries=None, fix_params={})[source]
Parameters:
  • time_limit – Time budget to run tuner in seconds. Solver will be interrupted when time budget is exceeded

  • max_tries – Maximum number of configurations to test

  • fix_params – Non-default parameters to run solvers with.