Why INTLINPROG returns non-integer?

4 Ansichten (letzte 30 Tage)
Bruno Luong
Bruno Luong am 16 Aug. 2019
Beantwortet: Stephan am 16 Aug. 2019
Why the solution of intlinprog is not integer? Few of many components returned are 0.5 despite being instructed as integer.
load intlinprogfail.mat % file attached
[x, ~, flag] = intlinprog(fdummy, intcon, [], [], Aeq, beq, lb, ub);
Returns x and tells solution is found
LP: Optimal objective value is -14.414878.
Optimal solution found.
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).
But when take a close look, some components returned are 0.5 despite being instructed as integer.
>> x(intcon==1)
ans =
1.0000
1.0000
0
1.0000
0
0.5000
1.0000
1.0000
0
1.0000
1.0000
1.0000
0.5000
0.5000
1.0000
0
0
0
0
0
1.0000
0
0
0
1.0000
0.5000
0
0
1.0000
0
1.0000
1.0000
0.5000
0
1.0000
0.5000
0
0
0
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000

Akzeptierte Antwort

Stephan
Stephan am 16 Aug. 2019
load intlinprogfail.mat % file attached
intcon = 1:45;
[x, ~, flag] = intlinprog(fdummy, intcon, [], [], Aeq, beq, lb, ub);
result:
P: Optimal objective value is -14.414878.
Cut Generation: Applied 5 strong CG cuts.
Lower bound is -14.265036.
Relative gap is 0.00%.
Optimal solution found.
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).
x
x =
1
1
0
1
1
0
1
0
0
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
1
1
0
0
1
0
1
1
1
0
1
0
0
0
0
1
1
1
1
1
1

Weitere Antworten (0)

Kategorien

Mehr zu Linear Programming and Mixed-Integer Linear Programming 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!

Translated by