Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Algorithm problem: Order matches by difference between players

by davies (Monsignor)
on Apr 18, 2011 at 16:45 UTC ( [id://899980]=note: print w/replies, xml ) Need Help??


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

It sounds to me as though you are trying to run a Swiss-system tournament. Various methods are described in the wikipedia link. My quick googling didn't find any Perl modules already written, but that doesn't mean they don't exist.

Regards,

John Davies

  • 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 dwm042 (Priest) on Apr 18, 2011 at 17:58 UTC
    Oh yes -- Algorithms::Pair::Swiss and Games::Tournament::Swiss are in CPAN. One thing about Swiss system is that it ranks players by their play in the tournament as well as their rating. That 2500 rated IM may end up playing with the experts if he starts losing in a big American Swiss.
Re^2: Algorithm problem: Order matches by difference between players
by dwm042 (Priest) on Apr 18, 2011 at 17:10 UTC
    Not a Swiss. I thought that too, initially, but Swiss pairs /same scores/ by splitting them in half. It's not a best to worst matching.

    David.

      Yes, you're right. I didn't read the OP carefully enough. But, if one exists and depending on how it's written, it might still be possible to use a Swiss module to solve this problem. At least some Swiss chess tournaments match scores but then match players by ranking, best v worst. It might be possible to use such an algorithm and insert dummy "scores" and use the ranking to do the rest. But that's putting even more constraints on my originally constrained idea. :-(

      Regards,

      John Davies

        No, the OP wants a round robin. In the Swiss pairing a new drawing is made after each round. The OP should forget about the additional constraint of having the best player play against the worst in the first round.

        There are many ways of doing round robin pairing, and I'd think a quick google job should find some ready implementation. Pick one, and after the schedule is made, just assign the players in such a way that the best player plays the worst, etc. So if whatever algorithm you implement says the first round is "1-2, 3-4, 5-6", then give the best player label 1, the second best label 3, the third label 5, the label 6, 4, and the worst player gets label 2.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2025-07-12 12:30 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.