Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Algorithm problem: Order matches by difference between players

by dwm042 (Priest)
on Apr 18, 2011 at 17:20 UTC ( [id://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

Replies are listed 'Best First'.
Re^2: Algorithm problem: Order matches by difference between players
by davies (Monsignor) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://899984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2025-06-22 08:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.