No such thing as a small change PerlMonks

### Re: Algorithm problem: Order matches by difference between players

by dwm042 (Priest)
 on Apr 18, 2011 at 17:20 UTC Need Help??

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.

Replies are listed 'Best First'.
Re^2: Algorithm problem: Order matches by difference between players
by davies (Prior) 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

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 surveying the Monastery: (5)
As of 2024-03-01 17:53 GMT
Voting Booth?
My favourite way to spend a leap day ...

Results (29 votes). Check out past polls.