Pairings generation based on a big PGN file

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Pairings generation based on a big PGN file

Post by beachknight » Thu Jul 22, 2010 10:16 am

Hi,

I have a question for programmers.

I have a (big) PGN file in which I store all my test games
(say 100 000 games of 2000 engines). I want to have pairings
of groups with (say) 12 engines from the bottom up to the top.

Criteria for pairings are:

-- a certain ratings interval (say 80) and

-- the number of games in the database. I should explain further:
if it is bigger than (say ) 5, I dont necessarily want both engines
in the same group. On the other hand, I want to have: each two
engines within (say) 80-points range have played (say) once or twice.

I know this could be done by checkin manually BayesElo details file.
This is the latest option for me.

Is there enough programmers for a programming contest?

:)

Best,
hi, merhaba, hallo HT

Volker Annuss
Posts: 173
Joined: Mon Sep 03, 2007 7:15 am

Re: Pairings generation based on a big PGN file

Post by Volker Annuss » Thu Jul 22, 2010 4:14 pm

I have a (big) PGN file in which I store all my test games
(say 100 000 games of 2000 engines). I want to have pairings
of groups with (say) 12 engines from the bottom up to the top.

Criteria for pairings are:

-- a certain ratings interval (say 80) and

-- the number of games in the database. I should explain further:
if it is bigger than (say ) 5, I dont necessarily want both engines
in the same group. On the other hand, I want to have: each two
engines within (say) 80-points range have played (say) once or twice.

I know this could be done by checkin manually BayesElo details file.
This is the latest option for me.
Hi Harun,

If I understand your requirements correctly you are looking for a program that makes groups for round robin tournaments. Programs of similar strength that have not played many games against each other should go to the same group.

Some questions:

Does your PGN file contain ELO ratings?

Do you want every engine in your PGN file to become member in a pairing group?
Some engines might be left, when every group is required to have the same size. Which ones should be left out, those from the top or maybe those that have enough games against close opponents?

What about engines that have played against higher/lower rated opponents on average?
According to your requirements, there might be more lower/higher rated opponents then to chose from, but this is not guaranteed.

Are there different versions of the same engine in your PGN file? If not, the following questions don't make sense.

Should different versions of the same engine be allowed to be in the same group?

Should the fact that EngineA-Version1 already played against EngineB-Version1 have any influence on
- pairings of EngineA-Version1 against EngineB-Version2 (same as EngineA-Version2 against EngineB-Version1)
- pairings of EngineA-Version2 against EngineB-Version2
Is there enough programmers for a programming contest?
I will not participate in a programmers contest on this. Although the problem is interesting, I will not waste time on it when you have the option to chose another solution.

I have a program SwissOpt that makes swiss pairings from a PGN file. It does not use the FIDE swiss pairing rules. It uses an optimization algorithm instead. This shoud be a good starting point to make the program you want.

Greetings
Volker

User avatar
Matthias Gemuh
Posts: 3238
Joined: Thu Mar 09, 2006 8:10 am
Contact:

Re: Pairings generation based on a big PGN file

Post by Matthias Gemuh » Thu Jul 22, 2010 4:32 pm

beachknight wrote: Is there enough programmers for a programming contest?
Programmers may find that irritating.

A programmer can invest time to help you by writing the tool.
However, defining the request as a contest (without pay) is not a good idea.

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de

Norm Pollock
Posts: 1017
Joined: Thu Mar 09, 2006 3:15 pm
Location: Long Island, NY, USA
Contact:

Re: Pairings generation based on a big PGN file

Post by Norm Pollock » Thu Jul 22, 2010 4:46 pm

I am not sure of exactly what is desired. Maybe these 2 are useful?

"pairList" produces two text files. "outPairs" lists all the
player pairs in the input file, and the number of games played.
"outOpponents" lists the player names, the number of games played,
and the number of distinct opponents.

"pairSplit" creates a distinct file for the games of each pair of
players, without regard to the color played. Only the first 100 player
pairs (in sorted order) are processed per program execution. Remaining
games are collected into a leftover file which can be processed at a
later time.

User avatar
hgm
Posts: 23716
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Pairings generation based on a big PGN file

Post by hgm » Thu Jul 22, 2010 4:52 pm

The way I usually approach this kind of problem is define en evaluation function for how much you like / dislike a certain solution (e.g. giving penalties for large rating differences, and pairing engines that already have a large number of games). And then I craete a purely random pairing, and try to improve on that by swapping randomly chosen engines if that improves the evaluation, until I cannot find swaps anymore that improve the score (in a predetermined number of tries). '

A refiinement would be to try simulated annealing (initially also accepting swaps that decrease the score, with a slowly decreasing probability).

Volker Annuss
Posts: 173
Joined: Mon Sep 03, 2007 7:15 am

Re: Pairings generation based on a big PGN file

Post by Volker Annuss » Thu Jul 22, 2010 5:00 pm

hgm wrote:The way I usually approach this kind of problem is define en evaluation function for how much you like / dislike a certain solution (e.g. giving penalties for large rating differences, and pairing engines that already have a large number of games). And then I craete a purely random pairing, and try to improve on that by swapping randomly chosen engines if that improves the evaluation, until I cannot find swaps anymore that improve the score (in a predetermined number of tries). '

A refiinement would be to try simulated annealing (initially also accepting swaps that decrease the score, with a slowly decreasing probability).
What I did in SwissOpt is threshold accepting. Initially also accept swaps that decrease the score by a threshold with a decreasing threshold.

User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Pairings generation based on a big PGN file

Post by beachknight » Thu Jul 22, 2010 6:07 pm

Volker Annuss wrote:
I have a (big) PGN file in which I store all my test games
(say 100 000 games of 2000 engines). I want to have pairings
of groups with (say) 12 engines from the bottom up to the top.

Criteria for pairings are:

-- a certain ratings interval (say 80) and

-- the number of games in the database. I should explain further:
if it is bigger than (say ) 5, I dont necessarily want both engines
in the same group. On the other hand, I want to have: each two
engines within (say) 80-points range have played (say) once or twice.

I know this could be done by checkin manually BayesElo details file.
This is the latest option for me.
Hi Harun,

If I understand your requirements correctly you are looking for a program that makes groups for round robin tournaments. Programs of similar strength that have not played many games against each other should go to the same group.

Some questions:

Does your PGN file contain ELO ratings?

Do you want every engine in your PGN file to become member in a pairing group?
Some engines might be left, when every group is required to have the same size. Which ones should be left out, those from the top or maybe those that have enough games against close opponents?

What about engines that have played against higher/lower rated opponents on average?
According to your requirements, there might be more lower/higher rated opponents then to chose from, but this is not guaranteed.

Are there different versions of the same engine in your PGN file? If not, the following questions don't make sense.

Should different versions of the same engine be allowed to be in the same group?

Should the fact that EngineA-Version1 already played against EngineB-Version1 have any influence on
- pairings of EngineA-Version1 against EngineB-Version2 (same as EngineA-Version2 against EngineB-Version1)
- pairings of EngineA-Version2 against EngineB-Version2
Is there enough programmers for a programming contest?
I will not participate in a programmers contest on this. Although the problem is interesting, I will not waste time on it when you have the option to chose another solution.

I have a program SwissOpt that makes swiss pairings from a PGN file. It does not use the FIDE swiss pairing rules. It uses an optimization algorithm instead. This shoud be a good starting point to make the program you want.

Greetings
Volker
1. Yes, ELO Ratings is available in the PGN file.
Or for input I may provide BayesElo ratings or details files.

2. Yes, I dont want an engine's different versions in the same group.

I need w32 only and x64 only pairings for

-- w32 engines (msw),

-- x64 engines (msw)

Plus I have following classes:

-- linux engines

-- mac engines

-- chessbase native engines

-- chesspartner engines

which I need separately to be paired.

Best,
hi, merhaba, hallo HT

User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Pairings generation based on a big PGN file

Post by beachknight » Thu Jul 22, 2010 6:10 pm

If I understand your requirements correctly you are looking for a program that makes groups for round robin tournaments. Programs of similar strength that have not played many games against each other should go to the same group.
Yes, exactly I want such a program.

Best,
hi, merhaba, hallo HT

User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Pairings generation based on a big PGN file

Post by beachknight » Thu Jul 22, 2010 6:18 pm

Matthias Gemuh wrote:
beachknight wrote: Is there enough programmers for a programming contest?
Programmers may find that irritating.

A programmer can invest time to help you by writing the tool.
However, defining the request as a contest (without pay) is not a good idea.

Matthias.
Hi Matthias,

I can write a simple program myself. But I have not touched
programming since ages. For me this will be a months effort or two.
For you or Norm or Miguel or Hans Gert... two days work at most, I'd think.

Best,
hi, merhaba, hallo HT

Volker Annuss
Posts: 173
Joined: Mon Sep 03, 2007 7:15 am

Re: Pairings generation based on a big PGN file

Post by Volker Annuss » Thu Jul 22, 2010 6:38 pm

beachknight wrote:
Matthias Gemuh wrote:
beachknight wrote: Is there enough programmers for a programming contest?
Programmers may find that irritating.

A programmer can invest time to help you by writing the tool.
However, defining the request as a contest (without pay) is not a good idea.

Matthias.
Hi Matthias,

I can write a simple program myself. But I have not touched
programming since ages. For me this will be a months effort or two.
For you or Norm or Miguel or Hans Gert... two days work at most, I'd think.

Best,
The point is not how much work it is for a programmer. It is that it is an individual program for one user only - you. So when more than one programmer starts working on a contest, you are in the fine position to take the program you like most, and all but one programmer have wasted their time on that project.

Post Reply