I'm developing a tournament model for a virtual city commerce game (Urbien.com) and would love to get some algorithm suggestions. Here's the scenario and current "basic" implementation:
Scenario
- Entries are paired up duel-style, like on the original Facemash or Pixoto.com.
- The "player" is a judge, who gets a stream of dueling pairs and must choose a winner for each pair.
- Tournaments never end, people can submit new entries at any time and winners of the day/week/month/millenium are chosen based on the data at that date.
Problems to be solved
- Rating algorithm - how to rate tournament entries and how to adjust their ratings after each match?
- Pairing algorithm - how to choose the next pair to feed the player?
Current solution
- Rating algorithm - the Elo rating system currently used in chess and other tournaments.
- Pairing algorithm - our current algorithm recognizes two imperatives:
- Give more duels to entries that have had less duels so far
- Match people with similar ratings with higher probability
Given:
N = total number of entries in the tournament
D = total number of duels played in the tournament so far by all players
Dx = how many duels player x has had so far
To choose players x and y to duel, we first choose player x with probability:
p(x) = (1 - (Dx / D)) / N
Then choose player y the following way: Sort the players by rating Let the probability of choosing player j at index jIdx in the sorted list be: p(j) = ... 0, if (j == x) n*r^abs(jIdx - xIdx) otherwise
where 0 < r < 1 is a coefficient to be chosen, and n is a normalization factor.
Basically the probabilities in either direction from x form a geometic series, normalized so they sum to 1.
Concerns
- Maximize informational value of a duel - pairing the lowest rated entry against the highest rated entry is very unlikely to give you any useful information.
- Speed - we don't want to do massive amounts of calculations just to choose one pair. One alternative is to use something like the Swiss pairing system and pair up all entries at once, instead of choosing new duels one at a time. This has the drawback (?) that all entries submitted in a given timeframe will experience roughly the same amount of duels, which may or may not be desirable.
- Equilibrium - Pixoto's ImageDuel algorithm detects when entries are unlikely to further improve their rating and gives them less duels from then on. The benefits of such detection are debatable. On the one hand, you can save on computation if you "pause" half the entries. On the other hand, entries with established ratings may be the perfect matches for new entries, to establish the newbies' ratings.
- Number of entries - if there are just a few entries, say 10, perhaps a simpler algorithm should be used.
- Wins/Losses - how does the player's win/loss ratio affect the next pairing, if at all?
- Storage - what to store about each entry and about the tournament itself? Currently stored: Tournament Entry: # duels so far, # wins, # losses, rating Tournament: # duels so far, # entries