I implemented a branch-and-price tree in python.

I would like to stop the process after 5 hours and return the gap in % between the best integer solution found so far and the optimal solution.

How do I give a value to SCIP and ask how far in % is that from the optimal value?

EDIT: To those interested the question can now be found on: https://stackoverflow.com/questions/61522580/stop-branch-and-price-tree-and-return-gap

  • 2
    $\begingroup$ welcome! with SCIP specific questions you may be better off with the SCIP mailing list or on stack overflow under #SCIP tag. SCIP returns a dual and a primal bound, and even the gap in percent in the output, let me understand why this is not sufficient. $\endgroup$ Apr 29, 2020 at 22:14
  • 3
    $\begingroup$ To piggyback off of what @MarcoLübbecke said, questions about specific solvers are in scope here (see this post). It's possible you'll have more luck getting an answer on the platforms that Marco suggested, but I hope you get an answer here. ;) $\endgroup$ Apr 30, 2020 at 0:17
  • $\begingroup$ Thank you for your answers. I'll try post it on Stack Overflow. I can't return the gap. $\endgroup$ Apr 30, 2020 at 11:41

1 Answer 1


Accepted answer from the cross-post: Stop Branch-and-Price tree and return gap

You can easily compute this yourself: SCIPgetDualbound will return you the best (global) dual bound, and SCPgetPrimalbound will give you the best primal bound. -Leon

Will delete this CW if Leon posts answer here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.