필터 지우기
필터 지우기

solve the binary integer (0,1) problem

조회 수: 2 (최근 30일)
Pero Pajo
Pero Pajo 2018년 10월 10일
댓글: Stephan 2018년 10월 10일
Could somebody please help me?
I am trying to solve the binary integer (0,1) problem by using a function from this link https://www.mathworks.com/matlabcentral/fileexchange/6990-mixed-integer-lp
f represent six possible places where I can put measuring devices.
My f is x1 to x6 = [1 1 1 1 1 1]
My A =
[ 1 1 1 1 1 1;
1 1 1 1 1 1;
1 0 1 1 1 1;
1 0 1 1 1 1;
1 0 1 1 1 1;
0 0 1 1 1 1]
Lb [0 0 0 0 0 0] and ub [1 1 1 1 1 1 ]
M = [1 1 1 1 1 1]
B = [3 3 3 3 3 3]
And e I left the same as in example. For answer I get
Ans =
0
0.3475
0.0000
0.0000
0.0000
0.0000
However, I would like to get binary answers that will give me information about where to put measuring devices considering given constrains.
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 10월 10일
Read here How to ask a question?
Bruno Luong
Bruno Luong 2018년 10월 10일
편집: Bruno Luong 2018년 10월 10일
What is "B"? There is "b" as input but not upper case. Your matrix A has duplicated row, meaning you put redundancy in the constraints, thus the problem doesn't seem to be well formulated to me.
If "B" is "b", the solutions are simply peak 3 random positions among 6.

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

답변 (2개)

Stephan
Stephan 2018년 10월 10일
편집: Stephan 2018년 10월 10일
If you want to get binary output there should be a possibility to add integer constraints for x(1)...x(6). In combination with lower and upper bounds of 0 and 1 for all x, you would get what you want.
In the function you use this is done by defining vector M containing the indices of integer constrained variables.
M = 1:6;
If you have access to Optimization Toolbox you could also use intlinprog for this purpose.
Also follow the comments given above.
Best regards
Stephan
  댓글 수: 1
Stephan
Stephan 2018년 10월 10일
If the answers you got were useful for you, you can accept and/or vote for them. This is how the volunteers here earn reputation.

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


Pero Pajo
Pero Pajo 2018년 10월 10일
I want to thank you all for your answers,

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by