I am tasked with setting up a schedule for a sports "potluck" tournament as follows.
Everyone signs up as individuals, and are sorted into "pods" of 4-5 people where each pod has roughly the same average skill level to keep the games interesting. Teams of 8-10 players are made by combining 2 pods together and facing them off against an opposing team of 2 other pods. In this way, each pod (ideally) plays with every other pod once and against every other pod twice over the course of the day. One team plays in black jerseys and the other team white. A target setup would have N=9 pods so that each pod plays in 8 out of 18 games on a single field of play (each pod sits out for 10/18 time slots).
The ideal schedule would have the following attributes:
- Each pod plays with every other pod exactly once
- Each pod plays against every other pod exactly twice
- No pod that plays consecutive games much switch colors (to give time to switch jerseys)
- Of the remaining valid solutions, minimize the total number of color switches across all pods
Is it possible to formulate either this problem or its relaxation as a convex optimization? Is there some way to either obtain one such valid schedule (for N=9, say), or prove that no such schedule exists that satisfies #1-#3?
I thought I would be able to come up with a schedule manually, but it is trickier than anticipated. Here is an example I manually constructed that obeys constraints #1 and #3 but not #2.
It seems like something like the Hungarian Algorithm could work in this case, with vector elements of +-1 to denote black/white, and zero to denote sitting out that game.
Here are some initial thoughts along those lines. Denote X[i,j] as +-1 when pod j plays black/white in game i, and 0 if it sits this game out. The following convex constraints seem to handle the basic rules and #3:
- (C1) $-1 \leq X[i,j] \leq +1$
- (C2) $\sum_j X[i,j] = 0$
- (C3) $\sum_j |X[i,j]| = 4$
- (C4) $| {\rm diff}_i\{X\}[i,j]| <= 1$
The following constraints, or something like them could work for #1 and #2:
- (C5) $\langle X[:,j_1],X[:,j_2] \rangle = -1 ~~~ \forall j_1, j_2$
- (C6) $\langle |X[:,j_1]| , |X[:,j_2]| \rangle = 3 ~~~ \forall j_1, j_2$
Although it gets dicey with these cross-terms and abs, so I suppose it's no longer a linear program, and is now something else?
For #4, it seems nontrivial to set up under this formulation. The naive approach would minimize sum_{i,j} (abs(diff_i(X[i,j]))), but this would be incorrect because a pod schedule of +1, 0, +1, 0, +1, involves no change in jersey color. So it might be necessary to give up on #4 and just focus on a valid solution satisfying #1-#3.
An integer linear program with binary variables will do the job. There is more than one way to model it. I have an IP model that seems to work, in the sense that it produces feasible solutions, but the bound is rather loose, so proof of optimality could take quite a while.
The model might be too cumbersome to display here in its full glory, but I can least list the variables and describe the constraints. First, some terminology: a "team" is a pair of pods playing together, and each game is divided into two "slots" (white and black, as in jersey colors). There are 36 possible teams, each of which needs to play exactly once, and 36 slots. The variables used in my model (all binary) are:
The objective is to minimize the sum of the $w$ variables. There are sets of constraints as follows:
Addendum: By request, here is the best solution I found (14 jersey changes, running the IP model with a time limit of 30 minutes).
Addendum 2: Responding to the issue of pods playing in four consecutive games, here is a (not necessarily optimal) schedule with 16 jersey changes and some streaks of three consecutive games, but no streaks of four consecutive games.