pythonscipbranch-and-bound

Stop Branch-and-Price tree and return gap


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 it to return the gap between the input and the optimal value?

EDIT: I asked the problem on the beta site Operation Research and was recommend to post it on stack overflow:

https://or.stackexchange.com/questions/4015/branch-and-price-return-gap-using-scip

EDIT EDIT: I found a function SCIPgetGap which return:

(primal bound - dual bound)/min{primal bound, dual bound}

But I'm Interested in the dual gap:

(best bound - best solution)/best bound

how do I get the dual gap in SCIP?


Solution

  • Sorry for the late answer. You can easily compute this yourself: SCIPgetDualbound will return you the best (global) dual bound, and SCPgetPrimalbound will give you the best primal bound.