Latin square design for a social "mixer"

190 Views Asked by At

I'm looking for the name of the combinatorial satisfying the following requirements:

  1. There are $n$ different tasks.
  2. There are $n$ different participants.
  3. There are $n$ phases of the experiment
  4. Exactly one participant occupies each task at each phase.
  5. At the end of the last phase, every participant has performed each of the tasks once.

So far, just a regular latin square. Here's the complication:

  1. At the start of each phase (except the first), the person who performed the task in the last phase explains the task to the person who is about to perform it.
  2. At the end of the last phase, every participant has explained one task each to every one of the other $n-1$ participants. (equivalently, has had one task explained to them by each of the other $n-1$ participants.

Examples: n=4, persons {A,B,C,D} and tasks {0,1,2,3}

Notation: Let the notation $2/AD/1$ stand for "At the start of phase 2, A teaches D how to perform task 1"

BAD DESIGN

phase A B C D
1st   1 2 3 4
2nd   2 3 4 1
3rd   3 4 1 2
4th   4 1 2 3

Why it fails: We have 2/AD/1, 3/AD/2, 4/AD/3, i.e. at the start of each phase, A always teaches D. In fact, this is maximally bad design, because all the pairs are fixed throughout the experiment.

GOOD DESIGN

phase A B C D
1st   1 4 3 2
2nd   2 3 1 4
3rd   3 2 4 1 
4th   4 1 2 3

2/AC/1,2/BD/4,2/CB/3,2/DA/2

3/AB/2,3/BA/3,3/CD/1,3/DC/4

4/AD/3,4/BC/2,4/CA/4,4/DB/1

Every pairing appears exactly once, so this meets all the criteria.

What I know so far

Not much. I've found such designs for $n=2$ (trivial), $n=4$ and $n=6$, but (assuming my program is bug-free) no such design exists for $n=3$, $n=5$. My simple backtracking code bogs down by $n=8$, so I can't even get enough data to search the OEIS.

Is this a known design? Can such designs be found for all even n?

P.S. For the curious, here's an $n=6$ case:

0  1  2  3  4  5
1  2  0  4  5  3
3  4  5  1  2  0
2  0  1  5  3  4
5  3  4  0  1  2
4  5  3  2  0  1
1

There are 1 best solutions below

0
On BEST ANSWER

No luck finding prior work on these so, provisionally, I'll call these "Maximally Social" Latin squares, with an eye on the motivating scenario in OP.

The first few cases already showed a lot of symmetry:

  1. Bottom half is a reflection of top half about the center
  2. All nodes of the $n=k+2$ case, apart from the diagonal, are determined by the $n=k$ case.

The second property means a dynamic programming algorithm can be used which makes finding such squares very fast (n=100 in well under a minute).

I've verified that:

  1. Solutions exist for every even n up to 512 (and beyond),
  2. no solution for n=3,5,7

The symmetry properties suggest that odd n solutions are not possible.

In Reduced form (first row and column are sorted), exhaustive search finds exactly one solution for $n=2$ (obviously) and $n=4$, and exactly two solutions for $n=6$ and $n=8$. The members of these solution pairs are related to one another by the simple transformation of flipping the inner nodes of the two center columns upside-down.

$n=6$:

[0 1 2 3 4 5] [0 1 2 3 4 5]
[1 3[5 0 2 4] [1 3 0 5]2 4]
[2 5 1 4 0 3] [2 0 4 1 5 3]
[3 0 4 1 5 2] [3 5 1 4 0 2]
[4 2 0 5]3 1] [4 2[5 0 3 1]
[5 4 3 2 1 0] [5 4 3 2 1 0]

$n=8$:

[0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 7]
[1 3 0[2 5 7 4 6] [1 3 0 5 2]7 4 6]
[2 0 4 6 1 3 7 5] [2 0 4 1 6 3 7 5]
[3 5 1 7 0 6 2 4] [3 5 1 7 0 6 2 4]
[4 2 6 0 7 1 5 3] [4 2 6 0 7 1 5 3]
[5 7 3 1 6 4 0 2] [5 7 3 6 1 4 0 2]
[6 4 7 5 2]0 3 1] [6 4 7[2 5 0 3 1]
[7 6 5 4 3 2 1 0] [7 6 5 4 3 2 1 0]

Here's the largest square that fits into SE's input box, n=30:

 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 1  3  0  5  2  7  4  9  6 11  8 13 10 15 12 17 14 19 16 21 18 23 20 25 22 27 24 29 26 28
 2  0  4  1  6  3  8  5 10  7 12  9 14 11 16 13 18 15 20 17 22 19 24 21 26 23 28 25 29 27
 3  5  1  7  0  9  2 11  4 13  6 15  8 17 10 19 12 21 14 23 16 25 18 27 20 29 22 28 24 26
 4  2  6  0  8  1 10  3 12  5 14  7 16  9 18 11 20 13 22 15 24 17 26 19 28 21 29 23 27 25
 5  7  3  9  1 11  0 13  2 15  4 17  6 19  8 21 10 23 12 25 14 27 16 29 18 28 20 26 22 24
 6  4  8  2 10  0 12  1 14  3 16  5 18  7 20  9 22 11 24 13 26 15 28 17 29 19 27 21 25 23
 7  9  5 11  3 13  1 15  0 17  2 19  4 21  6 23  8 25 10 27 12 29 14 28 16 26 18 24 20 22
 8  6 10  4 12  2 14  0 16  1 18  3 20  5 22  7 24  9 26 11 28 13 29 15 27 17 25 19 23 21
 9 11  7 13  5 15  3 17  1 19  0 21  2 23  4 25  6 27  8 29 10 28 12 26 14 24 16 22 18 20
10  8 12  6 14  4 16  2 18  0 20  1 22  3 24  5 26  7 28  9 29 11 27 13 25 15 23 17 21 19
11 13  9 15  7 17  5 19  3 21  1 23  0 25  2 27  4 29  6 28  8 26 10 24 12 22 14 20 16 18
12 10 14  8 16  6 18  4 20  2 22  0 24  1 26  3 28  5 29  7 27  9 25 11 23 13 21 15 19 17
13 15 11 17  9 19  7 21  5 23  3 25  1 27  0 29  2 28  4 26  6 24  8 22 10 20 12 18 14 16
14 12 16 10 18  8 20  6 22  4 24  2 26  0 28  1 29  3 27  5 25  7 23  9 21 11 19 13 17 15
15 17 13 19 11 21  9 23  7 25  5 27  3 29  1 28  0 26  2 24  4 22  6 20  8 18 10 16 12 14
16 14 18 12 20 10 22  8 24  6 26  4 28  2 29  0 27  1 25  3 23  5 21  7 19  9 17 11 15 13
17 19 15 21 13 23 11 25  9 27  7 29  5 28  3 26  1 24  0 22  2 20  4 18  6 16  8 14 10 12
18 16 20 14 22 12 24 10 26  8 28  6 29  4 27  2 25  0 23  1 21  3 19  5 17  7 15  9 13 11
19 21 17 23 15 25 13 27 11 29  9 28  7 26  5 24  3 22  1 20  0 18  2 16  4 14  6 12  8 10
20 18 22 16 24 14 26 12 28 10 29  8 27  6 25  4 23  2 21  0 19  1 17  3 15  5 13  7 11  9
21 23 19 25 17 27 15 29 13 28 11 26  9 24  7 22  5 20  3 18  1 16  0 14  2 12  4 10  6  8
22 20 24 18 26 16 28 14 29 12 27 10 25  8 23  6 21  4 19  2 17  0 15  1 13  3 11  5  9  7
23 25 21 27 19 29 17 28 15 26 13 24 11 22  9 20  7 18  5 16  3 14  1 12  0 10  2  8  4  6
24 22 26 20 28 18 29 16 27 14 25 12 23 10 21  8 19  6 17  4 15  2 13  0 11  1  9  3  7  5
25 27 23 29 21 28 19 26 17 24 15 22 13 20 11 18  9 16  7 14  5 12  3 10  1  8  0  6  2  4
26 24 28 22 29 20 27 18 25 16 23 14 21 12 19 10 17  8 15  6 13  4 11  2  9  0  7  1  5  3
27 29 25 28 23 26 21 24 19 22 17 20 15 18 13 16 11 14  9 12  7 10  5  8  3  6  1  4  0  2
28 26 29 24 27 22 25 20 23 18 21 16 19 14 17 12 15 10 13  8 11  6  9  4  7  2  5  0  3  1
29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0