Menu

Home

Greg Hewitt
Attachments
RRCalcExample1.PNG (19049 bytes)
RRCalcExample2.PNG (19231 bytes)
RRCalcExample3.PNG (25631 bytes)
RRobinCalc_7_1_ss0.PNG (25659 bytes)

RRobinCalc Program Description

The RRobinCalc program calculates the starting heat of a pinewood derby race given the number of lanes of the track and the number of times a racer races in each lane. Although this program was originally written for pinewood derby competitions, it can be used for any event with simultaneous multiple competitors, such as multiplayer real-time strategy game melees.

The Round Robin Schedule

The schedule this program calculates uses the following rules:
1. Each racer will race in all lanes.
2. Each racer will race the same number of times in each lane (stages).
3. The racer number increments by 1 in each lane for the next heat during a given stage.
4. Each racer will race another racer only once.

An ideal round robin lineup will have each racer race all other racers exactly once, will race in all lanes and in each lane the same number of times. The number of racers for an ideal round robin lineup is the number of other racers in a heat, times the number of lanes, times the races per lane plus the racer himself:

(N-1) x N x R + 1

Where:
N - the number of lanes
R - the number of races per lane
For example if there are 4 lanes and each racer races once per lane, then for each race, there are 3 other competitors times 4 races.

(4-1) x 4 x 1 = 12 competitors.
12 + 1 = 13 total racers.

The total number of racers needed for this race would be 13. See example below.

If each racer will race multiple times per lane, then the schedule is broken into stages. In each stage, the racers will race in each lane once with a given starting lineup. The racer numbers will increment by one for each lane in each heat. The next stage will begin with a new starting heat lineup and will increment again until all racers have competed in each lane. Note, the total number of heats is the number of racers times the number of stages.

A scoring method that can be used for this kind of race would be to record the place a racer came in for a particular heat. The places are added up at the end for a final score and, like golf, the racer with the lowest score wins.

Examples:
foobar

Non-Ideal Round Robin Lineups
It is understood that having the exact number of racers required for an ideal round robin schedule is rare and sometimes not possible given the number of lanes and races per lane. Also, the starting heat lineup for an ideal round robin many times will not work when the number of racers is different that the ideal number. For races with too few racers, filler cars can be added which always are last, but be cautious about adding too many fillers. With races with more than ideal, it is best to recalculate the starting heat lineup, knowing that a given racer will not race everyone.

For example consider a small club with 14 racers and a 4-lane track. An ideal round robin with 1 race per lane needs 13 racers. If the starting lineup for an ideal round robin is used, then racer 0 will race against racers 6 and 8 twice and will not race against racers 4, 7 and 10. If the starting heat lineup is recalculated with the additional racer, racer 0 does not race against another racer twice and will not race against racer 7 only.

foobar

The RRobinCalc Program

foobar

Above is a screen shot of the program and below are descriptions of the options. This program only calculates the starting heat lineup of the round robin schedule described earlier and does not create an entire race schedule. This program can easily be integrated into another program for creating entire schedules and conducting races. Even a spreadsheet can be used to create a complete lineup. Here it is provided as a standalone calculator because some starting heat lineups can take a long time to calculate. Not something to do just before a competition begins. Also, this eliminates the need to run an entire software package just to calculate a possible starting heat lineup for later use. Note, if n is the number of racers, the lineups calculated by this program uses racer 0 as the first racer and counts up to (n-1). For example if there are 19 racers, the program will number them 0 through 18.

Calc Tab: This tab has all the options for the calculator and starts and stops the calculations.

Output Tab: This tab is a text box that displays the end results. When finding all possible solutions, this tab will display a list of the possible starting heats. Again, if n is the number of racers, the lineups calculated by this program uses racer 0 as the first racer and counts up to (n-1). For example if there are 19 racers, the program will number them 0 through 18. To have racer 1 as the first racer, just add 1 to all the entries to get the numbering 1 through 19.

Number of Lanes: Selects the number of lanes for the race, or number of competitors.

Races Per Lane: Selects the number of races per lane.

Ideal Number of Racers: The calculated ideal number of racers. This is the number of other racers a given racer will race against. Even if additional racers are added, a given racer will only race this many others.

Additional racers Above Ideal: This option adds a number of racers above the ideal number for a non-ideal round robin schedule.

Nonconsecutive Lineup: This option finds a lineup where if a racer is in a heat, they will not race the next heat. Unfortunately to create such a lineup, a non-ideal round robin schedule is required and at least 2 additional racers are needed above ideal. Each racer will not race against the racer number before them nor after them. For example, racer 2 will not race against racer 1 or racer 3.

Use B1 Shortcut: This option assumes that B1 will be the next racer, or second to the next racer if non-consecutive option is checked. This will shorten calculation time. However, if searching for all possible lineups, this option will exclude many possible lineups.

Normal Calculations: Use normal calculations to calculate a starting heat lineup. Column A will always be at 0 (the first racer), but the remaining columns will increment through the remaining available racers to find the first working solution. The calculations will then stop. If a working solution is not found for a given number of racers, a racer is added to the number of racers and the calculations are restarted.

Entire Lineup Normal Calc: Uses the normal calculations to generate the starting heats, then generates the entire round robin lineup from the starting heats. Results are displayed on the output tab.

Find All Possible (Output Tab): Does not stop when the first working solution is found, but continues to finds all possible solutions using the normal calculations for a given number of lanes, races per lane, and racers. The available solutions are outputted to the output tab. If a solution is not found, the output will be empty, additional racers are NOT added, and calculations are NOT restarted.

Find All Possible Filtered (Output Tab): The round robin lineup will not be affected if the lanes are reordered or if there are multiple stages, the stages shuffled. Thus given one working solution, many other working solutions can be found by shuffling the lanes and/or shuffling the stages. This output filters out these repeated solutions to come up with a list of working solutions that cannot be easily derived from another. Like the Find All Possible options, this option does not add any more racers and does not restart the calculations if a working solution is not found.

Advance Exceptions: If there is a desire for racer 0 NOT to race against particular racers, the racer numbers will be entered here separated by commas. For example, if you do not wish racer 0 to race against racers 2 and 3, then the entry would be "2, 3". This also means that if n is the number of racers, racer 0 will also not race against racers n-2 and n-3. These exceptions propagates to the other racers: such as racer 1 would not race against racers 3, 4, (n-2)+1 and (n-3)+1, racer 2 would not race against racers 4, 5, (n-2)+2 and (n-3)+2, and so on. This will require additional number of racers.

Display Calculations: These options are for what to display in the results table for the current calculations that are in progress. This is to help with preserving CPU usage, but still keep the user informed as to the progress of the calculations.

Calculate Button: Starts the calculation.

Stop Button: Stops the calculation. Will turn red signifying the last calculations were interrupted and what is in the results table most likely will not be a working solution.

Results Table: Displays the last calculations performed. If Normal Calculations option or Use B1 Shortcut option is selected, this table will show the working lineup along with the output tab. If the calculations are in progress, will show the current calculations for the cells selected in the Display Calculations option. Note: if n is the number of racers, the lineups calculated by this program use racer 0 as the first racer and counts up to (n-1). For example if there are 19 racers, the program will number them 0 through 18. To have racer 1 as the first racer, just add 1 to all the entries to get the numbering 1 through 19.

Number of Racers Needed: Displays the number of racers needed for the given starting heat lineup. If the calculations needed to add a racer, this display will be yellow. This signifies that with the given inputs, a working starting heat lineup was not found and racers were added.

Some Round Robin Starting Heat Lineups
Several starting heat lineups are listed in the table below. Each heat afterwards increments the car number by 1 for number of heats equaling the number of cars racing. If there are additional races per lane, the next starting heat lineup is used and the car numbers are incremented again so all racers race in each lane. (Yellow highlight means that an ideal round robin lineup was not found. Cars were added so a racer does not race another racer twice)

foobar

To Download.

Copyright (c) 2010, Gregory W Hewitt. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

  • Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  • Neither the name of Gregory W Hewitt or the names of
    contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.