Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with algorithm

 
Brett Williams
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, starting to actually put my project together and have been trying to figure out how I am going to accomplish the following:

I have a tournament with 4 different divisions. Each of these divisions is made up of a varying number of teams (from 3 to 7 teams per division). Each team needs to race the other in a "Round Robin" format. I want to generate a scheduled list of all the races to ensure that each team races every other team in their division ONLY.

Secondly, each team belongs to a club. A club may have more than one team in the same division and they may have teams in multiple divisions. I want to limit, as much as possible, teams from the same club running in consecutive races.

Lastly, the race takes place in two lanes, the left and the right. I need to ensure that teams get an "even" amount of racing in each lane. Preferably they would switch from left to right with each race, but that may not always be possible.

So, how impossible is this? Can anyone point me in the right direction?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this might do you for the round robin part

 
Brett Williams
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, it is definitely a start and easy enough to understand. I shouldn't have to tweak this much. I am assuming I would call this for each of the divisions and it would create the schedule for that division. This would leave me at having to marry all of the divisions schedules together into on list and then ordering the list, based upon my above requirements.

Thank you very much for helping with this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic