Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Constraint for binary linear model

조회 수: 3 (최근 30일)
Josh  Flohr
Josh Flohr 2016년 5월 5일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Alan Weiss
Alan Weiss 2016년 5월 6일
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

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by