View Single Post
Old 05-04-2019, 07:56 PM   #2
gmo
Hall Of Famer
 
Join Date: May 2002
Location: Longmont, CO
Posts: 3,152
Since the two subleagues do not interact, we can view this as a 10-team schedule for 2 divisions each of 5 teams. Then copy it to make it cover both subleagues.

First things, we can go ahead and make the interdivision matchups. We will start with the corresponding teams being against each other (i.e., 1v6, 2v7, etc), flip the home/away, then rotate the second division teams around until all the matchups are made.

Code:
Interdivision matchups
 1  6     2  7     3  8     4  9     5 10
 6  1     7  2     8  3     9  4    10  5
 1  7     2  8     3  9     4 10     5  6
 7  1     8  2     9  3    10  4     6  5
 1  8     2  9     3 10     4  6     5  7
 8  1     9  2    10  3     6  4     7  5
 1  9     2 10     3  6     4  7     5  8
 9  1    10  2     6  3     7  4     8  5
 1 10     2  6     3  7     4  8     5  9
10  1     6  2     7  3     8  4     9  5
Now we make the division games for the the first division. With the odd number of teams per division, there is a team left out of the matchups in each case. See https://makingbaseballschedules.blog...od-part-4.html for info about a method for making these matchups.

Code:
Div Matchups   Left out
3  2    4  1     5
3  2    4  1     5
2  3    1  4     5
2  3    1  4     5
2  1    3  5     4
2  1    3  5     4
1  2    5  3     4
1  2    5  3     4
1  5    2  4     3
1  5    2  4     3
5  1    4  2     3
5  1    4  2     3
5  4    1  3     2
5  4    1  3     2
4  5    3  1     2
4  5    3  1     2
4  3    5  2     1
4  3    5  2     1
3  4    2  5     1
3  4    2  5     1
I took special care to make sure the results have team 5 left out in the top batch, then 4, then 3, then 2, then 1. That matters later.

Now we can make the matchups within the other division simply by copying those from the first. We just add 5 to the team numbers. The left out teams from the divisions will be in the middle between the division matchups.

Code:
Div Matchups    Left out   Div Matchups
3  2    4  1     5   10    8  7    9  6
3  2    4  1     5   10    8  7    9  6
2  3    1  4     5   10    7  8    6  9
2  3    1  4     5   10    7  8    6  9
2  1    3  5     4    9    7  6    8 10
2  1    3  5     4    9    7  6    8 10
1  2    5  3     4    9    6  7   10  8
1  2    5  3     4    9    6  7   10  8
1  5    2  4     3    8    6 10    7  9
1  5    2  4     3    8    6 10    7  9
5  1    4  2     3    8   10  6    9  7
5  1    4  2     3    8   10  6    9  7
5  4    1  3     2    7   10  9    6  8
5  4    1  3     2    7   10  9    6  8
4  5    3  1     2    7    9 10    8  6
4  5    3  1     2    7    9 10    8  6
4  3    5  2     1    6    9  8   10  7
4  3    5  2     1    6    9  8   10  7
3  4    2  5     1    6    8  9    7 10
3  4    2  5     1    6    8  9    7 10
The problem with this is that we do not have enough interdivision matchups of each type for that configuration of the division matchups. We always have the corresponding teams from the divisions left out (again, 1v6, 2v7, etc), and there are only 2 of each of those matchups when the configuration demands 4.

What we can do is simply offset the second division matchups to change the alignment. We take the top two rows from those columns and move them to the bottom. By offsetting by two rows, we maintain the need for the 2 corresponding team matchups, but we replace the other 2 with different interdivision matchups.

Code:
Div Matchups    Left out   Div Matchups
3  2    4  1     5   10    7  8    6  9
3  2    4  1     5   10    7  8    6  9
2  3    1  4     5    9    7  6    8 10
2  3    1  4     5    9    7  6    8 10
2  1    3  5     4    9    6  7   10  8
2  1    3  5     4    9    6  7   10  8
1  2    5  3     4    8    6 10    7  9
1  2    5  3     4    8    6 10    7  9
1  5    2  4     3    8   10  6    9  7
1  5    2  4     3    8   10  6    9  7
5  1    4  2     3    7   10  9    6  8
5  1    4  2     3    7   10  9    6  8
5  4    1  3     2    7    9 10    8  6
5  4    1  3     2    7    9 10    8  6
4  5    3  1     2    6    9  8   10  7
4  5    3  1     2    6    9  8   10  7
4  3    5  2     1    6    8  9    7 10
4  3    5  2     1    6    8  9    7 10
3  4    2  5     1   10    8  7    9  6
3  4    2  5     1   10    8  7    9  6
That the teams left out were specifically ordered at the start means that now that we are moving things, those other interdivision matchups we can use with the division games all come from the same rows. The left out need to half be flipped to match the home/away configuration in the interdivision setup, but they are there. Those left out use the top 2 and bottom 2 rows in the interdivision setup built at top.

So we have set all the division matchups, filling in interdivision matchups as needed. The remaining interdivision matchups are complete in that they involve all the teams represented at all times. Then the set of all rows can be juggled into a schedule... Things like scatter the all-interdivision rows, take care to try to avoid repeating the same matchups or the same teams having consecutive interdivision matchups within the otherwise division rows, and flip-flop some matchups to avoid having teams play very many consecutive games home or away.
__________________
Making Baseball Schedules

Last edited by gmo; 05-04-2019 at 10:14 PM. Reason: Fix missing code tag
gmo is offline   Reply With Quote