ICRV¶
-
class
svvamp.
ICRV
(population, **kwargs)[source]¶ Instant-Condorcet Runoff Voting (ICRV).
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.ICRV(pop)
Principle: eliminate candidates as in IRV; stop as soon as there is a Condorcet winner.
Even round
r
(including round 0): if a candidatew
has only victories against all other non-eliminated candidates (i.e. is a Condorcet winner in this subset, in the sense ofmatrix_victories_rk
), thenw
is declared the winner.Odd round
r
: the candidate who is ranked first (among non-eliminated candidates) by least voters is eliminated, like inIRV
.This method meets the Condorcet criterion.
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
.References:
‘Four Condorcet-Hare Hybrid Methods for Single-Winner Elections’, James Green-Armytage, 2011.See also
ExhaustiveBallot
,IRV
,IRVDuels
,CondorcetAbsIRV
.CondorcetVtbIRV
.-
candidates_by_scores_best_to_worst
¶ 1d array of integers.
Candidates that are not eliminated at the moment a Condorcet winner is detected are sorted by their number of victories in
matrix_victories_rk
(restricted to candidates that are not eliminated at that time).Other candidates are sorted in the reverse order of their IRV 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 victories forc
inmatrix_victories_rk
(restricted to non-eliminated candidates). Ties count for 0.5.For odd rounds
r
,scores[r, c]
is the number of voters who rankc
first (among non-eliminated candidates).
-
w
¶ Integer (winning candidate).
-