What is the best way to represent a binary linearizing variable in MATLAB while doing optimization?
이전 댓글 표시
I am trying to represent a constraint that contains a binary linearizing variable z where z=x_i⋅x_j and x is a n dimensional vector. In my original formulation x is used as variable in the optimization functions. Can anyone please help, how the constraint can be represented in MATLAB?
댓글 수: 7
Walter Roberson
2018년 3월 1일
Which optimizer?
Do I understand correctly that x consists entirely of 0 and 1? I am not clear on the linearizing part: does it mean that exactly one value is set? Or does it mean a(i) *a(j) contributes to the sum only if x(i) and x(j) are both 1?
Md Enamul Haque
2018년 3월 1일
Walter Roberson
2018년 3월 1일
That reminds me of a minmax problem, https://www.mathworks.com/help/optim/ug/fminimax.html and in any case appears to be mixed integer programming; https://www.mathworks.com/help/optim/ug/intlinprog.html -- looks like binary integer programming, which is a subset of intlinprog (but used to have its own function.)
Well, except I don't see what z is.
Md Enamul Haque
2018년 3월 1일
Walter Roberson
2018년 3월 1일
There is a hack you can use with ga or gamultiobj. Normally they do not permit you to use integer constraints with nonlinear constraints. However, what you can do is specify nonlinear constraints and do not tell it you want integer constraints, but supply custom initialization and mutation and crossover that "just happen" to only use integer values.
Md Enamul Haque
2018년 3월 1일
편집: Md Enamul Haque
2018년 3월 1일
Walter Roberson
2018년 3월 1일
I have not implemented it myself.
Sorry, I need to head to sleep now.
답변 (0개)
카테고리
도움말 센터 및 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!