I was thinking of doing something similar to this. I'm partially glad you didn't take the route I had in mind.
As for the facemash algo I think it was the ELO rating system. (when I watched the social network I squealed inside cause I recognized it instantly) http://en.wikipedia.org/wiki/Elo_rating_system