Generating binary linear programming matrix

How can I generate the Matrix A that is defined by the following mathematical formula, for an n=2.
The examples below are for n=2 so the dimension of A will be for the row 3*n=6 for column will be n^3=8 hence A6x8
I want to create a function where I input the number n and get an output A. I wish to use A as an input to a Branch and Bound method.
I provide two examples for A that I have worked out manually.

 채택된 답변

Matt J
Matt J 2016년 2월 10일
편집: Matt J 2016년 2월 10일

1 개 추천

You would use Kronecker products. As an example,
sum_jk x_ijk =1
is equivalent to C*X where
C=kron(eye(n), ones(1,n), ones(1,n))

댓글 수: 1

SimSim
SimSim 2016년 3월 3일
Thank you for this very useful hint. I have applied your hint and with some changes I can generate the matrix I was after.
Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

질문:

2016년 2월 10일

댓글:

2016년 3월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by