# Consensus/ranked ordering algorithm

Say I have a set of numbers, for example {1, 2, 3, 4, 5}. Is there an algorithm that allows these numbers to be put into a consensus ordering based on a ranked vote? For example, if 3 people vote and their votes are [1, 2, 3, 4, 5], [2, 1, 3, 4, 5], and [1, 2, 3, 5, 4], then the consensus ordering would be [1, 2, 3, 4, 5]. Ideally the algorithm would support votes of partial orderings as well, such as [2, 5, 4].

I'm pretty sure I can extend the ranked voting system to produce a complete ordering of the "candidates," but I'm wondering if there's already an algorithm to do this.

• This is a popular topic in social choice theory, known as vote aggregation. See for example this link. – Yuval Filmus Apr 4 at 21:01