CondorcetVtbIRV¶
-
class
svvamp.
CondorcetVtbIRV
(population, **kwargs)[source]¶ Condorcet Instant Runoff Voting
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.CondorcetVtbIRV(pop)
Each voter must provide a strict total order. If there is a Condorcet winner (in the sense of
matrix_victories_rk
), then she is elected. Otherwise,IRV
is used.If sincere preferences are strict total orders, then this voting system is equivalent to
CondorcetAbsIRV
for sincere voting, but manipulators have less possibilities (they are forced to provide strict total orders).CM()
:CM_option
='fast'
: Rely onIRV
‘s fast algorithm. Polynomial heuristic. Can prove CM but unable to decide non-CM (except in rare obvious cases).CM_option
='slow'
: Rely onExhaustiveBallot
‘s exact algorithm. Non-polynomial heuristic (\(2^C\)). Quite efficient to prove CM or non-CM.CM_option
='almost_exact'
: Rely onIRV
‘s exact algorithm. Non-polynomial heuristic (\(C!\)). Very efficient to prove CM or non-CM.CM_option
='exact'
: Non-polynomial algorithm from superclassElection
.
Each algorithm above exploits the faster ones. For example, if
CM_option
='almost_exact'
, SVVAMP tries the fast algorithm first, then the slow one, then the ‘almost exact’ one. As soon as it reaches a decision, computation stops.ICM()
: Exact in polynomial time.IM()
: Non-polynomial or non-exact algorithms from superclassElection
.not_IIA()
: Non-polynomial or non-exact algorithms from superclassElection
. IfIIA_subset_maximum_size
= 2, it runs in polynomial time and is exact up to ties (which can occur only ifV
is even).TM()
: Exact in polynomial time.UM()
: Non-polynomial or non-exact algorithms from superclassElection
.References:
‘Condorcet criterion, ordinality and reduction of coalitional manipulability’, François Durand, Fabien Mathieu and Ludovic Noirie, working paper, 2014.See also
-
candidates_by_scores_best_to_worst
¶ 1d array of integers.
If there is a Condorcet winner, candidates are sorted according to their (scalar) score.
Otherwise,
candidates_by_scores_best_to_worst
is the list of all candidates in the reverse order of their IRV elimination.By definition,
candidates_by_scores_best_to_worst[0]
=w
.
-
scores
¶ 1d or 2d array.
If there is a Condorcet winner, then
scores[c]
is the number of victories forc
inmatrix_duels_rk
.Otherwise,
scores[r, c]
is defined like inIRV
: it is the number of voters who vote for candidatec
at roundr
. For eliminated candidates,scores[r, c] = numpy.nan
. At the opposite,scores[r, c] = 0
means thatc
is present at roundr
but no voter votes forc
.
-
w
¶ Integer (winning candidate).