title: Comparison-based ranking algorithm
body: <p>I would like to rank or sort a collection of items (with size potentially greater than 100,000) where items in the collection have no intrinsic (comparable) value, instead <strong>all I have is the comparisons between any two items</strong> which have been provided by users in a subjective manner.</p>
  
  <p>Example: Consider a collection with elements <code>[a, b, c, d]</code> and comparisons by users <code>b &gt; a</code>, <code>a &gt; d</code>, <code>d &gt; c</code>. The correct order of this collection would be <code>[b, a, d, c]</code>.</p>
  
  <p>This example is simple, however there could be more complicated cases:</p>
  
  <ul>
  <li>Since the comparisons are subjective, a user could also say that <code>c &gt; b</code>. In which case that would cause a conflict with the ordering above.</li>
  <li>Also you may not have comparisons that “connects” all the items, i.e. <code>b &gt; a</code>, <code>d &gt; c</code>. In which case the ordering is ambiguous. It could be <code>[b, a, d, c]</code> or <code>[d, c, b, a]</code>. In this case either ordering is acceptable.</li>
  </ul>
  
  <p>If possible it would be nice to somehow take into account multiple instances of the same comparison and give those with higher occurrences more weight. But a solution without this condition would still be acceptable.</p>
  
  <p>A similar application of this algorithm was used by Zuckerberg's FaceMash application where he ranked people based on comparisons (if I understood it correctly), but I have not been able to find what that algorithm actually was.</p>
  
  <p><strong>Is there an algorithm which already exists that can solve the problem above?</strong> I would not like to spend effort trying to come up with one if that is the case. If there is no specific algorithm, is there perhaps certain types of algorithms or techniques which you can point me to?</p>