Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Algorithm for optimized diversification of x members over y equal groups

  1. Dec 31, 2012 #1
    Hoping to get some assistance here on a volunteer project I am working on.

    I am writing a program for my bicyle club in preparation for our spring training series. We will have x participants that will be divided weekly into y number of (approximately) equal groups containing z members per groups (approximately x/y). This will go on for 12 weeks. The goal of my program is to optimize the diversity of the groups over the 12 weeks to ensure that each cyclist rides with as many different participants as possible over the course of the 12 weeks.

    At the moment, I wrote an algorithm that in each week, works across the members of each group and transposes them across the groups of the following week as follows:

    Week 1


    Week 2


    As the members are entered, to the extent that the member rode with another member assigned to the same group (starting that comparison analysis from the first week) the newest member is bounced to the next group and the comparison analysis is repeated. To the extent the member has riden with other members from every group, the member is relegated to the last available group with an opening.

    For example, Week 3 would look as follows:

    Week 3


    After a number of weeks, a very predictable pattern emerges. I am thinking there must be a better way.

    I am wondering if someone on this forum can guide me to a methodology/algorithm that I can code that would provide for a more optimized diversification.

    Your assistance is greatly appreciated.
  2. jcsd
  3. Dec 31, 2012 #2


    User Avatar

    Staff: Mentor

    I'll leave the math to other members to comment on, but as a bike rider, I have to wonder about your theme for forming these groups...

    You must have a range of speeds and endurance levels in your group, right? Do you really think that the faster riders want to have slower riders in their group on each ride? I don't think I'd be a member of that club for very long.

    It seems that effective training and improvement over the season would be better goals, IMO. Start off with groups seeded by ability, and do something to challenge improvement over the season. Like move up the top couple riders from the next slower group, swapping out riders who were having trouble keeping up the last time with the faster group.

    Have you run your idea past other members of the group? Just askin'... :smile:
  4. Dec 31, 2012 #3
    Thanks Berkaman. The group has already been filtered for common cycling skills and fitness. This is the program's 23rd year.

    I'm hoping to get assistance with the math. Any help greatly appreciated.
  5. Jan 2, 2013 #4
    It looks like a Graph Factorisation problem. For the 9 riders 3 teams example, you could represent the teams in a graph with 9 vertices (one for each rider) and join two vertices if the riders are on the same team. So one week would look like 3 triangles, and just add the next week's teams in a different colour and keep going, doubling up on edges as needed. Proceeding this way might reveal new options for weeks 3 and 4 (if K9 factors into 4 copies of 3K3).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook