[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Pairs tournament algorithm

Eduardo Yáñez Parareda

8/30/2006 10:18:00 AM

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 Quiz that solves this problem?

17 Answers

William Crawford

8/30/2006 10:43:00 AM

0

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 Quiz 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.

--
Posted via http://www.ruby-....

Dikshit Saumya-G19445

8/30/2006 10:57:00 AM

0

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

8/30/2006 11:37:00 AM

0

> 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.

M. Edward (Ed) Borasky

8/30/2006 12:34:00 PM

0

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.
>
>
>

Hmmm ... sounds like a Ruby Quiz to me. :)



Eduardo Yáñez Parareda

8/30/2006 2:00:00 PM

0


> Hmmm ... sounds like a Ruby Quiz to me. :)

Yes, it's a good candidate to Ruby Quiz. 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 :).

M. Edward (Ed) Borasky

8/30/2006 2:34:00 PM

0

Eduardo Yáñez Parareda wrote:
>> Hmmm ... sounds like a Ruby Quiz to me. :)
>
> Yes, it's a good candidate to Ruby Quiz. 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 :).
>
>
>
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. :) 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. :) I haven't yet submitted either a problem
or a solution to a Ruby Quiz, but I'd sure take a shot at this one. :)


Sander Land

8/30/2006 2:44:00 PM

0

On 8/30/06, Eduardo Yáñez Parareda <eduardo.yanez@gmail.com> 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?
http://www.devenezia.com/downloads/ro...
The cyclic algorithm seems easy enough to implement.

Christer Nilsson

8/30/2006 4:19:00 PM

0

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 Quiz?

--
Posted via http://www.ruby-....

James Gray

8/30/2006 4:57:00 PM

0

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 Quiz that solves this problem?

Sort of:

http://www.rubyquiz.com/q...

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 Gray II

Dave Howell

8/30/2006 10:15:00 PM

0


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".