Pairs tournament algorithm

Hi all, anybody knows or could point me in the right direction to an
algorithm to get tournament pairs like
a football tournament or so?

Is there any Ruby Q. that solves this problem?

Eduardo Yáñez Parareda wrote:

Hi all, anybody knows or could point me in the right direction to an
algorithm to get tournament pairs like
a football tournament or so?

Is there any Ruby Q. that solves this problem?

You say ‘an algorithm’ like it’s calculating something… I think you
just mean a system to chart the progress, no? The difference being
that one predicts the pairs according to data, and then other merely
plots the current situation.

Can I call a method defined in ruby script from a
C code by just loading the script.

My C snippet looks like:

ruby_init();
ruby_init_loadpath();

rb_load_file(“c.rb”);
rb_funcall(self, rb_intern(“my_rout”), 0);

The ruby script c.rb has a single method defined:

def my_rout
puts ‘I am the king’
end

When I execute it gives me the following error:

c.rb:13: [BUG] Segmentation fault
ruby 1.8.1 (2003-12-25) [i686-linux]

Killed

Regards,
Saumya.

Eduardo Yáñez Parareda wrote:

Hmmm … sounds like a Ruby Q. to me. :slight_smile:

Hmmm … sounds like a Ruby Q. to me. :slight_smile:

Yes, it’s a good candidate to Ruby Q… You have to make pairs of
teams, but a team might not
play two weeks at home one after the other.

You could make it more harder if you assign weights to teams, and
doesn’t mix teams with
similar weights at first weeks.

I think there are implementations in Perl (Best Pairs or something like
that…) but I don’t like Perl :).

Eduardo Yáñez Parareda wrote:

I think there are implementations in Perl (Best Pairs or something like
that…) but I don’t like Perl :).

You can make the requirements general enough for this sort of thing that
you end up with a combinatorial optimization problem that could be
NP-complete. :slight_smile: I recall about 20 years ago, a lot of research went into
airline crew scheduling, for example. Then again, if you make it too
simple, it isn’t much fun. :slight_smile: I haven’t yet submitted either a problem
or a solution to a Ruby Q., but I’d sure take a shot at this one. :slight_smile:

You say ‘an algorithm’ like it’s calculating something… I think you
just mean a system to chart the progress, no?

No, I mean ‘something’ that make pairs of teams to make a tournament
calendar.
Well, I know it isn’t easy, I wanted to do it dynamic but finally I
think it’s better to do some lookup tables with the fixtures will be
played for 4 teams, 6 teams, 8 teams and so on.

This is a system, mainly used by chess players, called Monrad.

Example: 100 players, 10 rounds.

The players are sorted according to their score, after every round.
Players are paired from the top.
Two players can only meet once.

The clever reader should here realize the fact that backtracking
sometimes is necessary at the end of the list.


There is another system called Blocksort, used at least once in a big
table-tennis tournament. If A beats B and B beats C, then A is
considered to beat C as well. The problem with this approach is: you
don’t know how many rounds are needed.


Maybe this is something for Ruby Q.?

On Aug 30, 2006, at 5:20 AM, Eduardo Yáñez Parareda wrote:

Hi all, anybody knows or could point me in the right direction to an
algorithm to get tournament pairs like
a football tournament or so?

Is there any Ruby Q. that solves this problem?

Sort of:

Ruby Quiz - Pinewood Derby Chart (#56)

It wasn’t a popular quiz, but there does seem to be some interest in
do one along the lines you laid out here. Write it up and I will run
it.

James Edward G. II

On Aug 30, 2006, at 4:40, Eduardo Yáñez Parareda wrote:

You say ‘an algorithm’ like it’s calculating something… I think you
just mean a system to chart the progress, no?

No, I mean ‘something’ that make pairs of teams to make a tournament
calendar.
Well, I know it isn’t easy, I wanted to do it dynamic but finally I
think it’s better to do some lookup tables with the fixtures will be
played for 4 teams, 6 teams, 8 teams and so on.

Somebody else was looking for something like this a month or three ago,
and we had a number of people propose algorithms. I’d say search the
maillist archives for “tournament”.

On 8/30/06, Eduardo Yáñez Parareda [email protected] wrote:

Hi all, anybody knows or could point me in the right direction to an
algorithm to get tournament pairs like
a football tournament or so?

Does this help?

The cyclic algorithm seems easy enough to implement.

The players are sorted according to their score, after every round.
Players are paired from the top.
Two players can only meet once.

They use this kind of this in Bridge tournaments as well, but call it a
“Swiss”. Swiss systems work well for a very rough sort, but there are
two
main issues.

  1. If there are too many rounds, the movement will ‘over swiss’ since
    most
    people are already in more or less the correct order, so the rounds
    would
    need to be carefully balanced. Over swissing means that weaker players
    get
    “sucked up” into the top of the draw, since the top players have already
    played each other - at that point it shifts to a game of which top
    players
    are best at beating up weaker teams / players.

  2. The other issue is that Swiss tournaments are pretty bad at picking
    the
    exact best player / team because some good teams might play a harder set
    of
    players during the rounds etc.

Most of the time in Bridge the tournaments are run through a Swiss with
a
knockout series following for the top (eg) 8 or 16 teams / players, and
using longer / more matches. Swiss works well when the field is too
large
for a round robin, but it works best if you can seed the top 10% or so
of
players and match them against non-seeds for the first round - but it
should
only be considered as a compromise.

Single or double round robin is the best if you can afford n(n-1)
rounds,
another option is pure knockout (Wimbledon), or knockout with a
repecharge
(also used a lot in sports).

Ruby content of this mail: 0

Cheers,

ben

On 8/31/06, Ben N. [email protected] wrote:

The players are sorted according to their score, after every round.
Players are paired from the top.
Two players can only meet once.

They use this kind of this in Bridge tournaments as well, but call it a
“Swiss”. Swiss systems work well for a very rough sort, but there are two
main issues.

Scrabble too, where it’s known variously as “Australian Draw” and
“King of the Hill with no repeats”

martin

Does this help?

Yes!

Round Robin Tournament Scheduling
The cyclic algorithm seems easy enough to implement.

This is enough for me, a very easy algorithm which is what my simple
game needs.

This is enough for me, a very easy algorithm which is what my simple
game needs.

Umh… well, not enough really, I’ll have to make some changes to the
results, but it’s a
good approximation of what I need.

Somebody else was looking for something like this a month or three ago,
and we had a number of people propose algorithms. I’d say search the
maillist archives for “tournament”.

Thanks Dave, I’m going to search it…

It wasn’t a popular quiz, but there does seem to be some interest in do
one along the lines you laid out here. Write it up and I will run it.

How should I do that? Writting general ideas is enough?, Should I write
a complete story like
quiz you told me iwth examples and so on?

On Aug 31, 2006, at 6:20 AM, Eduardo Yáñez Parareda wrote:

It wasn’t a popular quiz, but there does seem to be some interest
in do one along the lines you laid out here. Write it up and I
will run it.

How should I do that? Writting general ideas is enough?, Should I
write a complete story like
quiz you told me iwth examples and so on?

Quizzes are 99% more likely to run if they are all thought out when
they get to me, so preferably the latter. I always give feedback on
what I see though, so it’s fine if you send me a first draft and we
back-and-forth it a little.

James Edward G. II