The asymptotics of ranking algorithms