# Branch-and-Price: return gap using SCIP

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

• 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. Apr 29 '20 at 22:14
• 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. ;) Apr 30 '20 at 0:17
• Thank you for your answers. I'll try post it on Stack Overflow. I can't return the gap. Apr 30 '20 at 11:41

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