I apologize in advance for the long question, I tried to summarized it as much as I can.
I am developing an application for a martial arts league.
the first module of the application Requires to develop a complicated algorithm in order to arrange a tournament i.e. arrange n participants into a brackets in the size of x (for example 4 participants in each bracket).
The brackets must be arranged in the most optimal manner against multiple conditions.
Each participant has several parameters:
- Belt (degree scale in martial art that can be translated into a number)
- Weight category (for example 60-70 kg, 80-90 kg…)
- Age category (for example 16-18, 18-25, 26-36…)
- Academy name (the goal of that parameter is to make the maximum variance inside the brackets)
- Is allowed to participate against other participant that has one rank of belt above him (true,false)
- Is allowed to participate against participant that is one weight category above him (true, false)
- Is allowed to participate against participant that is one age category above him (true,false)
The conditions:
Each "optimal" bracket has x participants that share the same belt, weight category, age category and all of them must have the maximum variance of the academy name parameter.
If there are participants that can not fit into the conditions above and they were left without a bracket or they can fit only to a bracket in the size of x-y, then the algorithm must make the best ("best" will described later) decisions and make replacements of participants inside the "perfect" brackets according to the last 3 Boolean parameters.
Also after all the replacements, variance between academy names must take place.
My question is what is the best approach to solve that problem? I will be grateful for some milestones or a reference to some math literature that discusses issues like that (I don’t expect anyone to solve it for me, just guiding).
my general point of view how to solve it:
Rank all bracket with a grade and then relate to the general grade of all brackets.
for example a "perfect" bracket of 4 participants will be ranked as Z and a weight of lack of academy name variance will be ranked as (please see yellow marked paragraph for more explanation)
–(17X<Z) so if 2 participants share the same academy name the grade will be Z-(17X<Z) and if 3 participants share the same academy name Z-2(17X<Z) and so on…
if the bracket will be or/also with lack of match between their belts, weight category or age category the grade will be lessen with another –(17X<Z).
important rule is that a house with the most "bad" grade is preferable against no bracket at all
(its 17X because maximum variance with academy condition in a bracket of 4 is 4X and maximum difference in age category is another 4X and the rest of "bad connections" between participants is 16 and I add 1 in order to produce a grade that is greater than 0 or smaller than
Z).
That’s the easy part but I came to a conclusion that if I want the "Best" or the optimal grade I will need to recursively repeat an enormous and impossible number of times in order to reach for a greater general grade of all brackets and finally reach the optimal general grade.
I am not sure about it at all, maybe a different way of thinking is required.
its not so important but for General knowledge the development language is C#.
Thank you very much for your time and consideration.
Nlikely to be? I ask because once you apply the selection restrictions (related to belt, weight, age), the problem might be amenable to brute force. If so, you just need a scoring function to assign a number to any given set of brackets. Then just iterate over every legal set and pick the best one.