Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Constraint for binary linear model

3 Ansichten (letzte 30 Tage)
Josh  Flohr
Josh Flohr am 5 Mai 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 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 Kommentar
Alan Weiss
Alan Weiss am 6 Mai 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

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by