Hi there

I want to be able to halt the branch-and-bound MIP optimizer as soon as I get a solution that I deem to be good enough. More specifically, I want to be able to specify a particular target cost (objective function value) such that when an integer solution is found that has a better cost than this, the algorithm halts immediately.

Write now I'm using the following:

setparam("XPRS_MIPABSSTOP",1000)

However, the 1000 here relates to the *gap* between the best bound determined by the algorithm and the best solution found so far. What if I don't care about the best bound, and just want to halt when my best solution is better than some pre-defined target cost?

Cheers

Rhyd Lewis

I have sorted this issue now by adding the following procedure, which halts the algorithm (and returns a solution) when an integer solution is found with an objective cost of less than a target cost.

procedure haltrun

declarations

objval:real

target:real

end-declarations

target := 8500

objval := getparam("XPRS_lpobjval")

writeln("Best integer solution so far = ",objval,". Target = ",target)

if objval <= target then

stopoptimize(1)

writeln("Found solution that is good enough")

end-if

end-procedure

In my code, before the line

minimise(objfn)

I then call the following

setcallback(XPRS_CB_INTSOL,"haltrun")

Thanks to Chris Oakley for his help