title: Ranked pairs
text: # Ranked pairs
  
  Ranked pairs (sometimes abbreviated "RP") or the Tideman method is an electoral system developed in 1987 by Nicolaus Tideman that selects a single winner using votes that express preferences. The ranked-pairs procedure can also be used to create a sorted list of winners.
  
  If there is a candidate who is preferred over the other candidates, when compared in turn with each of the others, the ranked-pairs procedure guarantees that candidate will win. Because of this property, the ranked-pairs procedure complies with the Condorcet winner criterion (and is a Condorcet method).
  
  ## Procedure
  
  The ranked-pairs procedure operates as follows:
  
  * Tally the vote count comparing each pair of candidates, and determine the winner of each pair (provided there is not a tie)
  * Sort (rank) each pair, by strength of victory, from largest first to smallest last.
  * "Lock in" each pair, starting with the one with the largest strength of victory and, continuing through the sorted pairs, add each one in turn to a graph if it does not create a cycle in the graph with the existing locked in pairs. The completed graph shows the final ranking.
  
  The procedure can be illustrated using a simple example. Suppose that there are 27 voters and 4 candidates w, x, y and z such that the votes are cast as shown in the table of ballots.
  
  Ballots table :
  
  | w>x>z>y | 7 ballots |
  | - | - |
  | w>y>x>z | 2 ballots |
  | x>y>z>w | 4 ballots |
  | x>z>w>y | 5 ballots |
  | y>w>x>z | 1 ballots |
  | y>z>w>x | 8 ballots |
  
  ### Tally
  
  | | w | x | y | z |
  | - | - | - | - | - |
  | w | 0 | 9 | 1 | –7 |
  | x | –9 | 0 | 5 | 11 |
  | y | –1 | –5 | 0 | 3 |
  | z | 7 | –11 | –3 | 0 |
  
  The vote tally can be expressed as a table in which the (w, x) entry is the number of ballots in which w comes higher than x minus the number in which x comes higher than w. In the example w comes higher than x in the first two rows and the last two rows of the ballot table (total 18 ballots) while x comes higher than w in the middle two rows (total 9), so the entry in the (w, x) cell is 18–9 = 9.
  
  Notice the skew symmetry of the table.
  
  ### Sort
  
  The positive majorities are then sorted in decreasing order of magnitude.
  
  * $\left(x,z\right)=11$
  * $\left(w,x\right)=9$
  * $\left(z,w\right)=7$
  * $\left(x,y\right)=5$
  * $\left(y,z\right)=3$
  * $\left(w,y\right)=1$
  
  ### Lock
  
  The next stage is to examine the majorities in turn to determine which pairs to "lock in". This can be done by building up a matrix in which the (x, y) entry is initially 0, and is set to 1 if we decide that x is preferred to y and to –1 if we decide that y is preferred to x. These preferences are decided by the list of sorted majorities, simply skipping over any which are inconsistent with previous decisions.
  
  The first two majorities tell us that x is preferred to z and w to x, from which it follows by transitivity that w is preferred to z. Once these facts have been incorporated into the table it takes the form as shown after two steps. Notice again the skew symmetry. The third majority tells us that z is preferred to w, but since we have already decided that w is preferred to z we ignore it, which is why our bank of knowledge looks the same after both 2 and 3 steps.
  
  After 2-3 steps, w>x>z :
  
  | | w | x | y | z |
  | - | - | - | - | - |
  | w | 0 | 1 | 0 | 1 |
  | x | –1 | 0 | 0 | 1 |
  | y | 0 | 0 | 0 | 0 |
  | z | –1 | –1 | 0 | 0 |
  
  After 4 steps, w>x>z and w>x>y :
  
  | | w | x | y | z |
  | - | - | - | - | - |
  | w | 0 | 1 | 1 | 1 |
  | x | –1 | 0 | 1 | 1 |
  | y | –1 | –1 | 0 | 0 |
  | z | –1 | –1 | 0 | 0 |
  
  After 5 steps, w>x>y>z :
  
  | | w | x | y | z |
  | - | - | - | - | - |
  | w | 0 | 1 | 1 | 1 |
  | x | –1 | 0 | 1 | 1 |
  | y | –1 | –1 | 0 | 1 |
  | z | –1 | –1 | –1 | 0 |
  
  The fourth majority tells us that x is preferred to y, and since we know that w is preferred to x we infer that w is preferred to y, giving us the table after 4 steps.
  
  The fifth majority tells us that y is preferred to z, and this completes the table.
  
  ### Winner
  
  In the resulting graph for the locked pairs, the source corresponds to the winner. In this case w is preferred to all other candidates and is therefore identified as the winner.
  
  ### Tied majorities
  
  In the example the majorities are all different, and this is what will usually happen when the number of voters is large. If ties are unlikely, then it does not matter much how they are resolved, so a random choice can be made. However this is not Tideman's procedure, which is considerably more complicated. See his paper for details.
  
  ## An example
  
  ### The situation
  
  * v
  * t
  * e
  
  Imagine that Tennessee is having an election on the location of its capital. The population of Tennessee is concentrated around its four major cities, which are spread throughout the state. For this example, suppose that the entire electorate lives in these four cities and that everyone wants to live as near to the capital as possible.
  
  The candidates for the capital are:
  
  * Memphis, the state's largest city, with 42% of the voters, but located far from the other cities
  * Nashville, with 26% of the voters, near the center of the state
  * Knoxville, with 17% of the voters
  * Chattanooga, with 15% of the voters
  
  The preferences of the voters would be divided like this:
  
  | 42% of voters (close to Memphis) | 26% of voters (close to Nashville) | 15% of voters (close to Chattanooga) | 17% of voters (close to Knoxville) |
  | - | - | - | - |
  | Memphis Nashville Chattanooga Knoxville | Nashville Chattanooga Knoxville Memphis | Chattanooga Knoxville Nashville Memphis | Knoxville Chattanooga Nashville Memphis |
  
  The results would be tabulated as follows:
  
  Pairwise election results :
  
  | | | A | A | A | A |
  | - | - | - | - | - | - |
  | | | Memphis | Nashville | Chattanooga | Knoxville |
  | B | Memphis | | [A] 58% [B] 42% | [A] 58% [B] 42% | [A] 58% [B] 42% |
  | B | Nashville | [A] 42% [B] 58% | | [A] 32% [B] 68% | [A] 32% [B] 68% |
  | B | Chattanooga | [A] 42% [B] 58% | [A] 68% [B] 32% | | [A] 17% [B] 83% |
  | B | Knoxville | [A] 42% [B] 58% | [A] 68% [B] 32% | [A] 83% [B] 17% | |
  | Pairwise election results (won-lost-tied): | Pairwise election results (won-lost-tied): | 0-3-0 | 3-0-0 | 2-1-0 | 1-2-0 |
  | Votes against in worst pairwise defeat: | Votes against in worst pairwise defeat: | 58% | N/A | 68% | 83% |
  
  * [A] indicates voters who preferred the candidate listed in the column caption to the candidate listed in the row caption
  * [B] indicates voters who preferred the candidate listed in the row caption to the candidate listed in the column caption
  
  ### Tally
  
  First, list every pair, and determine the winner:
  
  | Pair | Winner |
  | - | - |
  | Memphis (42%) vs. Nashville (58%) | Nashville 58% |
  | Memphis (42%) vs. Chattanooga (58%) | Chattanooga 58% |
  | Memphis (42%) vs. Knoxville (58%) | Knoxville 58% |
  | Nashville (68%) vs. Chattanooga (32%) | Nashville 68% |
  | Nashville (68%) vs. Knoxville (32%) | Nashville 68% |
  | Chattanooga (83%) vs. Knoxville (17%) | Chattanooga: 83% |
  
  Note that absolute counts of votes can be used, or percentages of the total number of votes; it makes no difference since it is the ratio of votes between two candidates that matters.
  
  ### Sort
  
  The votes are then sorted. The largest majority is "Chattanooga over Knoxville"; 83% of the voters prefer Chattanooga. Thus, the pairs from above would be sorted this way:
  
  | Pair | Winner |
  | - | - |
  | Chattanooga (83%) vs. Knoxville (17%) | Chattanooga 83% |
  | Nashville (68%) vs. Knoxville (32%) | Nashville 68% |
  | Nashville (68%) vs. Chattanooga (32%) | Nashville 68% |
  | Memphis (42%) vs. Nashville (58%) | Nashville 58% |
  | Memphis (42%) vs. Chattanooga (58%) | Chattanooga 58% |
  | Memphis (42%) vs. Knoxville (58%) | Knoxville 58% |
  
  ### Lock
  
  The pairs are then locked in order, skipping any pairs that would create a cycle:
  
  * Lock Chattanooga over Knoxville.
  * Lock Nashville over Knoxville.
  * Lock Nashville over Chattanooga.
  * Lock Nashville over Memphis.
  * Lock Chattanooga over Memphis.
  * Lock Knoxville over Memphis.
  
  In this case, no cycles are created by any of the pairs, so every single one is locked in.
  
  Every "lock in" would add another arrow to the graph showing the relationship between the candidates. Here is the final graph (where arrows point away from the winner).
  
  In this example, Nashville is the winner using the ranked-pairs procedure. Nashville is followed by Chattanooga, Knoxville, and Memphis in second, third, and fourth places respectively.
  
  ### Summary
  
  In the example election, the winner is Nashville. This would be true for any Condorcet method.
  
  Under first-past-the-post and some other systems, Memphis would have won the election by having the most people, even though Nashville won every simulated pairwise election outright. Using instant-runoff voting in this example would result in Knoxville winning even though more people preferred Nashville over Knoxville.
  
  ## Criteria
  
  Of the formal voting criteria, the ranked pairs method passes the majority criterion, the monotonicity criterion, the Smith criterion (which implies the Condorcet criterion), the Condorcet loser criterion, and the independence of clones criterion. Ranked pairs fails the consistency criterion and the participation criterion. While ranked pairs is not fully independent of irrelevant alternatives, it still satisfies local independence of irrelevant alternatives.
  
  ### Independence of irrelevant alternatives
  
  Ranked pairs fails independence of irrelevant alternatives. However, the method adheres to a less strict property, sometimes called independence of Smith-dominated alternatives (ISDA). It says that if one candidate (X) wins an election, and a new alternative (Y) is added, X will win the election if Y is not in the Smith set. ISDA implies the Condorcet criterion.
  
  ### Comparison table
  
  The following table compares ranked pairs with other preferential single-winner election methods:
  
  Comparison of preferential electoral systems :
  
  | System | Monotonic | Condorcet winner | Majority | Condorcet loser | Majority loser | Mutual majority | Smith | ISDA | LIIA | Independence of clones | Reversal symmetry | Participation, consistency | Later­no­harm | Later­no­help | Polynomial time | Resolvability |
  | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
  | Schulze | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | No | No | Yes | Yes |
  | Ranked pairs | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes |
  | Tideman's Alternative | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | No | No | No | No | Yes | Yes |
  | Kemeny–Young | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | No | No | No | No | Yes |
  | Copeland | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | No |
  | Nanson | No | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | No | No | No | Yes | Yes |
  | Black | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | No | No | No | Yes | Yes |
  | Instant-runoff voting | No | No | Yes | Yes | Yes | Yes | No | No | No | Yes | No | No | Yes | Yes | Yes | Yes |
  | Smith/IRV | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | No | No | No | No | Yes | Yes |
  | Borda | Yes | No | No | Yes | Yes | No | No | No | No | No | Yes | Yes | No | Yes | Yes | Yes |
  | Baldwin | No | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | No | No | Yes | Yes |
  | Bucklin | Yes | No | Yes | No | Yes | Yes | No | No | No | No | No | No | No | Yes | Yes | Yes |
  | Plurality | Yes | No | Yes | No | No | No | No | No | No | No | No | Yes | Yes | Yes | Yes | Yes |
  | Contingent voting | No | No | Yes | Yes | Yes | No | No | No | No | No | No | No | Yes | Yes | Yes | Yes |
  | Coombs | No | No | Yes | Yes | Yes | Yes | No | No | No | No | No | No | No | No | Yes | Yes |
  | Mini­Max | Yes | Yes | Yes | No | No | No | No | No | No | No | No | No | No | No | Yes | Yes |
  | Anti-plurality | Yes | No | No | No | Yes | No | No | No | No | No | No | Yes | No | No | Yes | Yes |
  | Sri Lankan contingent voting | No | No | Yes | No | No | No | No | No | No | No | No | No | Yes | Yes | Yes | Yes |
  | Supplementary voting | No | No | Yes | No | No | No | No | No | No | No | No | No | Yes | Yes | Yes | Yes |
  | Dodgson | No | Yes | Yes | No | No | No | No | No | No | No | No | No | No | No | No | Yes |
  