IRVDuels¶
-
class
svvamp.
IRVDuels
(population, **kwargs)[source]¶ IRV with elimination duels.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.IRVDuels(pop)
Principle: each round, perform a duel between the two least-favorite candidates and eliminate the loser of this duel.
Even round
r
(including round 0): the two non-eliminated candidates who are ranked first (among the non-eliminated candidates) by least voters are selected for the elimination duels that is held in roundr+1
.Odd round
r
: voters vote for the selected candidate they like most in the duel. The candidate with least votes is eliminated.This method meets the Condorcet criterion.
We thank Laurent Viennot for the idea of this voting system.
CM()
: Non-polynomial or non-exact algorithms from superclassElection
.ICM()
: Exact in polynomial time.IM()
: Non-polynomial or non-exact algorithms from superclassElection
.not_IIA()
: Exact in polynomial time.TM()
: Exact in polynomial time.UM()
: Non-polynomial or non-exact algorithms from superclassElection
.See also
ExhaustiveBallot
,IRV
,ICRV
,CondorcetAbsIRV
.CondorcetVtbIRV
.-
candidates_by_scores_best_to_worst
¶ 1d array of integers. Candidates are sorted in the reverse order of their elimination.
By definition,
candidates_by_scores_best_to_worst[0]
=w
.
-
scores
¶ 2d array.
For even rounds
r
(including round 0),scores[r, c]
is the number of voters who rankc
first (among non-eliminated candidates).For odd rounds
r
, only the two candidates who are selected for the elimination duels get scores.scores[r, c]
is the number of voters who vote forc
in this elimination duel.
-
w
¶ Integer (winning candidate).
-