can linprog handle discrete variables
이전 댓글 표시
Let’s say we have x1 and x2 with a linear objective function and linear constraints. Both x1 and x2 are vectors. All variables in x1 are continuous, so there’s no problem. However, each variable in the set x2 is either 0, or a positive number if it’s in the region [L, U], where U>L>>0. Can Matlab's optimization toolbox handle this? Thanks!
댓글 수: 1
Bruno Luong
2020년 10월 6일
편집: Bruno Luong
2020년 10월 6일
How large is x2?
If it's not (<10) you can solve 2 ^card(x2) continuous LP problems by seeting a subset of x2 as 0s, then select the best solution.
답변 (2개)
John D'Errico
2020년 10월 6일
0 개 추천
linprog has NO ability to handle discrete variables. intlinprog, (introduced after this question was asked) can do so, in theory. However, intlinprog cannot handle the discontigous parameter space as you describe it. That would leave you needing a tool like GA (from the global optimization toolbox), which can handle such a problem.
Bruno Luong
2020년 10월 6일
편집: Bruno Luong
2020년 10월 6일
You might try to use INTLINPROG by introducing (integer) slag variables b2 has the same size as x2 but values in {0,1}.
Then add the linear constraints
b2*L <= x2 <= b2*U
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!