Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Constraint for binary linear model

3 visualizzazioni (ultimi 30 giorni)
Josh  Flohr
Josh Flohr il 5 Mag 2016
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Hi guys, If I have a 50x50 matrix of binary decision variables, is there a simple way to constrain the matrix so that only one row can become 1 and that the sum of columns=1?
Essentially I know that the answer can only appear in one row but I want all of the row to be used when the optimization occurs. Below is what I have to constrain it from only choosing a single positive integer from each column, now I want to ensure the single integers are in the same row.
x=zeros(50,50)
Ub=ones(50,50)
lb=x
a=ones(50,1)
Aeq=blkdiag(a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a);
beq=ones(1,50)
  1 Commento
Alan Weiss
Alan Weiss il 6 Mag 2016
I am not sure that I understand your problem. It sounds like you want exactly one row to be entirely 1, and all the other rows entirely 0. Is that correct? Please let us know.
Alan Weiss
MATLAB mathematical toolbox documentation

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by