Articles with example pseudocode
Debian
Electoral systems
Monotonic Condorcet methods
Single-winner electoral systems
The Schulze method (), also known as the beatpath method, is a
single winner ranked-choice voting rule developed by Markus Schulze. The Schulze method is a
Condorcet completion method, which means it will elect a
majority-preferred candidate if one exists. In other words, if most people rank ''A'' above ''B'', ''A'' will defeat ''B'' (whenever this is possible). Schulze's method breaks
cyclic ties by using indirect victories. The idea is that if
Alice beats Bob, and Bob beats Charlie, then Alice (indirectly) beats Charlie; this kind of indirect win is called a "beatpath".
For
proportional representation
Proportional representation (PR) refers to any electoral system under which subgroups of an electorate are reflected proportionately in the elected body. The concept applies mainly to political divisions (Political party, political parties) amon ...
, a
single transferable vote
The single transferable vote (STV) or proportional-ranked choice voting (P-RCV) is a multi-winner electoral system in which each voter casts a single vote in the form of a ranked ballot. Voters have the option to rank candidates, and their vot ...
(STV) variant known as
Schulze STV also exists. The Schulze method is used by several organizations including
Debian
Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
,
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
,
Gentoo,
Pirate Party political parties and
many others. It was also used by
Wikimedia prior to their adoption of
score voting
Score voting, sometimes called range voting, is an electoral system for single-seat elections. Voters give each candidate a numerical score, and the candidate with the highest average score is elected. Score voting includes the well-known approva ...
.
Description of the method

Schulze's method uses
ranked ballots
Ranked voting is any voting system that uses voters' Ordinal utility, rankings of candidates to choose a single winner or multiple winners. More formally, a ranked vote system depends only on voters' total order, order of preference of the cand ...
with equal ratings allowed. There are two common (equivalent) descriptions of Schulze's method.
Beatpath explanation
The idea behind Schulze's method is that if
Alice defeats Bob, and Bob beats Charlie, then Alice "indirectly" defeats Charlie. These chained sequences of "beats" are called 'beatpaths'.
Every beatpath is assigned a particular ''strength''. The strength of a single-step beatpath from Alice to Bob is just the number of voters who rank Alice over Bob. For a longer beatpath, consisting of multiple beats, a beatpath is as strong as its weakest link (i.e. the beat with the smallest number of winning votes).
We say Alice has a "beatpath-win" over Bob if her strongest beatpath to Bob is stronger than all of Bob's strongest beatpaths to Alice. The winner is the candidate who has a beatpath-win over every other candidate.
Markus Schulze proved that this definition of a beatpath-win is
transitive: in other words, if Alice has a beatpath-win over Bob, and Bob has a beatpath-win over Charlie, Alice has a beatpath-win over Charlie.
[Markus Schulze, " A new monotonic, clone-independent, reversal symmetric, and Condorcet-consistent single-winner election method", Social Choice and Welfare, volume 36, number 2, page 267–303, 2011. Preliminary version in ''Voting Matters'', 17:9-19, 2003.] As a result, the Schulze method is a
Condorcet method, providing a full extension of the
majority rule
In social choice theory, the majority rule (MR) is a social choice rule which says that, when comparing two options (such as bills or candidates), the option preferred by more than half of the voters (a ''majority'') should win.
In political ...
to any set of ballots.
Iterative description
The Schulze winner can also be constructed iteratively, using a defeat-dropping method:
# Draw a
directed graph with all the candidates as nodes; label the edges with the number of votes supporting the winner.
# If there is more than one candidate left:
#* Check if any candidates are tied (and if so, break the ties by
random ballot).
#* Eliminate all candidates outside the
majority-preferred set.
#* Delete the edge closest to being tied.
The winner is the only candidate left at the end of the procedure.
Example
In the following example 45 voters rank 5 candidates.
The pairwise preferences have to be computed first. For example, when comparing ' and ' pairwise, there are voters who prefer ' to ', and voters who prefer ' to '. So
and
. The full set of pairwise preferences is:

The cells for d
, Yhave a light green background if d
, Y> d
, X otherwise the background is light red. There is no undisputed winner by only looking at the pairwise differences here.
Now the strongest paths have to be identified. To help visualize the strongest paths, the set of pairwise preferences is depicted in the diagram on the right in the form of a
directed graph. An arrow from the node representing a candidate X to the one representing a candidate Y is labelled with d
, Y To avoid cluttering the diagram, an arrow has only been drawn from X to Y when d
, Y> d
, X(i.e. the table cells with light green background), omitting the one in the opposite direction (the table cells with light red background).
One example of computing the strongest path strength is p
, D
The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
= 33: the strongest path from B to D is the direct path (B, D) which has strength 33. But when computing p
, C the strongest path from A to C is not the direct path (A, C) of strength 26, rather the strongest path is the indirect path (A, D, C) which has strength min(30, 28) = 28. The ''strength'' of a path is the strength of its weakest link.
For each pair of candidates X and Y, the following table shows the strongest path from candidate X to candidate Y in red, with the weakest link underlined.
Now the output of the Schulze method can be determined. For example, when comparing ' and ', since
, for the Schulze method candidate ' is ''better'' than candidate '. Another example is that
, so candidate E is ''better'' than candidate D. Continuing in this way, the result is that the Schulze ranking is
, and ' wins. In other words, ' wins since