0

I am using the CBC solver with Pyomo and I have been not been able to get an integer solution within the specified time limit when solving a particular model.

Is there an option to pass to CBC that can relax the integrality requirements? I notice that CBC has a huge number of options, but I am not sure which is the one that we should use for this.

  • Ahhhhh... Why do that first? Why not increase the MIP gap? This would be increasing the `ratio` value in CBC. – AirSquid Apr 13 '22 at 02:39
  • If the model has trouble finding the first integer feasible solution, playing with the MIP gap has not much use. Maybe you can find a poor but integer feasible solution using some heuristic. Sometimes an elastic formulation can help (allow some constraints to be violated but at a cost). Or try a commercial solver. – Erwin Kalvelagen Apr 17 '22 at 11:26

1 Answers1

1

For integer feasibility you can relax such feasibility in pyomo in the cbc interface using the option integerTolerance. Default tolerance is 1E-7 in CBC:

model = pyo.ConcreteModel()
#...Your whole model
solver = pyo.SolverFactory('cbc')
solver.solve(model, tee=True, options={'integerTolerance':1E-3})

In the printed info you should se some message like:

...integerTolerance was changed from 1e-07 to 0.001
pybegginer
  • 490
  • 1
  • 4
  • 12