intlinprog returns non-optimal solution. Can you help me finding the problem?

조회 수: 1 (최근 30일)
I have large constraint Matrix A,b, Aeq, beq. I select an easy case where I know the solution for x (and negative cost) and I can prove true:
logical(A*x_example <= b)
logical(Aeq*x_example == beq)
logical(x_example >= lb )
logical(x_example <= ub)
But intlinprog returns a result with zero cost.
options = optimoptions('intlinprog','Display','final');
[x_sol,fval,eflag,output] = intlinprog(-f,1:length(f),A,b,Aeq,beq,lb,ub,options);
This is a my cost (positiv real) function f =
(1,1) 0.2300
(3,1) 0.1069
(4,1) 0.2700
(5,1) 0.0400
(6,1) 0.1100
(8,1) 4.0000
(15,1) 0.2300
(19,1) 4.0000
%...
(106,1) 0.2300
(108,1) 0.1069
(109,1) 0.2700
(110,1) 0.0400
(111,1) 0.1100
(113,1) 4.0000
(120,1) 0.2300
(124,1) 4.0000

답변 (1개)

Frederik Hesselmann
Frederik Hesselmann 2018년 2월 21일
편집: Frederik Hesselmann 2018년 2월 21일
I found two Problems.
the function 'logical()' doesnt care about whether x is integer or not. The solution I have suggested is not integer. This is the reason why my test using 'logical()' wasnt correct. Checking 'isinteger(x)' is also necessary.
Though this doesnt explain why my result is wrong using 'intlinprog' but I know now that I have to look in the constraints. I found indeed that due to cutting of digits some equalities are violated. Using boundary solves the problem.
  댓글 수: 1
Nicola Blasuttigh
Nicola Blasuttigh 2021년 12월 1일
Hi man, sorry but probably I have the same problem about cutting digits. How do you solve it? What do you mean with boundary?
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by