Solve PuLP problems: solver with logs#

To use one of the described component here, you can import them from khloraascaf.ilp.

Constants#

SOLVER_LOG_PREFIX = 'solver'#

Prefix of the solver log file name.

LOG_EXT = 'log'#

Extension of the solver log file.

Functions#

solve_pulp_problem(prob, solver, log_path=None)#

Instanciate and solve the PuLP model.

Parameters:
  • prob (LpProblem) – PuLP problem

  • solver (str) – MILP solver to use (‘cbc’ or ‘gurobi’)

  • log_path (Path, optional) – Solver log file path, by default None

Raises:

WrongSolverName – The solver name is not correct

fmt_solver_log_name(solver, instance_name, ilp_combination)#

Format solver log file name.

Parameters:
  • solver (str) – Solver name

  • instance_name (str) – Instance name

  • ilp_combination (iterable of RegionIDT) – ILP string code combination

Returns:

Formatted filename

Return type:

str