# How to find all the possible feasible solutions to a integer linear programme?

조회 수: 19(최근 30일)
parag patil 17 Apr 2021 14:12
댓글: parag patil 18 Apr 2021 5:25
I have following question:
1. # of decision variables : 20; These can take the values {0,1} (integers)
2. I have linear inequality constraints ( functions of above decision variables)
3. I do not have any objective function.
Can I get set of all feasible solutions ( which just satisfty the linear inequality / equality constraints ? I do not want to optimize anything. I want to have the set of all feasible points.
Is it doable ?

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

### 채택된 답변

Matt J 17 Apr 2021 14:20
편집: Matt J 17 Apr 2021 14:22
For R^20, yes. Just do an exhaustive search,
[x{1:20}]=ndgrid([0,1]);
x=reshape( cat(21,x{:}) ,[],20).';
feasible = x(:, all(A*x<=b+tolerance,1) ); %20xN matrix of feasible solutions.
##### 댓글 수: 1표시숨기기 없음
parag patil 18 Apr 2021 5:25

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

R2020b

### Community Treasure Hunt

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

Start Hunting!

Translated by