Search code examples
scip

Get the Objective function value in SCIP


I am solving an Integer program model with SCIP and I need to store the objective function value. I was wondering how I can get the objective function value after solving the IP model? can someone help me?


Solution

  • You can use SCIPgetPrimalbound() to get the best solution value.

    Also, in the interactive shell the column "primalbound" will show the current best solution value and after the optimization process stops the primlalbound is also stated. (Note, you might want to check whether a solution was found.)

    If your problem is infeasible it 10^20 (SCIPs infinity value) is printed.

    (If you want to see the objective function value and the solution values of each variable, you can enter display solution in the interactive shell, which will show all non-zeros solution values and the objective function value.)

    See also http://scip.zib.de/doc/html/SHELL.php .