Why intlinprog ignores lb when intcon is on some part of variables?
Show older comments
Matlab ignores lb = zeros() getting negative results when intcon is on some part of variables. In this case it finds solution but with huge constraint violation:
exitflag =
1
output =
relativegap: 0
absolutegap: 0
numfeaspoints: 1
numnodes: 0
constrviolation: 1800
message: 'Optimal solution found.
When I put intcon on entire vector of variables, it works. The point is that I need only some integer variables.
8 Comments
Brendan Hamm
on 13 Aug 2015
The rest of the code you called would be necessary to even begin to understand why this would be the case.
Simona
on 13 Aug 2015
Brendan Hamm
on 13 Aug 2015
As participation in this site is voluntary and not part of my job, I do not pass out my email address on this site. It is better to leave all communications on the board for others to learn from.
Simona
on 13 Aug 2015
Brendan Hamm
on 13 Aug 2015
You can attach the file with the 'Paper Clip' icon above any post. The bound constraints might not be satisfied due to other constraints in your system. I will check when you post the code.
Simona
on 13 Aug 2015
Brendan Hamm
on 13 Aug 2015
I looked at this briefly and could not immediately see an issue. One thing I did see is you have a 0 lb and ub for several variables, but I wouldn't imagine this should cause the termination.
This may take some time, as I cannot get to this today. I will come back to this though.
Brendan Hamm
on 25 Aug 2015
Going back through this file I now see that there are many issues going on here. The optimization is terminating immediately because it is not finding any feasible points (after starting at a location with a huge constraint violation). Let's look at factors which might affect this: For starters only 109 of the lower bounds are different from the upper bounds. There is no reason for you to have fixed constant values like this in your design variables. Many of these are involved in the equality constraint which results in invalid constraints (no -feasible points). Furthermore, you had a question earlier regarding the integer variables and the solution given was to use a binary (on-off) design variable which is no longer present in this problem. Since this is a linear problem you minimum of your entire problem is going to be the sum of a minimums of smaller problems. Given that it will be much easier to setup your problem in these smaller pieces, I would suggest using that route. Break your problem up around integer/non-integer design variables (You can do this since the integer variables are the only variables used in the last equality constraint). Next split up the other parts of the problem by equality constraint. Now you should be able to get a much better picture of what is going on. If you want you can combine them together again after and see if you still have an error.
Answers (1)
Sean de Wolski
on 13 Aug 2015
You need to have ub and lb be the same size as f, otherwise it only applies to however many elements are in it, in your case one because zeros() returns a 1x1 0.
lb = zeros(numel(x),1)
1 Comment
Brendan Hamm
on 13 Aug 2015
Sean in the attached code she does create it of the same size.
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming 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!