I have some set of letters that should be combined. The letter should be combined in corresponding places with a choice of omitting some letter. For example,
For A, I have A1, A2, A3.
For B, I have B1, B2.
For C, I have C1, C2, C3, C4.
For D, I have D1, D2.
One example of the combination is A1,B2,C1,D2. Another possible combination is _,B2,C1,D2 (omitting letter A).
Without any constraints, the total combinations would be (3+1)(2+1)(4+1)(2+1) = 180 combinations.
However, I would like to count the total combinations based on some constraints. For example, on the constraint that [A1 cannot occur together with B2] and [A2 cannot occur together with C4] the total combination would be less than 180.
I know this could be done with inclusion-exclusion principle, but it is quite difficult to program the inclusion, exclusion calculation. Is there any other algorithms rather than the inclusion-exclusion principle and brute force?
Thank you very much!!