scipopt / PySCIPOpt

Python interface for the SCIP Optimization Suite
https://pyscipopt.readthedocs.io/en/latest/
MIT License
817 stars 254 forks source link

sourceModel loses parameters and is usually slower than original model #923

Open Joao-Dionisio opened 2 weeks ago

Joao-Dionisio commented 2 weeks ago

Reported in #918.

new_scip = Model(sourceModel=orig_scip) loses 226 parameters including dual presolvers, some heuristics. Solving new_scip is usually slow than solving orig_scip with same random seed. The new copy function can full copy orig_scip problem except solution storage.

Also need to find out why it loses some of the original model's parameters.

DominikKamp commented 2 weeks ago

Actually, SCIPcopy() does not produce a SCIP clone but is only guaranteed to hold an equivalent model if valid, since some plugins just do not implement the copy callback (I believe some of them by accident since the callback is non-fundamental), so the cause lies in SCIP.

Joao-Dionisio commented 2 weeks ago

In your opinion as the Issue master, should I create an issue on the gitlab, Dominik? :)

DominikKamp commented 2 weeks ago

This would be nice. Then we can try to add the copy callbacks and see what happens (as the issue indicates, this might affect performance of subscips). For example the benders parameters get lost as the documentation of SCIPcopyPlugins() notes that SCIPcopyBenders() must be called separately if desired.