But I think I have puzzled out your real question. Please correct this description if it is wrong.
Many schools register many particpants (a participant can be one person, or a team of 2-3 people) for many different competitions. A participant is also called a competitor. Each competition takes place in 3 rounds. In each round the participants are divided into a series of panels. The members of a panel all compete in front of some judge who scores the round. For logistical reasons panels should be around the same size as each other, and their size should not exceed 6. For resource reasons you would like to do this with as few judges as possible for the competition.
The maximally flexible situation is one where your program gets information about how many schools are in a given competition, how many participants each provides, and optionally the number of judges that you need. It is then supposed to devise up the best schedule that it can for the 3 rounds of competition. It appears from running your code that you have set the number of students per school to 3, and you decide the number of judges according to some rule that I didn't look up.
And there are two additional complex requirements. First you don't want to ever have 2 participants from the same school on the same panel. You would also like to avoid having pairs of participants appear in different rounds on the same panel as each other.
Is this right? If so then a few observations.
You claim to have found that setting this up by hand for a small number of participants is fairly easy. But you can't always satisfy all of the rules. My guess is that when you went to the math people asking to find the perfect solution, they taught you factorials to show you how many different possible solutions you had to search through to find the perfect answer. (You might have even written code that should work, but it didn't finish?)
My first suggestion is that if you really can assume that there are always 3 competitors per school then you should pre-build a set of optimal solutions in a data file, and then have your CGI script just return the one that matches the size that you have handled. That leaves the problem of generating those optimal solutions..once.
My suggestion for that is that you write a program to look for good solutions, but not worry about perfection. Here is a possible algorithm that I would try writing for the absolutely general problem (arbitrary number of schools, arbitrary number of participants per school, fixed number of judges handed to me).
In reply to Re: Perl for Adjudication
by tilly
in thread Perl for Adjudication
by dejoha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |