How to force intlinprog to give integer solution ?
显示 更早的评论
The following command
x=intlinprog([0; 0; 0],[1 2 3],-[0 2 0;0 1 2;3 1 0],-[6;13;11],[],[],[0;0;0],[])
produced x=[2.6667 3 5]' which is not integer.
回答(2 个)
I think it's a bug. If your goal is simply to find some feasible solution to the constraints, I think you can workaround the bug with any nonzero f vector, e.g.,
>> x=intlinprog([1e-10,0,0],[1 2 3],-[0 2 0;0 1 2;3 1 0],-[6;13;11],[],[],[0;0;0],[]);
x =
0
11
1
3 个评论
Jan
2015-11-7
编辑:Walter Roberson
2015-11-7
Walter Roberson
2015-11-7
What is the exitflag being returned? You do not appear to be recording the exitflag so you do not know what the output represents.
Jan
2015-11-8
编辑:Walter Roberson
2015-11-8
Alan Weiss
2015-11-9
编辑:Alan Weiss
2015-11-9
0 个投票
I think that this must be a bug in your Optimization Toolbox™ version. Please report the issue to technical support. There might be a workaround.
Alan Weiss
MATLAB mathematical toolbox documentation
类别
在 帮助中心 和 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!