NAME
Vote::Count::IRV
VERSION 0.021
IRV
Implements Instant Runoff Voting for Vote::Count.
SYNOPSIS
use Vote::Count::Method;
use Vote::Count::ReadBallots 'read_ballots';
my $Election = Vote::Count::->new(
BallotSet => read_ballots('%path_to_my_ballots'), );
my $result = $Election->RunIRV();
my $winner = $result->{'winner'};
say $Election->logv(); # Print the full Log.
Method Summary
Instant Runoff Voting Looks for a Majority Winner. If one isn't present the choice with the lowest Top Count is removed.
Instant Runoff Voting is easy to count by hand and meets the Later Harm and Condorcet Loser Criteria. It, unfortunately, fails a large number of consistency criteria; the order of candidate dropping matters and small changes to the votes of non-winning choices that result in changes to the dropping order can change the outcome.
Tie Handling
There is no standard accepted method for IRV tie resolution, Eliminate All is a common one and the default.
Returns a tie when all of the remaining choices are in a tie. An optional value to RunIRV is to specify tiebreaker, see _IRVTieBreaker.
RunIRV
$Election->RunIRV();
$Election->RunIRV( $active )
$Election->RunIRV( $active, 'approval' )
Runs IRV on the provided Ballot Set. Takes an optional parameter of $active which is a hashref for which the keys are the currently active choices.
Returns results in a hashref which will be the results of Vote::Count::TopCount->EvaluateTopCountMajority, if there is no winner hash will instead be:
tie => [true or false],
tied => [ array of tied choices ],
winner => a false value
Supports the Vote::Count logt, logv, and logd methods for providing details of the method.
Private Method _IRVTieBreaker
Implements some basic methods for resolving ties. By default RunIRV sets a variable of $tiebreaker = 'all', which is to delete all tied choices. Alternate values that can be set are 'borda' (Borda Count the currently active choices), 'borda_all' (Borda Count all of the Choices on the Ballots), 'grand_junction' is similar to that method and Approval. The Borda Count methods use the defaults.
All was chosen as the module default because it is Later Harm safe. Modified Grand Junction is the most resolveable.
In the event that the tie-breaker returns a tie eliminate all is used, unless that would eliminate all choices, in which case the election returns a tie.
Tie Break Methods not provided can be implemented by extending Vote::Count::Method::IRV and over-ride the _IRVTieBreaker Method.
my @remove = $self->_IRVTieBreaker( $tiebreaker, $active, @choices );
_IRVTieBreaker returns a list, all choices in that list will be eliminated if there is a tie in the tiebreaker.
BUG TRACKER
https://github.com/brainbuz/Vote-Count/issues
AUTHOR
John Karr (BRAINBUZ) brainbuz@cpan.org
CONTRIBUTORS
Copyright 2019 by John Karr (BRAINBUZ) brainbuz@cpan.org.
LICENSE
This module is released under the GNU Public License Version 3. See license file for details. For more information on this license visit http://fsf.org.