Search code examples
algorithmstatisticsrankingrecommendation-engine

Algorithm for determing a ranking after choosing repeatedly between to items


I would like to write a little program to help me rank items based on the result of a lot of one on one comparisons.

So if I have 100 items i would let users repeatedly choose between two randomly selected items of this set. Let's say there were 10.000 votes in total. Item Nr. 10 came up in 1000 votes and won all direct confrontations against all other items. Item Nr. 90 came up in 100 votes and won 40 and lost 60 direct confrontations. Is there an existing algorithm (e.g. from recommender systems or similar) that I can utilize to construct a ranked list of these items?


Solution

  • A simple way would be to rank based on the win percentage that is total wins/total confrontations

    Incase you want to have a singular scoring mechanism, you can reward the winner and punish the loser by a fixed amount, and then rank based on the final score.

    Finally, you can have a look at the Elo ranking algorithm, it calculated the probability of each item winning the confrontation and rewards and punishes relative to these probabilities.

    Example

    # Probability
    A higher chance of winning than B
    
    # Case1: A wins
    A +small reward
    B -small punishment
    
    # Case2: B wins
    A -large punishment
    B +large reward