Schulze method

From Pirate Party Australia Wiki
Jump to navigation Jump to search
Note that this is a copy of the Wikipedia definition of the Schulze method as at 24 July 2016. It is mirrored here to ensure its integrity and accuracy as of the time and date it was accepted as the standard definition during the 2016 Pirate Party National Congress


The Schulze method is a voting system developed in 1997 by Markus Schulze that selects a single winner using votes that express preferences. The method can also be used to create a sorted list of winners. The Schulze method is also known as Schwartz Sequential Dropping (SSD), Cloneproof Schwartz Sequential Dropping (CSSD), the Beatpath Method, Beatpath Winner, Path Voting, and Path Winner.

The Schulze method is a Condorcet method, which means the following: if there is a candidate who is preferred by a majority over every other candidate in pairwise comparisons, then this candidate will be the winner when the Schulze method is applied.

The output of the Schulze method (defined below) gives an ordering of candidates. Therefore, if several positions are available, the method can be used for this purpose without modification, by letting the k top-ranked candidates win the k available seats. Furthermore, for proportional representation elections, a single transferable vote variant has been proposed.

Description of the method

Ballot

The input for the Schulze method is the same as for other ranked single-winner election methods: each voter must furnish an ordered preference list on candidates where ties are allowed (a strict weak order).

One typical way for voters to specify their preferences on a ballot is as follows. Each ballot lists all the candidates, and each voter ranks this list in order of preference using numbers: the voter places a '1' beside the most preferred candidate(s), a '2' beside the second-most preferred, and so forth. Each voter may optionally:

  • give the same preference to more than one candidate. This indicates that this voter is indifferent between these candidates.
  • use non-consecutive numbers to express preferences. This has no impact on the result of the elections, since only the order in which the candidates are ranked by the voter matters, and not the absolute numbers of the preferences.
  • keep candidates unranked. When a voter doesn't rank all candidates, then this is interpreted as if this voter (i) strictly prefers all ranked to all unranked candidates, and (ii) is indifferent among all unranked candidates.

Computation

Let <math>d[V,W]</math> be the number of voters who prefer candidate <math>V</math> to candidate <math>W</math>.

A path from candidate <math>X</math> to candidate <math>Y</math> of strength <math>p</math> is a sequence of candidates <math>C(1),\cdots,C(n)</math> with the following properties:

  1. <math>C(1) = X</math> and <math>C(n) = Y</math>.
  2. For all <math>i = 1,\cdots,(n-1): d[C(i),C(i+1)] > d[C(i+1),C(i)]</math>.
  3. For all <math>i = 1,\cdots,(n-1): d[C(i),C(i+1)] \ge p</math>.

Let <math>p[A,B]</math>, the strength of the strongest path from candidate <math>A</math> to candidate <math>B</math>, be the maximum value such that there is a path from candidate <math>A</math> to candidate <math>B</math> of that strength. If there is no path from candidate <math>A</math> to candidate <math>B</math> at all, then <math>p[A,B] = 0</math>.

Candidate <math>D</math> is better than candidate <math>E</math> if and only if <math>p[D,E] > p[E,D]</math>.

Candidate <math>D</math> is a potential winner if and only if <math>p[D,E] \ge p[E,D]</math> for every other candidate <math>E</math>.

It can be proven that <math>p[X,Y] > p[Y,X]</math> and <math>p[Y,Z] > p[Z,Y]</math> together imply <math>p[X,Z] > p[Z,X]</math>.Template:Rp Therefore, it is guaranteed (1) that the above definition of "better" really defines a transitive relation and (2) that there is always at least one candidate <math>D</math> with <math>p[D,E] \ge p[E,D]</math> for every other candidate <math>E</math>.

Implementation

The only difficult step in implementing the Schulze method is computing the strongest path strengths. However, this is a well-known problem in graph theory sometimes called the widest path problem. One simple way to compute the strengths therefore is a variant of the Floyd–Warshall algorithm. The following pseudocode illustrates the algorithm.

# Input: d[i,j], the number of voters who prefer candidate i to candidate j.
# Output: p[i,j], the strength of the strongest path from candidate i to candidate j.

for i from 1 to C
   for j from 1 to C
      if (i ≠ j) then
         if (d[i,j] > d[j,i]) then
            p[i,j] := d[i,j]
         else
            p[i,j] := 0

for i from 1 to C
   for j from 1 to C
      if (i ≠ j) then
         for k from 1 to C
            if (i ≠ k and j ≠ k) then
               p[j,k] := max ( p[j,k], min ( p[j,i], p[i,k] ) )

This algorithm is P (complexity)|efficient, and has time complexity|running time O(C3 where C is the number of candidates.

Ties and alternative implementations

When allowing users to have ties in their preferences, the outcome of the Schulze method naturally depends on how these ties are interpreted in defining d[*,*]. Two natural choices are that d[A, B] represents either the number of voters who strictly prefer A to B (A>B), or the margin of (voters with A>B) minus (voters with B>A). But no matter how the ds are defined, the Schulze ranking has no cycles, and assuming the ds are unique it has no ties.

Although ties in the Schulze ranking are unlikely, they are possible. Schulze's original paper proposed breaking ties in accordance with a voter selected at random, and iterating as needed.

An alternative, slower, way to describe the winner of the Schulze method is the following procedure:

  1. draw a complete directed graph with all candidates, and all possible edges between candidates
  2. iteratively [a] delete all candidates not in the Schwartz set (i.e. any candidate which cannot reach all others) and [b] delete the weakest link
  3. the winner is the last non-deleted candidate.

External links