scipearly-stoppingpyscipopt

force early exit in SCIP branch-and-bound


When using custom branching or node selection rules in SCIPopt, is it possible to force an immediate exit of the branch-and-bound search once a certain known solution is found? I want to say that a specific node is the solution that I want to take, and the B&B procedure should then exit immediately.

I looked at the callback return options for custom branching (https://www.scipopt.org/doc/html/BRANCH.php) and node selection. I don't see an obvious way to return an "exit now". Alternative ways I'm considering: globally fix all the variables or update the global lower bound to match my chosen solution.


Solution

  • Do you want to declare that solution to be optimal somehow? (or do you even know that it is?)

    If that is not so important then you could simply callinterruptSolve. Other options would be to set, e.g., the gaplimit to what your gap currently is after finding that solution (using setRealParam)

    Edit: So unless you can somehow prove to SCIP that your solution is indeed optimal all your possible options to do this will be somewhat hacky. At that point you might as well force the global lowerbound to match your found solution. Since I don't know how you know that your found solution is optimal I can't really help much more.