Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Algorithm problem: Order matches by difference between players

by dwm042 (Priest)
on Apr 18, 2011 at 17:20 UTC ( #899984=note: print w/ replies, xml ) Need Help??


in reply to Algorithm problem: Order matches by difference between players

Just realized, the problem is trivial in all cases if you allow N rounds for N players. Just skip the round where "your number" comes up.
For 6 Players in 6 rounds..

1: 6-5-4-3-2-B
2: 5-4-3-B-1-6
3: 4-B-2-1-6-5
4: 3-2-1-6-5-B
5: 2-1-6-B-4-3
6: 1-B-5-4-3-2

For 5 rounds, 5 players..

1: 5-4-3-2-B
2: 4-3-B-1-5
3: B-2-1-5-4
4: 2-1-5-B-3
5: 1-B-4-3-2
Don't know if this is exactly what the OP is looking for, but it reduces the tournament calculation to a count and lookup problem.

David.


Comment on Re: Algorithm problem: Order matches by difference between players
Re^2: Algorithm problem: Order matches by difference between players
by davies (Vicar) on Apr 19, 2011 at 09:35 UTC

    I think your algorithm is ideal for odd N, but I see an issue for even N. If you look at your 6 contestant matrix, in even numbered rounds, two contestants have byes. To take the 6 nations Rugby Union tournament as an example, it is played over five rounds, not 6, and all teams play on the same week-ends. Every Monday, all teams have played the same number of matches. This isn't to say that your algorithm doesn't work - it does - but this behaviour is an oddity that may not be acceptable.

    Regards,

    John Davies

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://899984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2015-07-05 03:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls