Side Assignment Algorithm

download Side Assignment Algorithm

of 4

Transcript of Side Assignment Algorithm

  • 8/12/2019 Side Assignment Algorithm

    1/4

    Side assignment algorithm

    The problem statement

    For even rounds, the side assignment just reverses the previous odd round sides. For odd rounds,proper side assignment takes some doing.

    The overall goal for side assignment is to increase the possible matches. For example, puttingtwo teams from the same school on opposite sides decreases possible matches by one compared

    to putting them on the same side. For the same reason, teams that have already debated should be

    put on the same side. In an ideally shuffled pool of nteams, there are n2( )

    2

    possible matches;

    given team constraints, prior matches, etc., there may be considerably fewer. In fact, at smalltournaments, there may be so few possible matches that a round cant even happen.

    Ok, the program must pick a good pooling, one that gives a lot of possible matches and therefore

    a lot of flexibility. Heres the problem: for any tournament, there arenC

    n

    2

    possible ways to create

    the pools. So, for a 100-team tournament, thats more than 10^29 possibilities (of which three orfour will be used!). Even for fast computers, its still too big to find the optimal solution by

    cranking through every possibility. There needs to be a cleverer way to solve the problem.

    The basic algorithm

    The program creates a first go, like so:

    Affs

    Team F Team E Team D Team C Team B Team ANegs Team A 1 .99 0

    Team B .99 0 1

    Team C 1 .99 0

    Team D 0 1 .99

    Team E .99 0 1

    Team F 0 1 .99

    This is a matrix before a round 3 pairing. Obviously, each team is blocked against itself, but I puta 0 because the algorithm doesnt need allow it any way. The 1s are the hard blocks on teams

    hitting each other again on the same side: round 1 was A aff. vs. B neg., C vs. D, and E vs. F;round 2 was D vs. A, F vs. C, and B vs. E. The .99s are the soft blocks, where the same teams

    hit again but on opposite sides. If a team needs to receive a bye, the bye itself should be treatedjust like a team in whole process (BYE), including blocks and everything.

    Now, the program tries to optimize the actual pools by minimizing the total score inside the

    yellow boxes by following the steps listed below:

  • 8/12/2019 Side Assignment Algorithm

    2/4

    1. Starting with column 1, each column may be swapped with the next depending on whichhas a higher score in the first half of its rows. Team F has a higher score, so E and F are

    swapped:

    Affs

    Team E Team F Team D Team C Team B Team ANegs Team A 1 .99 0

    Team B .99 0 1

    Team C 1 .99 0

    Team D 0 1 .99

    Team E 0 .99 1

    Team F 1 0 .99

    2. Since they were swapped and the column for team F was demoted to the right, then therow for team F needs to be promoted one up (why theres no need to code the self-block):

    AffsTeam E Team F Team D Team C Team B Team A

    Negs Team A 1 .99 0

    Team B .99 0 1

    Team C 1 .99 0

    Team D 0 1 .99

    Team F 1 0 .99

    Team E 0 .99 1

    3. And the process repeats comparing F to the next column, where this columnsmovements terminate.

    4. The process continues to D, which does move:Affs

    Team E Team F Team C Team B Team A Team D

    Team D 1 .99 0

    Negs Team A .99 0 1

    Team B .99 0 1

    Team C 1 0 .99

    Team F 1 0 .99

    Team E 0 .99 1

    Column D actually gets moved past A, so three columns right and three rows up for symmetry.

  • 8/12/2019 Side Assignment Algorithm

    3/4

    5. The program makes one last move, moving column D forward one. (This only came up oncerow D was moved up.)

    Affs

    Team E Team F Team C Team B Team D Team A

    Negs Team A .99 1 0Team D 1 0 .99

    Team B .99 0 1

    Team C 1 0 .99

    Team F 1 0 .99

    Team E 0 .99 1

    6. Now the yellow box, and therefore the pooling (E-F-C on the aff, A-D-B on the neg), is

    optimized. Almost all the blocked rounds have been pushed out. In other words, the impossiblerounds have largely been ruled just by careful pool selections. Im not sure if it will need to do

    several sweeps through the columns to make sure every possible move has been exhausted orwhether once will do.

    7. The program should check that this pooling actually yields two possible rounds in the yellow

    box (the odd and a subsequent even round): each row should have two non-blocked opponents inyellow (true), and each column should have two non-blocked opponents in yellow (true). If

    either of these is false (or its only true using a soft block), then the program needs to flag this forthe user.

    Using the algorithm with brackets in mind

    Heres how I think it ought to be used: the program should try to resolve the undefeated bracketalone first. At a small tournament, the undefeated bracket might not resolve on its own (have atleast one empty cell in each column and row). In that case, the program should add in the down-

    one bracket and try to resolve again. Adding another bracket should be repeated until the wholething (of __ brackets) resolves. At the end of the whole process, there still needs to be a double-

    check that each team has two possible opponents, even if in different brackets.

    On the other hand, at most mid-sized and big tournaments, the undefeated bracket alone doesresolve. The program should lock those columns in place, add on the down-one bracket, and try

    to resolve the down-one bracket aroundthe undefeated bracket (i.e., considering the blocks inboth but moving only the down-one teams). As it locks in a bracket, the program should consider

    all blocks within a bracket first, like so:

  • 8/12/2019 Side Assignment Algorithm

    4/4

    Affs

    A F B G E

    2 1 1 0 0

    C 2 1

    H 1

    D 1 0.99

    E 0 1 0

    G 0 0.99 0

    2-0s and 1-1s have been locked in and will not move. The only columns that can move are thepink ones. Deciding sides between the 0-2s, G and E, this is the correct order. When considering

    the overall score and the top-heaviness, the program should compare first within bracket, andthen compared to the bracket above, and then two brackets above. The D-E block is more

    serious, because its one bracket off, than the C-G block. (So it would compare: against 0-2s,either pairing is just as good, against 1-1s, G is better on the aff, and so it stops there.) This

    should be repeated with each additional bracket, still trying to resolve the whole thing butmoving only the teams in the worst bracket. It needs to do the final double-check that every team

    has two non-blocked opponents.

    My current thinking is that this process of locking the top brackets and adding and resolving onenew bracket at a time will find a relativelyoptimal solution. Arbitrary selections in the upper

    bracket pools may make a difference in the end solution. To a certain extent, though, relativelyoptimal is good enough as long as there are enough matches available.