Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Constraint for binary linear model

3 visualizaciones (últimos 30 días)
Josh  Flohr
Josh Flohr el 5 de Mayo de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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 comentario
Alan Weiss
Alan Weiss el 6 de Mayo de 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

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by