Solver stopped prematurely. No integer feasible point found
3 ビュー (過去 30 日間)
古いコメントを表示
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);
0 件のコメント
回答 (1 件)
Torsten
2022 年 5 月 31 日
編集済み: Torsten
2022 年 5 月 31 日
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 件のコメント
Torsten
2022 年 6 月 1 日
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.
参考
カテゴリ
Help Center および File Exchange で Linear Programming and Mixed-Integer Linear Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!