Scott R. Schultz: Modified Social Golfer Templates

 

Formal Definition: Modified Social Golfer Problem

Given w rounds, develop a schedule that minimizes the number of missed pairings when m members of a set are divided into g groups of size s (m = g * s).

Secondary objective: Minimize the number of times members are paired over w rounds .

Practical Application:

Scheduling a golf outing with the objective of creating 4-somes which pair every golfer with every other golfer in the minimum number of rounds.

Scheduling pairings of couples in a dinner club. For example, schedule 15 couples where 3 couples are paired up and trade off hosting dinners. The pairings are then redone so that couples are paired with all other couples in the minimum number of re-pairings.

Related Problem: Social Golfer Problem

Schedule g*s golfers into g groups of s players over w weeks, such that no golfer plays in the same group with any other golfer more than just once. The problem can be looked at as an optimization problem if for two given numbers g and s we ask for the maximum number of weeks the golfers can play together.

See Sellman, M., http://www.cs.brown.edu/~sello/golf.html

Note: The Social Golfer problem is a maximization problem while the Modified Social Golfer problem is a minimization problem. If the modified social golfer problem results in a perfect pairing, this also solves the same solution as the equivalent social golfer problem.

Solution Representation

A solution to the modified social golfer problem can be depicted by identifying pairings of numbered golfers. For example, the optimal solution to the 4 round, 3 groups or size 3 problem is shown below with the pairings listed on each row, and rounds seperated by a blank line.

w-g-s
4-3-3

Best Schedule
6 4 8
3 9 7
5 1 2

1 8 3
4 2 9
5 7 6

1 9 6
4 3 5
8 7 2

9 5 8
4 7 1
6 3 2

The evaluation of a schedule can be presented as a symmetical matrix listing the pairings. The evaluation matrix for the 4-3-3 best solution is given below. Each golfer is paired with one and only one golfer each round. This is known as a perfect pairing.

0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1
1 1 1 0 1 1 1 1 1
1 1 1 1 0 1 1 1 1
1 1 1 1 1 0 1 1 1
1 1 1 1 1 1 0 1 1
1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 0
Missed pairings = 0 Max pairing = 1

Missed pairings is the number of golfers which are never paired with another golfer - the Primary objective. This value is determined by counting the number of 0's in the evaluation matrix, not including the diaganol, then dividing by 2. In otherwords, the number of 0's in the upper right hand triangle, not including the diaganol.

Max pairing is the greatest number of rounds for which one golfer is paired with another specific golfer - the Secondary objective. This value is the maximum value in the evaluation matrix. Valid range [1, w]

Solutions to Common Problems

4-3-3
6-4-3
7-5-3
9-6-3
4-3-4
5-3-4
5-4-4
6-4-4
7-4-4
8-4-4
7-5-4
8-5-4
8-6-4
9-6-4

 

w-g-s
6-4-3

Best Schedule
12 3 7
9 2 6
5 1 4
10 11 8

4 9 7
12 8 1
11 6 5
2 3 10

9 10 5
6 1 3
2 7 8
4 12 11

2 4 3
12 10 6
5 11 7
9 1 8

2 1 11
5 3 8
9 12 6
7 10 4

8 6 4
3 9 11
7 10 1
2 5 12

Evaluation Matrix
0 1 1 1 1 1 1 2 1 1 1 1
1 0 2 1 1 1 1 1 1 1 1 1
1 2 0 1 1 1 1 1 1 1 1 1
1 1 1 0 1 1 2 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 2 1
1 1 1 1 1 0 0 1 2 1 1 2
1 1 1 2 1 0 0 1 1 2 1 1
2 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 2 1 1 0 1 1 1
1 1 1 1 1 1 2 1 1 0 1 1
1 1 1 1 2 1 1 1 1 1 0 1
1 1 1 1 1 2 1 1 1 1 1 0

Missed pairings = 1 Max pairing = 2

 

w-g-s
7-5-3

Best Schedule
5 11 4
9 12 6
8 1 14
10 3 2
15 13 7

9 10 13
1 7 2
11 8 12
6 3 5
4 14 15

8 3 13
15 10 11
7 12 5
4 9 1
14 6 2

6 15 8
9 5 2
12 4 13
10 14 7
1 11 3

6 7 11
12 1 10
4 2 8
13 14 5
3 15 9

3 4 7
10 5 8
13 1 6
11 9 14
12 2 15

2 13 11
5 1 15
10 6 4
8 9 7
12 3 14

Evaluation Matrix

0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 0 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0

Missed pairings = 0 Max pairing = 1

w-g-s
9-6-3

Best Schedule
18 13 7
8 10 15
6 17 9
1 16 14
4 5 12
11 2 3

1 9 15
6 11 12
2 18 5
16 8 13
4 17 7
3 14 10

3 4 1
17 5 11
9 10 13
7 16 6
2 15 14
18 12 8

17 14 13
18 3 8
9 12 5
10 15 6
4 2 16
7 11 1

3 17 15
13 5 1
7 12 14
2 8 6
16 9 18
10 11 4

1 10 12
18 14 11
15 7 5
4 13 6
16 3 17
9 8 2

11 15 13
1 18 6
8 14 4
3 7 9
17 2 12
10 16 5

1 8 17
18 15 4
3 13 12
7 2 10
14 5 6
16 9 11

13 1 2
15 16 12
3 5 6
8 11 7
17 10 18
4 14 9

Evaluation Matrix
0 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1
1 0 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1
1 1 1 0 1 1 1 1 1 1 1 1 1 2 1 1 1 1
1 1 1 1 0 2 1 0 1 1 1 2 1 1 1 1 1 1
1 1 1 1 2 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 2 1 1 1 1 1 1 1
1 2 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 2
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 2 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 1 2 1 1 1
1 1 1 1 1 1 2 1 1 1 0 1 1 1 1 1 1 1
1 1 1 1 2 1 1 1 1 1 1 0 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
1 1 1 2 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 2 1 1 1 1 0 1 1 1
1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 0 1 1
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 0

Missed pairings = 1 Max pairing = 2

w-g-s
4-3-4

Best Schedule
5 3 7 8
4 9 10 2
12 6 11 1

11 7 10 8
1 2 6 3
9 5 4 12

9 11 3 4
2 7 12 8
5 1 6 10

12 10 3 4
11 5 2 6
1 7 9 8

Evaluation Matrix
0 1 1 0 1 3 1 1 1 1 1 1
1 0 1 1 1 2 1 1 1 1 1 1
1 1 0 2 1 1 1 1 1 1 1 1
0 1 2 0 1 0 0 0 3 2 1 2
1 1 1 1 0 2 1 1 1 1 1 1
3 2 1 0 2 0 0 0 0 1 2 1
1 1 1 0 1 0 0 4 1 1 1 1
1 1 1 0 1 0 4 0 1 1 1 1
1 1 1 3 1 0 1 1 0 1 1 1
1 1 1 2 1 1 1 1 1 0 1 1
1 1 1 1 1 2 1 1 1 1 0 1
1 1 1 2 1 1 1 1 1 1 1 0

Missed pairings = 7 Max pairing = 4

w-g-s
5-3-4

Best Schedule

5 2 4 1
10 3 11 12
6 7 8 9

12 2 7 11
5 1 9 3
10 8 4 6

1 12 8 3
5 11 2 6
7 9 10 4

1 3 6 7
8 2 5 10
4 12 9 11

2 9 4 3
10 11 1 8
7 12 6 5

Evaluation Matrix
0 1 3 1 2 1 1 2 1 1 1 1
1 0 1 2 3 1 1 1 1 1 2 1
3 1 0 1 1 1 1 1 2 1 1 2
1 2 1 0 1 1 1 1 3 2 1 1
2 3 1 1 0 2 1 1 1 1 1 1
1 1 1 1 2 0 3 2 1 1 1 1
1 1 1 1 1 3 0 1 2 1 1 2
2 1 1 1 1 2 1 0 1 3 1 1
1 1 2 3 1 1 2 1 0 1 1 1
1 1 1 2 1 1 1 3 1 0 2 1
1 2 1 1 1 1 1 1 1 2 0 3
1 1 2 1 1 1 2 1 1 1 3 0

Missed pairings = 0 Max pairing = 3

w-g-s
5-4-4

Best Schedule
5 15 7 11
10 12 13 8
6 16 2 9
4 1 3 14

15 8 2 4
11 1 12 16
10 9 5 14
13 6 7 3

10 11 4 6
1 15 13 9
12 2 5 3
16 7 14 8

4 9 7 12
2 13 11 14
6 5 8 1
10 3 15 16

2 7 1 10
5 4 16 13
3 9 8 11
15 14 12 6

Evaluation Matrix
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0

Missed pairings = 0 Max pairing = 1

w-g-s
6-4-4

Best Schedule
8 12 16 6
4 2 13 5
9 1 7 14
3 10 15 11

1 11 4 12
14 2 5 9
7 16 8 3
13 6 10 15

14 7 15 11
6 1 5 16
4 3 13 2
10 8 9 12

10 16 14 4
12 7 13 5
9 3 1 15
11 2 6 8

10 1 7 2
13 9 11 16
15 4 8 5
3 6 14 12

5 3 10 11
13 14 8 1
9 6 7 4
12 15 2 16

Evaluation Matrix
0 1 1 1 1 1 2 1 2 1 1 1 1 2 1 1
1 0 1 2 2 1 1 1 1 1 1 1 2 1 1 1
1 1 0 1 1 1 1 1 1 2 2 1 1 1 2 1
1 2 1 0 2 1 1 1 1 1 1 1 2 1 1 1
1 2 1 2 0 1 1 1 1 1 1 1 2 1 1 1
1 1 1 1 1 0 1 2 1 1 1 2 1 1 1 2
2 1 1 1 1 1 0 1 2 1 1 1 1 2 1 1
1 1 1 1 1 2 1 0 1 1 1 2 1 1 1 2
2 1 1 1 1 1 2 1 0 1 1 1 1 2 1 1
1 1 2 1 1 1 1 1 1 0 2 1 1 1 2 1
1 1 2 1 1 1 1 1 1 2 0 1 1 1 2 1
1 1 1 1 1 2 1 2 1 1 1 0 1 1 1 2
1 2 1 2 2 1 1 1 1 1 1 1 0 1 1 1
2 1 1 1 1 1 2 1 2 1 1 1 1 0 1 1
1 1 2 1 1 1 1 1 1 2 2 1 1 1 0 1
1 1 1 1 1 2 1 2 1 1 1 2 1 1 1 0

Missed pairings = 0 Max pairing = 2

w-g-s
7-4-4

Best Schedule
14 8 6 4
1 10 3 2
9 12 15 16
11 5 7 13

11 9 6 5
3 14 10 8
4 7 13 12
15 16 1 2

2 12 6 8
4 16 5 3
9 1 13 10
14 11 7 15

14 9 2 4
1 3 6 7
11 12 16 10
15 13 8 5

5 1 14 12
16 8 7 9
15 4 10 6
3 13 11 2

7 5 2 10
6 14 13 16
9 3 15 12
11 1 4 8

2 4 15 7
13 9 10 8
11 1 16 14
12 5 6 3

Evaluation Matrix
0 2 2 1 1 1 1 1 1 2 2 1 1 2 1 2
2 0 2 2 1 1 2 1 1 2 1 1 1 1 2 1
2 2 0 1 2 2 1 1 1 2 1 2 1 1 1 1
1 2 1 0 1 2 2 2 1 1 1 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1 2 2 2 1 1 2 0 2 2 2 1 1
2 1 1 2 2 1 1 1 2 2 2 0 1 2 2 2
1 2 1 1 1 2 2 2 1 2 2 1 0 2 2 2
2 1 2 2 2 1 1 1 1 2 2 2 2 0 1 2
2 2 2 2 1 1 2 2 1 2 1 2 2 1 0 1
1 1 2 2 2 1 2 2 1 2 1 2 2 2 1 0

Missed pairings = 0 Max pairing = 2

w-g-s
7-5-4

Best Schedule
13 19 10 14
7 1 2 18
8 4 11 5
6 16 17 20
12 15 9 3

2 3 11 14
12 17 18 10
8 15 20 19
13 7 6 5
1 9 4 16

5 17 15 2
10 8 16 7
20 13 3 4
9 19 18 11
1 12 14 6

9 6 5 7
17 4 10 18
8 12 2 13
1 15 19 20
14 3 11 16

17 14 9 8
20 7 12 11
3 1 5 10
13 16 15 18
4 19 6 2

4 7 15 14
13 1 11 17
18 6 8 3
16 12 19 5
2 9 20 10

17 19 7 3
20 5 18 14
11 15 6 10
2 12 4 16
8 1 13 9

Evaluation Matrix
0 1 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1
1 0 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1
1 2 1 0 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1
1 1 1 1 0 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 2 0 2 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 2 2 0 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 2 1 1 1 2 1 1 1 1 1 1 1
2 1 1 1 1 1 1 2 0 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 2 2 1 1
1 1 2 1 1 1 1 1 1 1 0 1 1 2 1 1 1 1 1 1
1 2 1 1 1 1 1 1 1 1 1 0 1 1 1 2 1 1 1 1
2 1 1 1 1 1 1 2 1 1 1 1 0 1 1 1 1 1 1 1
1 1 2 1 1 1 1 1 1 1 2 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 2 2
1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 0 2 1 1
1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 0 2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 0

Missed pairings = 0 Max pairing = 2

w-g-s
8-5-4

Best Schedule
9 19 10 15
2 13 3 17
8 20 16 14
11 4 7 12
18 6 1 5

9 2 18 13
20 14 11 19
10 1 8 17
4 15 12 3
6 7 16 5

18 12 17 16
14 4 2 10
19 9 5 20
8 13 6 11
1 7 15 3

2 3 20 7
14 12 5 10
11 9 17 6
16 15 8 18
4 13 19 1

11 16 1 2
20 18 4 9
7 17 8 10
3 6 12 19
13 5 14 15

13 7 4 16
15 10 6 20
1 5 19 17
12 8 2 9
14 11 3 18

19 6 2 16
7 14 1 9
4 5 8 3
11 10 13 18
12 15 17 20

9 16 3 10
5 11 2 15
12 20 1 13
18 7 19 8
6 14 4 17

Evaluation Matrix
0 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1
1 0 2 1 1 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1
1 2 0 2 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 1
1 1 2 0 1 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1
2 1 1 1 0 2 1 1 1 1 1 1 1 2 2 1 1 1 2 1
1 1 1 1 2 0 1 1 1 1 2 1 1 1 1 2 2 1 2 1
2 1 2 2 1 1 0 2 1 1 1 1 1 1 1 2 1 1 1 1
1 1 1 1 1 1 2 0 1 2 1 1 1 1 1 2 2 2 1 1
1 2 1 1 1 1 1 1 0 2 1 1 1 1 1 1 1 2 2 2
1 1 1 1 1 1 1 2 2 0 1 1 1 2 2 1 2 1 1 1
1 2 1 1 1 2 1 1 1 1 0 1 2 2 1 1 1 2 1 1
1 1 2 2 1 1 1 1 1 1 1 0 1 1 2 1 2 1 1 2
2 2 1 2 1 1 1 1 1 1 2 1 0 1 1 1 1 2 1 1
1 1 1 2 2 1 1 1 1 2 2 1 1 0 1 1 1 1 1 2
1 1 2 1 2 1 1 1 1 2 1 2 1 1 0 1 1 1 1 2
1 2 1 1 1 2 2 2 1 1 1 1 1 1 1 0 1 2 1 1
2 1 1 1 1 2 1 2 1 2 1 2 1 1 1 1 0 1 1 1
1 1 1 1 1 1 1 2 2 1 2 1 2 1 1 2 1 0 1 1
2 1 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 0 2
1 1 1 1 1 1 1 1 2 1 1 2 1 2 2 1 1 1 2 0

Missed pairings = 0 Max pairing = 2

w-g-s
9-6-4

Best Schedule
1 10 17 2
16 8 12 4
3 13 24 18
22 5 6 15
11 7 9 19
23 20 21 14

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

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

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

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

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

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

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

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

Evaluation Matrix
0 1 1 1 1 1 1 1 2 1 1 1 2 1 1 2 1 1 1 1 2 1 1 1
1 0 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 1 1
1 1 0 1 1 1 2 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