I have twelve items, numbered 1 through 12.
I want to generate twelve different combinations, each containing three items, with three rules:
- each item appears in exactly three different combinations
- no two combinations have more than one item in common
- (this rule is more complicated; see below)
For example, this set of combinations satisfies rules #1 and #2: [1,2,3], [1,4,9], [2,6,7], [3,8,9], [8,10,12], [1,11,12], [2,5,12], [3,5,7], [4,7,11], [6,8,11], [4,6,10], [5,9,10].
As you can see, rules #1 and #2 guarantee that, for each combination A, there are six other combinations that A shares an item with. Continuing the example, if A is [1,4,9], then it shares an item with each of [1,2,3], [3,8,9], [4,7,11], [4,6,10], [5,9,10], and [1,11,12].
Now, as for rule #3 . . . for each combination A, I want to split its six "overlapping" combinations into three pairs (B,C) such that A and B share one item, B and C share a different item, and A and C share a third item. Continuing the example, if A is [1,4,9], then one valid triple (A,B,C) is ([1,4,9],[1,2,3],[3,8,9]), where A and B both contain 1, B and C both contain 3, and A and C both contain 9. An overall split for [1,4,9] could be ([1,4,9],[1,2,3],[3,8,9]), ([1,4,9],[4,7,11],[1,11,12]), ({[1,4,9],[4,6,10],[5,9,10]).
As you can see, that works perfectly for [1,4,9]. But it doesn't work for all combinations; for example, if A is [4,7,11], then there are only two possible triples (A,B,C). (And in the other direction: if A is [1,2,3], then there are four possible triples (A,B,C).)
So, the above example doesn't satisfy rule #3.
Is it possible to generate a set of combinations that does satisfy all three rules? If so, how?