I need to calculate all possible traffic lights combinations possible on two crossroads. I have made a list that shows what traffic lights can NOT be green if a certain traffic light is green.
Example list: (should ouput: A&E, B&D)
A --> !B !D
B --> !A !E
D --> !A !E
E --> !B !D
What method can i use to calculate all possible combinations from this list?
Note: I have about 10.000 possible combinations combinations
In general, you cannot prevent a huge number of valid solutions. This is illustrated well in the following example: $$ A_1 \implies !B_1 \qquad B_1 \implies !C_1 \qquad C_1 \implies !A_1 \\ A_2 \implies !B_2 \qquad B_2 \implies !C_2 \qquad C_2 \implies !A_2 \\ \dots \\ A_n \implies !B_n \qquad B_n \implies !C_n \qquad C_n \implies !A_n $$
Here, we have $3n$ traffic lights that form "triangles": For each $i$, only one of $A_i,B_i,C_i$ can be green. This gives you a choice of 3 options for each triangle, resulting in a total of $3^n$ possible solutions. If we also consider "non-maximal" solutions (i.e. some traffic lights are unnecessarily off), you have $4^n$ possible solutions.
Thus, there is no efficient algorithm that can solve your problem, simply because there are potentially way too many solutions. I would approach the problem heuristically: Start with saying that $A$ is green, then recursively check which solutions result from that. Then, check that happens if $A$ is red.