I have an under-determined system of equations in which the solutions are either 0 or 1 for each variable and each variable coefficient is 1. Is there a way to generate all possible solutions? For example, if the system only has the equation a1+a2=1, then the solutions are [1,0] or [0,1] (where each index in the list corresponds to a variable). Another thing to consider is that I do not have the number of variables before the code is executed, so I do not know how I would declare the variable names, which are in a list that gets updated while the code is running, with a function like symbol() from SymPy, which is the library I commonly see being used to solve linear systems, but which I also don't know how could be used in this case.
A brute force way would be to generate all possible combinations of 0s and 1s, and then filter only those that work, but it could get slow really quickly.