Thanks!
I have the scoring down (VB.NET OOP style app). At the end of round one,
each player will have a score. We want to build the 2 teams of 8 so that
the total scores of each team are nearly equal. One post (Mark Hurd)
implies that doing this will be real difficult. I am a decent programmer,
but not an algorithm writer. I would love a freebie, but a point in the
right direction would work also. I would like to eventually pass in a
'PlayerList' (collection of 'Player' Objects) and get back an array of 2
Player Lists, but passing in an array or anything would work.
Thanks!
kevin
"Fergus Cooney" <filter-1@tesco.net> wrote in message
news:%23cbiRZDiDHA.2420@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi Kevin,
>
> I'm working on your query but having a TERRIBLE TIME with this server
> problem. For instance your original post has been "deleted from the[/color]
server". I[color=blue]
> never got to see the reply from the MS guy. The header was there, now[/color]
having[color=blue]
> reset my news-store, it won't load. (Though I can see it appended to your
> message just now)
>
> Sorry for shouting - I'm very frustrated with losing messages, not[/color]
being[color=blue]
> able to download, etc. etc, etc. :-((
>
> [Takes a deep breath and goes off to make a cup of tea]
>
> So - to your team-building algorithm. I see it in three parts -[/color]
there's[color=blue]
> the generation of teams, the scoring, and the finding of the optimum[/color]
balance.[color=blue]
>
> One way is to do it in phases - generate the teams, score, sort and
> select. This would be acceptable given 16 players and 2 teams as the[/color]
number[color=blue]
> of combinations is only 6435**. Go up to 24 players and 3 teams, though[/color]
and[color=blue]
> that number rises to 24! / (8! x 16!) = 4M (for the first team) times[/color]
12870[color=blue]
> for
> the other two. You don't even want to <think> about 64 and 4 teams!!
>
> Another way is to generate and score in a single phase using the[/color]
knowledge[color=blue]
> of the-best-so-far to decide not to bother with certain areas of the[/color]
search[color=blue]
> space. This is harder to program but will be necessary if you expand the
> numbers. Stronger pruning can be done in your situation, as the Ultimate[/color]
Best[color=blue]
> Solution! is not necessary - you want something 'reasonable' and 'seen to[/color]
be[color=blue]
> fair'. If you go for high numbers of players, accuracy will cost too much[/color]
and[color=blue]
> your scoring/pruning will have to become ruthless.
>
> Team Generation.
> This is easily done with recursion. (The test harness outweighs[/color]
the[color=blue]
> algorithm!). You can do it by player or team - For each player, assign to[/color]
each[color=blue]
> team in turn. recurse to allocate the next player, and so on - or - For[/color]
each[color=blue]
> team, fill with a combination of players, recurse for the next team. The
> second is slightly harder as it incorporates the first method in order to
> produce the combinations within the team but is more flexible in that you
> could have, say, 3 teams from a set of 20 players - 2 x 7 per side and a[/color]
team[color=blue]
> of 6.
>
> I've written an algorithm that uses the first method. You give it[/color]
a[color=blue]
> list of players and a number of teams. It generates all the unique
> possibilities. It requires the same number in each team.
>
> Scoring.
> This depends on what you want. You mentioned that you want the[/color]
teams[color=blue]
> scores to be as close as possible, but as Luke mentioned, would you want a
> giant and several pygmies versus an average crowd? You probably want some
> balance within the teams as well as between them.
>
> Feel free to come back with questions and more details, eg what's your
> deadline, and future plans (bigger and better tournaments, etc), will you[/color]
have[color=blue]
> odd-numbers of players (eg, the 7, 7, 6), how do you envisage the scoring,
> what
> do scores consist of (single value, multi-valued), etc.
>
> What's your programming level? Do you want to be shown and then to go[/color]
and[color=blue]
> do it, or would you benefit from more guidance?
>
> Regards,
> Fergus
>
> Permutations and Combinations explained.
>
http://engineering.uow.edu.au/Course.../File2417.html
>
> ** 6435
> The number of combinations of r team members from a selection of n is
> given by
> n! / r! (n - r)!
> which is 16! / (8! x 8!) = 12870 for n = 16, r = 2, but this can be[/color]
halved[color=blue]
> as there are two sets of r players and each complete combination will be
> mirrored. {eg T1=ABC, T2=DEF and T1=DEF, T2=ABC are equivalent}.
>
> In the 24 into 3 teams case, the total would be divided by 3! - wow,[/color]
big[color=blue]
> saving!! ;-)
>
>[/color]