Solver stopped prematurely. No integer feasible point found
Show older comments
Solver stopped prematurely. No integer feasible point found (exitflag=0)
Problem description: There are value ranges of N units respectively, and their sum is required to be fixed, and the value of unit should be 0 as far as possible. Where, the sum of the units is the input value of the function, and the value ranges are the operation result of the previous code. The integer variable is the state variable of whether the unit has a value of 0.
Using intlinprog function: Put it into the optimization algorithm, there will be problems (Solver stopped prematurely. No integer feasible point found) if the number of iterations is too long. But it worked fine again when I ran only the outermost part of the code that reported the error. In theory, integer variables can all be 1 or 0, and that situation (No integer feasible point found) won't happen. So i don't kown why?
Code (MATLAB R2020a): n=9
f=[0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1];%objective
aeq=[1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0];
beq= -1.1918e+03;%change
A=[-1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0 0 0;1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0 0 0;0 -1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0 0;0 0 -1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0 0;0 0 0 -1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0 0 0 8000 0 0 0 0 0;0 0 0 0 -1 0 0 0 0 0 0 0 0 8000 0 0 0 0;0 0 0 0 1 0 0 0 0 0 0 0 0 8000 0 0 0 0;0 0 0 0 0 -1 0 0 0 0 0 0 0 0 8000 0 0 0;0 0 0 0 0 1 0 0 0 0 0 0 0 0 8000 0 0 0;0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 8000 0 0;0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8000 0 0;0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 8000 0;0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8000 0;0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 8000;0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8000];
B=[8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000];
intcon=[10 11 12 13 14 15 16 17 18];
lp=[-108.1824 -274.4183 -336.4196 -124.7959 -74.1171 -45.8906 -307.1947 -307.1947 -293.3694 0 0 0 0 0 0 0 0 0];%number1-9 change
up=[3.7743 0 0 -15.7397 34.9391 63.1656 0 0 13.8253 1 1 1 1 1 1 1 1 1];%number1-9 change
options = optimoptions('intlinprog','Display','off');
[jz1,fval,exitflag,output]=intlinprog(-f,intcon,A,B,aeq,beq,lp,up,options);
Answers (1)
I get the following solution
0.
- 159.2453
0.
- 124.7959
0.
0.
- 307.1947
- 307.1947
- 293.3694
1.
0.
1.
0.
1.
1.
0.
0.
0.
with a value of -4 (since you maximize f, +4) of the objective function.
9 Comments
梦娇 何
on 1 Jun 2022
梦娇 何
on 1 Jun 2022
Torsten
on 1 Jun 2022
why did i get another solution ?
Solutions can be different - as long as "fval" is the same.
Torsten, does this code have an optimal solution as long as beq is within the total range of all units?
I don't know what you mean.
梦娇 何
on 1 Jun 2022
Torsten
on 1 Jun 2022
What would cause mixed linear prgraming solver stopped prematuely and no interge feasible point found (exitFlag =0)?
If intlinprog does not find an integer point for which your constraints are satisfied.
when appling "intlinprog", "beq" always in the interval [sum(lp(1:9)), sum(up(1:9))]. It is guaranteed by other code. In this situations, will the mixed linear prgraming report an error especially "exitflag=0" ?
I can't imagine that this can happen as long as lp and ub permit -8000 <= x(i) <= 8000 for 1 <= i <= 9.
梦娇 何
on 1 Jun 2022
梦娇 何
on 1 Jun 2022
Torsten
on 1 Jun 2022
Up to now, you didn't show a setup for which intlinprog failed.
So just post the case and I'll try to find out the reason.
梦娇 何
on 15 Jul 2022
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!