# Finding all feasible solutions

Let $u$ be a $n_{max} \times m$ matrix. Let $z$ be a $n_{max} \times s_{max} \times n_{max}$ cube. Let $w$ be a $n_{max} \times 1$ vector. All the three matrices can have values from the set $\{ 0, 1\}$, i.e., they are all binary vectors.

Let vector $v$ of size $m \times 1$, $n_{max}$, $m$, $s_{max} = \max (v)$ are known.

We need to find all the feasible solutions to $u$, $z$ and $w$ subject to the following constraints:

Constraints

My solutions is as follows:

To satisfy constraints 1, we need to make sure that the number of non zero elements in $u$ should be equal to or less than $n_{max}$. I did that by finding all the combinations of positions in the matrix $u$, taken $n$ at a time, where $n \leq n_{max}$. Similarly, by assigning zeros to first $n$ terms in $w$ and remaining to $1$, we satisfy constraints 4, 5 and 6.

Since $m$ and $n_{max}$ can be large, it is still very hard to go through all the possible combinations of $u$ like this. So I tried to include the constraint 10 into the creation of $u$ as well. The problem however is that I am unable to find any suitable MATLAB-based solution to generate $u$ that satisfies constraint 10 as well. My question are as follows:

1. Can we come up with an initial, partially feasible solution to $u$ that I can check with other constraints to make sure that its fully feasible.
2. Can someone guide me how to generate all the feasible solutions subject to these constraints.
3. Is there any way I can pose this problem with a constant objective function and using MATLAB's mixed integer linear program routine. Please note I want all the possible solutions and not just one of them.