Saturday, March 25, 2023

5-team divisions, an easy scenario

Fairly recently there was a request involving an odd number of teams per division, which is a complicating factor, but the other parameters combined to make layout fairly easy. Granted, you may look at the full post length and wonder how it could be easy. But if you see past all the detail in the steps here, hopefully the key point is clear.

Why does an odd number of teams increase the difficulty? It means you cannot have only division games occurring at any given time. There is always a team left out. Actually, you could end up leaving out more, as long as it is an odd number. E.g., with a 7-team division you could have 6 of the teams playing among themselves in 3 series leaving out 1, or 4 teams in 2 series leaving out 3, or 2 teams in 1 series leaving out 5. Anyway, it means filling out any given period with other types of games for those left-out teams.

It is much simpler to build a layout with only division games at some given times, intraleague games at other times, and (if applicable) interleague at yet other times. Look back at the layout for the example schedule with two division of four teams. It is nicely "mathematical" with any given time being all division or non-division, and the matchups in halfweeks are consistent in that when 1 is playing 2, whatever the other matchups are they are the same every time 1 is playing 2.

Whether that consistency is desirable is another question. I am quite sympathetic to wanting not to have halfweeks always with the same matchups as directly out of the circle method. But from a practical standpoint of having to build the schedule it makes it so much simpler to be able to have units of halfweeks of complete sets of series rather than having to handle each individual series.

An odd number of teams in the division means not everything fits into such convenient boxes. But depending on the situation we may be able to stay very close to such cases. That is what happened with the example to follow. The request involved 20 teams in two subleagues, each with two division of five teams. It called for 12 games versus division opponents, 6 games versus non-division subleague opponents, and 3 games against each team in the other subleague, which is 12*4+6*5+3*10 = 48+30+30 = 108 games. Everything is in 3-game series. So that means 4 series per division opponent, 2 series per non-division subleague opponent, and 1 series per interleague opponent.

The circle method can determine our division matchups.

 1 v 5   2 v 4   3 out
 5 v 4   1 v 3   2 out
 4 v 3   5 v 2   1 out
 3 v 2   4 v 1   5 out
 2 v 1   3 v 5   4 out

That covers one of the division series sets with everyone playing everyone else. There need to be four such of those. Of course we would flip the home/away for two of them for balance. That four means there are four times when there are division games going on but a given team is left out. What will we do with that left-out team in those cases?

To start toward answering that question, let us start by mirroring the first division layout with the second division, i.e., make the whole first subleague.

 1 v  5   2 v  4   3 out   out  8  10 v  6   9 v  7
 5 v  4   1 v  3   2 out   out  7   9 v 10   8 v  6
 4 v  3   5 v  2   1 out   out  6   8 v  9   7 v 10
 3 v  2   4 v  1   5 out   out 10   7 v  8   6 v  9
 2 v  1   3 v  5   4 out   out  9   6 v  7  10 v  8

Now we mirror the second subleague against the first to make the whole league.

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

The first row has teams 3, 8, 13, and 18 as the left-out teams. So to maintain all the division games as laid out there, those four teams must play amongst themselves. And remember, there need to be four instances with that set of matchups as in the first row. That turns out to work out quite conveniently.

Taking team 3, they need 4 series in total against teams 8, 13, and 18. Team 8 is a non-division subleague opponent against whom there should be two series, and teams 13 and 18 are interleague opponents against whom there is one series each. That is 2 + 1 + 1 = 4. There are four division series sets, and four matchups among teams left out at any given time. That is exactly what we need. So take that matchup grid and line up the left-out teams into matchups in that way just described for the four sets of division matchups.

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

That is why I call this an easy case. We have the difficulty of filling out sets of division games, but we have exactly the matchups we need from aligning corresponding teams from different divisions and keeping the division matchups as we had them in the initial layout.v

Continuing on to explain more of the details and choices made/possible...

The first two sections in the grid just above are simple enough. Matching the left-out with their corresponding non-division subleague team for the first, then the same but reversing the home/away for the second. That covers half the division games plus the non-division intraleague matchups involving left-out teams.

For the other two sections the left-out teams are aligned for interleague matchups. Note how each team is the home team once and the road team once in those matchups. But that was accomplished by having a given division always home or road against another division. That could be fine, and maybe a sibling schedule could be made that reverses all the matchups to balance the home/away across two years. Another approach is to mix up those matchups in each division-versus-division section, though making sure each team gets one interleague matchup home and one away. Here is an example zooming in on just those matchups with such mixing.

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

I merely flipped all the matchups there involving 2/7/12/17 and 4/9/14/19 compared to what they were further above. That is really not necessary to introduce some variety in the interleague matchups home/away because we still have all the other matchups to play with.

First though for completeness, here are the non-division intraleague matchups, with those already used removed. I imagine you can picture the row that would start each section if those matchups had not already been used along with division matchups.

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

Now the rest of the interleague matchups. We could follow that initial pattern above, like where subleague 1 division 1 (teams 1-5) plays always away against subleague 2 division 1 (teams 11-15) and at home against subleague 2 division 2 (teams 16-20).

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

But we could mix up the matchups - flip half of them (2 rows of the 4 in each section) to balance the home/away at least in these matchup. With opponents in each interleague division it cannot be even home/away, but it can be 2/3 or 3/2, then the reverse for the other interleague division.

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

Whatever exact layout of the home/away for the matchups we have them all figured out. There are 20 rows of mostly division games filled out with subleague/interleague, 8 rows of all non-division intraleague matchups, and 8 rows of all interleague matchups. We still have to order those rows in some way, then go through and swap team matchups to improve the home/away distribution for teams. But working out how the series can fit into halfweeks where everyone is playing and all the needed matchups get represented is a major hurdle to clear. If our left-out cases slot exactly into the available layout slots, that hurdle is much less of a challenge.

No comments:

Post a Comment