1

I am trying to devise an algorithm for an image comparison program that will rank images in order.

For example, say we have 5 images - A B C D E

A > B
C > B
B > D
E > D

So the order would be A C B E D - however, A and C have not been compared. The program I wish to create will use over 800 images. Any suggestions for an algorithm that will allow all images to be compared with each other with the least number of votes possible?

David Robinson
  • 77,383
  • 16
  • 167
  • 187
badcoder
  • 3,624
  • 5
  • 32
  • 33
  • is that not a complicated way of simply registering a count with each image? eg `a = 5, c = 4, b = 3, e = 2, d = 1`? – Chris S Jan 21 '13 at 23:33
  • Nevermind, Ken's link cleared it up - Elo sounds like the best option,and easiest to implement. – Chris S Jan 21 '13 at 23:35

1 Answers1

1

Topological Sort will find one ordering of the elements consistent with a given partial order, which is what you have.

Patrick87
  • 27,682
  • 3
  • 38
  • 73
  • I read the link, and it sounds like the problem may be more complicated than the OP alluded to in the question. Topological sort, at least the vanilla version, probably only works on relations that don't contain loops (i.e., transitivity can't be contradicted). – Patrick87 Jan 21 '13 at 23:39