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 Comments

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?
I am trying to use gamultiobj
Yes you are right, x consists entirely of 0 and 1. To give you the overall idea let me tell you details of what I am trying to do. I have multi objective optimization with two objectives f1 and f2, where
f1 = minimize {sum(vector(x))} and
f2= minimize {-sum(d.x)}.
d is a n dimensional vector of +ve numbers.
Now, I have the below constraints:
1. sum(F.x) >= 100
2. sum(H.z) <= 0
3. z(i,j) <= x(i)
4. z(i,j) <= x(j)
5. z(i,j) >= x(i) + x(j) - 1
Initially constraint number 2 was as below, but I split it to linearize as above.
sum(H.x(i).x(j))
In the above constraints, F is a n dimensional vector of positive integers. H is a n dimensional binary vector as x.
As you see, previously I had x as n dimensional vector in the optimization functions. But, I have introduced a new variable z in the constraints which is not in my objectives.
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.
Previously I had the below two constraints:
1. sum(F.x) >= 100
2. sum(H. x(i). x(j)) <= 0
Then I thought that the second constraint is not linear anymore. Thats why I used another variable z to represent x(i) and x(j).
Is it possible to use the constraint without linearizing?
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.
Thank you. Could you please give me an example how to do that based on my problem?
I have not implemented it myself.
Sorry, I need to head to sleep now.

Sign in to comment.

Answers (0)

Categories

Asked:

on 1 Mar 2018

Commented:

on 1 Mar 2018

Community Treasure Hunt

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

Start Hunting!