ExhaustiveBallot¶
-
class
svvamp.
ExhaustiveBallot
(population, freeze_options=False, **kwargs)[source]¶ Exhaustive Ballot.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.ExhaustiveBallot(pop)
At each round, voters vote for one non-eliminated candidate. The candidate with least votes is eliminated. Then the next round is held. Unlike
IRV
, voters actually vote at each round. This does not change anything for sincere voting, but offers a bit more possibilities for the manipulators. In case of a tie, the candidate with highest index is eliminated.CM()
:ICM()
: Exact in polynomial time.IM()
:not_IIA()
: Non-polynomial or non-exact algorithms from superclassElection
.TM()
: Exact in polynomial time.UM()
:References:
‘Single transferable vote resists strategic voting’, John J. Bartholdi and James B. Orlin, 1991.
‘On The Complexity of Manipulating Elections’, Tom Coleman and Vanessa Teague, 2007.
‘Manipulability of Single Transferable Vote’, Toby Walsh, 2010.
See also
-
ballots
¶ 2d array of integers.
ballots[v, r]
is the candidate for which voterv
votes at roundr
.
-
candidates_by_scores_best_to_worst
¶ 1d array of integers.
candidates_by_scores_best_to_worst
is the list of all candidates in the reverse order of their elimination.By definition,
candidates_by_scores_best_to_worst[0]
=w
.
-
elimination_path
¶ 1d array of integers. Same as
candidates_by_scores_best_to_worst
, but in the reverse order.
-
margins
¶ 2d array.
margins[r, c]
is the number of votes thatc
must lose to be eliminated at roundr
(all other things being equal). The candidate who is eliminated at roundr
is the only one for whichmargins[r, c] = 0
.For eliminated candidates,
margins[r, c] = numpy.nan
.
-
scores
¶ 2d array.
scores[r, c]
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).
-