Extracting local primal solution at the current node #279
-
Hi, In I think you can do Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
In banch-and-bound there isn't necessarily a primal solution at every node. One may get a primal solution if the solution to the relaxation is integer feasible (not always the case). In modern solvers, primal solutions can also be obtained by running primal heuristics, but this is not done on every node, nor is it guaranteed to give a solution. |
Beta Was this translation helpful? Give feedback.
-
Hi @cwfparsonson , I think you should be able to do what you want by registering an event handler There are a few events which will get triggered when a primal solution is found (SCIP_EVENTTYPE_POORSOLFOUND, SCIP_EVENTTYPE_BESTSOLFOUND): The Pyscipopt API is pretty straightforward. See here: |
Beta Was this translation helpful? Give feedback.
Hi @cwfparsonson ,
I think you should be able to do what you want by registering an event handler
https://www.scipopt.org/doc/html/EVENT.php
There are a few events which will get triggered when a primal solution is found (SCIP_EVENTTYPE_POORSOLFOUND, SCIP_EVENTTYPE_BESTSOLFOUND):
https://www.scipopt.org/doc/html/type__event_8h.php
The Pyscipopt API is pretty straightforward. See here:
https://github.com/scipopt/PySCIPOpt/blob/master/tests/test_event.py