Ed Holland Posted May 3, 2005 Posted May 3, 2005 I have 10 teams, I'm trying to write a script that will make a 9 week schedule such that every team plays each other once. Sounds like such and easy thing to write I can easily populate all the fields, but making each match unique has got my brain all twisted. Anyone got any suggestions ?? thanks Ed
sbg2 Posted May 3, 2005 Posted May 3, 2005 Making each match unique should be a combination of the two teams, maybe ID#'s or the Team Names if they are unique. At the first team set a Unique Field to ID_Team & "-", then when you get to the team they are playing use Set Field to add the second team, ie. Unique Field = Unique Field & ID_Team.
Ender Posted May 3, 2005 Posted May 3, 2005 Hi Ed, It seems to me this would be best to use a script to populate related scheduled matchup records based on these rules: 1. A team should not get scheduled to play itself 2. A team should not play another team more than once We can use nested loops to generate records in a join table for each combination of teams, so long as the creation won't violate those two rules. Rule 2 brings us to a complication about the direction of the relationships used for the matchup. Using a join table we can add matchup records indicating that one team is scheduled to play another, but this join record will only indicate the scheduled matchup from one team's perspective, not both. We could create two join records for the scheduled matchup, one for each team's perspective, or we could try what I've done in the attached sample and use one join record, but viewed from two perspectives: Home matchups and Away matchups. Check out the attachment and let me know if it still doesn't make sense. Matchups.fp7.zip
comment Posted May 4, 2005 Posted May 4, 2005 This not easy at all - in fact it is quite complex. In addition to the match-ups, there needs to be a schedule. Not only cannot a team play against itself, it also cannot play twice in the same round of games. I have tried a calculated approach which seems to work, though I haven't really tested it against varying circumstances, e.g. number of teams. tournament.fp7.zip
Ender Posted May 4, 2005 Posted May 4, 2005 Oh yea, forgot about the weeks thing. Back to the drawing board for my scripted approach.
BobWeaver Posted May 4, 2005 Posted May 4, 2005 If you want to find out about algorithms for round robin tournaments, check this link: http://www.devenezia.com/downloads/round-robin/index.html
comment Posted May 4, 2005 Posted May 4, 2005 It's back to the drawing board for me as well - my calculations are wrong! I can calculate either the correct match-ups, or the correct order of games - but not yet both at the same time...
comment Posted May 4, 2005 Posted May 4, 2005 Thanks for the link - I had a problem with his cycling in the "wrong" direction, but it helped. I hope this is it. tournament.fp7.zip
Ed Holland Posted May 6, 2005 Author Posted May 6, 2005 Thanks guys, for all the imput, all great ideas. I have written down a solution using C, i just need to translate it into filemaker scripting. If i get it working properly, i will post it. Thanks again.
comment Posted May 6, 2005 Posted May 6, 2005 Ah .. ?? .. I thought I had finished this? Have you not seen my last attachment, or did you find a problem with it?
Recommended Posts
This topic is 7144 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now