The Criteria for Resolving Ranked Choice (including Score) Ballots

Later Harm

Marking a later Choice on a Ballot should not cause a Voter's higher ranked choice to lose.

Condorcet Criteria

Condorcet Loser states that a method should not choose a winner that would be defeated in a direct match up to all other choices.

Condorcet Winner states a choice which defeats all others in direct match-ups should be the Winner.

Smith Criteria the winner should belong to the smallest set of choices which defeats all choices outside of that set.

Instant Runoff Voting (IRV is also known as Hare System, Alternative Vote)

Seeks a Majority Winner. If there is none the lowest choice is eliminated until there is a Majority Winner or all remaining choices have the same number of votes.

  • Easy to Hand Count and Easy to Understand.

  • Meets Later Harm.

  • Fails Condorcet Winner (but meets Condorcet Loser).

  • Fails many Consistency Criteria (The example given for Monotonic Consistency failure can happen with IRV). IRV handles clones poorly.

  • Fails Condorcet Winner.

  • Inconsistent.

  • The basic Borda Method is vulnerable to a Cloning Attack, but not Range Ballot Scoring and iterative Borda methods.


Technically this family of methods should be called Condorcet Pairwise, because any method that meets both Condorcet Criteria is technically a Condorcet Method. However, in discussion and throughout this software collection the term Condorcet will refer to methods which uses a Matrix of Wins and Losses derived from direct pairing of choices and seeks to identify a Condorcet Winner.

The basic Condorcet Method will frequently fail to identify a winner. One possibility is a Loop (Condorcet's Paradox) Where A > B, B > C, and C > A. Another possibility is a knot (not an accepted term, but one which will be used in this documentation). To make Condorcet resolvable a second method is typically used to resolve Loops and Knots.

  • Complexity Varies among sub-methods.

  • Fails Later Harm. The Later Harm effect is much lower than with Approval or Borda, because Later Harm manifests when the later choice defeats the preferred choice in pairing. Using an IRV based method for the fallback when there isn't a Condorcet Winner also limits the Later Harm effect.

  • Meets both Condorcet Criteria.

  • When a Condorcet Winner is present Consistency is very high. When there is no Condorcet Winner this Consistency applies between a Dominant (Smith) Set and the rest of the choices, but not within the Smith Set.

Range (Score) Voting Systems

Most Methods for Ranked Choice Ballots can be used for Range Ballots.

Voters rate the choices on a scale, with the highest rating being their most favored (the inverse of Ranked where 1 is the best), the scores from all the votes are added together for a ranking. STAR, creates a virtual runoff between the top two Choices.

Advocates claim that this Ballot Style is a better expression of voter preference. Where it shows a clear advantage is in allowing Voters to directly mitigate Later Harm by ranking a strongly favored choice with the highest score and weaker choices with the lowest. The downside to this strategy is that the voter is giving little help to later choices reaching the automatic runoff. Given a case with two roughly equal main factions, where one faction gives strong support to all of its options, and the other faction's supporters give weak support to all later choices; the runoff will be between the two best choices of the first faction, even if the choices of the second faction all defeat any of the first's choices in pairwise comparison.

The Range Ballot resolves the Borda weighting problem and allows the voter to manage the later harm effect, so it is clearly a better choice than Borda. Condorcet and IRV can resolve Range Ballots, but ignore the extra information and would prefer strict ordinality (not allowing equal ranking).

Voters may find the Range Ballot to be more complex than the Ranked Choice Ballot.

Objective and Motivation

I wanted to be able to evaluate alternative methods for resolving elections and couldn't find a flexible enough existing library in any of the popular general purpose and web development languages: Perl, PHP, Python, Ruby, JavaScript, nor in the newer language Julia (created as an alternative to R and other math languages). More recently I was writing a bylaws proposal to use RCV and found that the existing libraries and services were not only constrained in what options they can provide, but also didn't always document them clearly, making it a challenge to have a method described in bylaws where it could be guaranteed hand and machine counts would agree.

The objective is to have a library that can handle any of the myriad variants that one might consider either from a study perspective or what is called for by the elections rules of our entity.

Vote::Count Basics


  use 5.024; # Minimum Perl, or any later Perl.
  use feature qw /postderef signatures/;

  use Vote::Count;
  use Vote::Count::ReadBallots;
  use Vote::Count::Method::CondorcetDropping;

  # example uses biggerset1 from the distribution test data.
  my $ballotset = read_ballots 't/data/biggerset1.txt' ;
  my $CondorcetElection =
      'BallotSet' => $ballotset ,
      'DropStyle' => 'all',
      'DropRule'  => 'topcount',
  # ChoicesAfterFloor a hashref of choices meeting the
  # ApprovalFloor which defaulted to 5%.
  my $ChoicesAfterFloor = $CondorcetElection->ApprovalFloor();
  # Apply the ChoicesAfterFloor to the Election.
  $CondorcetElection->SetActive( $ChoicesAfterFloor );
  # Get Smith Set and the Election with it as the Active List.
  my $SmithSet = $CondorcetElection->Matrix()->SmithSet() ;
    "Dominant Set Is: " . join( ', ', keys( $SmithSet->%* )));
  my $Winner = $CondorcetElection->RunCondorcetDropping( $SmithSet )->{'winner'};

  # Create an object for IRV, use the same Floor as Condorcet

  my $IRVElection = Vote::Count->new(
    'BallotSet' => $ballotset,
    'Active' => $ChoicesAfterFloor );
  # Get a RankCount Object for the
  my $Plurality = $IRVElection->TopCount();
  my $PluralityWinner = $Plurality->Leader();
  $IRVElection->logv( "Plurality Results", $Plurality->RankTable);
  if ( $PluralityWinner->{'winner'}) {
    $IRVElection->logt( "Plurality Winner: ", $PluralityWinner->{'winner'} )
  } else {
      "Plurality Tie: " . join( ', ', $PluralityWinner->{'tied'}->@*) )
  my $IRVResult = $IRVElection->RunIRV();

  # Now print the logs and winning information.
  say $CondorcetElection->logv();
  say $IRVElection->logv();
  say '*'x60;
  say "Plurality Winner: $PluralityWinner->{'winner'}";
  say "IRV Winner: $IRVResult->{'winner'}";
  say "Condorcet Winner: $Winner";

Reading Ballots

The Vote::Count::ReadBallots library provides functionality for reading files from disc. Currently it defines a format for a ballot file and reads that from disk. In the future additional formats may be added. Range Ballots may be in either JSON or YAML formats.

RankCount Object

Votes are frequently put into a tabular form by some criteria, such as Approval or Top Count. Performing such operations returns a Vote::Count::RankCount object.

Voting Method and Component Modules

The Modules in the space Vote::Count::%Component% provide functionality needed to create a functioning Voting Method. These are mostly consumed as Roles by Vote::Count, some such as RankCount and Matrix return their own objects.

The Modules in the space Vote::Count::Method::%Something% implement a Voting Method that isn't globally available. The Borda and IRV modules for example are loaded into every Vote::Count object. These Modules inherit the parent Vote::Count and all of the Components available to it. These modules all return a Hash Reference with the following key: winner, some return additional keys. Methods that can be tied will have additional keys tie and tied. When there is no winner the value of winner will be false.

Vote::Count Module

The Core Module requires a Ballot Set (which can be obtained from ReadBallots).

  my $Election = Vote::Count->new(
      BallotSet => read_ballots( $ballotfile ),

The Documentation for the Vote::Count Module is in Vote::Count::Common

Minimum Perl Version

It is the policy of Vote::Count to only develop with recent versions of Perl. Support for older versions will be dropped when they either require additional maintenance or impair adoption of new features.

Catalog of Methods

Directory of Vote Counting Methods linking to the Vote::Count module for it.

Consumed As Roles By Vote::Count

Return Their Own Objects

Voting Methods

Non Object Oriented Components


Additional Documentation

Call for Contributions

This project needs contributions from Programmers and Mathematicians. Review and citations from Mathematicians are urgently requested, because in addition to being a Tool-set for implementing vote counting this documentation will for many also be the manual. From coders there is a lot of help that could be given: any well known method could use a write up if it is easy to implement with the toolkit (see Benham) or a code submission if it is not. Currently Tiedeman, SSD, and Kemmeny-Young are unimplemented.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 59:

'=item' outside of any '=over'