필터 지우기
필터 지우기

Optimization problem with integer variables

조회 수: 1 (최근 30일)
Aviram Zilberman
Aviram Zilberman 2017년 3월 29일
댓글: Aviram Zilberman 2017년 3월 31일
I have a nXn matrix M of integers with values 1...k. All the occurrences of values in M can be counted using hist(). My constraint is as follows : non of the occurrences of each value in M should not exceed a certain bound c. How do I define such constraint using intlinprog ?

채택된 답변

Torsten
Torsten 2017년 3월 29일
Let x(i,j,l) (1<=i,j<=n, 1<=l<=k) a binary variable which is 1 if the element at position (i,j) equals l, 0 else.
Then the constraints are
sum_i sum_j x(i,j,l) <= c for 1<=l<=k
0 <= x(i,j,l) <= 1
x(i,j,l) integer.
Best wishes
Torsten.
  댓글 수: 3
Torsten
Torsten 2017년 3월 30일
편집: Torsten 2017년 3월 30일
It's not clear to me what you are aiming at in the end.
Do you want to generate all possible (nxn) matrices M with integer values from 1 to k as coefficients which satisfy the constraint you mention ?
Best wishes
Torsten.
Aviram Zilberman
Aviram Zilberman 2017년 3월 31일
I need to do the following : 1. position k transmitters in a binary vector x of length n s.t x(i)=1 if a transmitter is located in position i and 0 otherwise. Given 2. Given a binary matrix A(nXn) of receivers s.t A(i,j)=1 if a receiver is located in position(i,j) and 0 otherwise. 3. each receiver is matched with an exclusive transmitter, s.t each transmitter is matched with up to c receivers. The optimization function is : find a match between receivers and transmitters, and a placement for the k transmitters s.t the total distance between transmitters and receivers is minimal.
Thanks for your generous help !

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by