How can I have multiple combination restrictions?

62 Views Asked by At

If I have 7 different attributes 1, 2, 3, 4, 5, 6, 7 that need to be combined into as many unique groups of 4 as possible, but 6 and 1, 6 and 3, and 3 and 4 are incompatible with each other what should I do? No repeats and order doesn't matter.

(K = 4, N = 7) ${}^{7}C_{4}$

Incompatibilities: (6 and 1), (6 and 3), (3 and 4)

I know I can reverse engineer it by making 1 of my incompatible groups required instead of incompatible (K = 4-2, N = 7-2) = (K = 2, N = 5) ${}^{5}C_{2}$ then finding the difference between my full answer and incompatibles answer ${}^{7}C_{4}$ - ${}^{5}C_{2}$, but I don't know what to do if there are multiple incompatibilities.

1

There are 1 best solutions below

0
On

I've mapped it out if anyone cares to analyse...

1234 (34)
1235
1236 (16)(36)
1237
1245

1246 (16)
1247
1256 (16)
1257
1267 (16)

1345 (34)
1346 (16)(34)(36)
1347 (34)
1356 (16)(36)
1357

1367 (16)(36)
1456 (16)
1457
1467 (16)
1567 (16)

2345 (34)
2346 (34)(36)
2347 (34)
2356 (36)
2357

2367 (36)
2456
2457
2467
2567

3456 (34)(36)
3457 (34)
3467 (34)(36)
3567 (36)
4567