Intlinprog stopped at the root node because the objective value is within a gap tolerance of the optimal value, options.Ab​soluteGapT​olerance = 0 (the default value). The intcon variables are integer within tolerance, options.IntegerTolerance = 1e-05

29 次查看(过去 30 天)
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.

回答(1 个)

nathan welch
nathan welch 2020-3-6
编辑:nathan welch 2020-3-6
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.

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by