Isolated a rare bug in intlinprog

1 view (last 30 days)
Tristan S
Tristan S on 26 Jan 2020
Commented: Tristan S on 27 Jan 2020
The intlinprog function returns that the attached ILP problem (with binary variables only) has no solution. However the attached solution satisfies all constraints. I looked into it extensively to try to be helpful to the Matlab developers and provide a demo script. I am assuming that it has not already been corrected in newer versions of Matlab. Kind regards!
  2 Comments
Tristan S
Tristan S on 27 Jan 2020
If someone verifies this, please let the community know! Thanks!
Step 1) Download the.mat files. Step 2) Load the problem into Matlab, using "load(uigetfile())". Step 3) Type "intlinprog(problem)" to verify that it finds that no integer solution exists. Step 4) Load the solution into memory using "load(uigetfile())". Step 5) Verify that the provided assignment has no unsatisfied constraints:
unsats1=find(problem.Aineq * assignment > problem.bineq);
unsats2=find(problem.Aeq * assignment ~= problem.beq);
unsats3=find(assignment > problem.ub);
unsats4=find(assignment < problem.lb);
unsats5=find(assignment ~= round(assignment));
if isempty([unsats1 ; unsats2; unsats3; unsats4; unsats5]); disp("all are satisfied!"); end
Tristan S
Tristan S on 27 Jan 2020
A workaroud to avoid this bug in the preprocessor is to use the following, as suggested by https://www.mathworks.com/matlabcentral/answers/278307-no-solution-with-intlinprog#answer_217424 :
problem.options = optimoptions('intlinprog','IntegerPreprocess','none');

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!