0

How can I exit intlinprog at the "Branch and Bound" stage when fval and/or the relative gap no longer improve? I have tried numerous options but so far without success. For the example below, I know the optimal value is 6834. How do I implement an early stop if, for example, there was no improvement in five consecutive steps?

 nodes     | total    | num int   | integer      | relative 
 explored  | time (s) | solution  | fval         | gap (%)

   4980       33.87        13       6.843000e+03   1.256575e+00
  54403      295.20        14       6.834000e+03   1.126554e+00
  64403      347.04        14       6.834000e+03   1.126554e+00
  74403      398.97        14       6.834000e+03   1.126554e+00
  84403      452.28        14       6.834000e+03   1.126554e+00
  94403      503.83        14       6.834000e+03   1.126554e+00
 104403      557.71        14       6.834000e+03   1.126554e+00
Shawn
  • 47,241
  • 3
  • 26
  • 60
painfulenglish
  • 161
  • 1
  • 7
  • 1
    The *improvement* alone (absolute fval) has little meaning (on what's possible in future iterations). If you know the lower bound, why don't you add a bounding-constraint or use param `ObjectiveCutOff`? Maybe also consider the most simple approach: use a time-limit (`MaxTime`). Also keep in mind, that *steps* can mean a lot of very different things. Your output looks like 7 steps (in terms of verbosity), but also >104403 steps in terms of visited nodes. – sascha Aug 11 '18 at 19:52
  • Thanks. Of course, the lower bound is not known beforehand in general. This was for a simple test case. I understand all those restrictions. Limiting the time is a simple way out, but at least for the present case, the final answer is reached a long time before the code exits by itself. – painfulenglish Aug 11 '18 at 20:09
  • `Intlinprog` can call a callback function which can tell it to stop or continue. See [link](https://www.mathworks.com/help/optim/ug/intlinprog-output-functions-and-plot-functions.html). I have never used it, but it may be useful for what you want to do. – Erwin Kalvelagen Aug 14 '18 at 06:42

1 Answers1

0

the convergence of this algorithm does not depend only on function value in each iteration, you can increase the function value tolerance in options or try scaling the problem.