Setting Solver Options for the Scip Solver in pyomo for MINLP Problem

134 views Asked by At

I am sorry if this question has been handled before but I have a problem implementing solver options for the Scip solver. I am modelling a MINLP problem using the Scip solver for the MI part and ipopt for the NLP part. My problem is that solving the model the kernel freezes after a certain amount of iterations. I suspect the solver to be the problem, because it sometimes gets stuck when I look at the output with tee=True, the solver exceeds the limits I set before.

Please tell me, if I am mistaken with my formulation, I am a total beginner. I use pyomo via anaconda, I get the problem in different environment, e.g. Colab and jupyter notebook

Thanks, Michael

I try to cap the amount of iterations and the amount of time the solver takes with the following code, but it doesn#t seem to work:

solver = SolverFactory('scip', nlp_solver='ipopt')
solver = SolverFactory('scip')
solver.options['max_time'] = 30
solver.options['max_iter'] = 100
1

There are 1 answers

1
Vladimir VV On

I have the same question ... unfortunately an open still.

Possible workaround is to write all parameters into scip.set file and to put it into the folder where your python run the code. By default SCIP reads scip.set if it exists in the current folder...

And one more recommendation: use with operator:

with pyo.SolverFactory(path2scip + "scip") as opt:
   results = opt.solve(myPyomoModel, load_solutions=True, tee=True)