MATLAB Answers

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

6 ビュー (過去 30 日間)
parag patil
parag patil 2021 年 4 月 17 日 14:12
コメント済み: parag patil 2021 年 4 月 18 日 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
Matt J 2021 年 4 月 17 日 14:20
編集済み: Matt J 2021 年 4 月 17 日 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
parag patil 2021 年 4 月 18 日 5:25
Thank you for your answer. It is helpful.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by