Intlinprog stopped at the root node because the objective value is within a gap tolerance of the optimal value, options.AbsoluteGapTolerance = 0 (the default value). The intcon variables are integer within tolerance, options.IntegerTolerance = 1e-05
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I'm trying to solve a integer program, and I'm getting this error:
Intlinprog stopped at the root node because the objective value is within a gap tolerance of the optimal value, options.AbsoluteGapTolerance = 0 (the default value). The intcon
variables are integer within tolerance, options.IntegerTolerance = 1e-05 (the default value).
y =
1.0e+04 *
0.3000
0
0.7000
0.3000
1.0000
0.5000
The actual answer to this solution is 3000,0,7000,3000,10000,5000. But I'm getting it in 10^-4 form. I'm not able to rectify it. Please help me.
0 Kommentare
Antworten (1)
nathan welch
am 6 Mär. 2020
Bearbeitet: nathan welch
am 6 Mär. 2020
So it appears Intlinprog has found your solution, so it's not really an error. It's just telling you that it's done the best job it can with the tolerances it's got.
The result it displays is just in a form that looks different - probably because they are not exactly integers.
You have two choices:
The simple way, use y = round(y). This will set the values in y to be the nearest integer value, as you've solved it to within 1e-05 this should work well.
The difficult way, you can set options.IntegerTolerance = 1e-12 or even smaller to force Intlinprog to keep solving until it finds the exact integer solution but there's no guarantee that this will work and will depend on the problem - it may just cause it to keep running for a very long time or hit the iteration limit.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!