Nanson¶
-
class
svvamp.
Nanson
(population, **kwargs)[source]¶ Nanson method.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.Nanson(pop)
At each round, all candidates with a Borda score strictly lower than average are simultaneously eliminated. When all remaining candidates have the same Borda score, it means that the matrix of duels (for this subset of candidates) has only ties. Then the candidate with lowest index is declared the winner.
Since a Condorcet winner has always a Borda score higher than average, Nanson method meets the Condorcet criterion.
CM()
: Deciding CM is NP-complete. Non-polynomial or non-exact algorithms from superclassElection
.ICM()
: Exact in polynomial time.IM()
: Deciding IM is NP-complete. 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:
‘Complexity of and algorithms for the manipulation of Borda, Nanson’s and Baldwin’s voting rules’, Jessica Davies, George Katsirelos, Nina Narodytska, Toby Walsh and Lirong Xia, 2014.-
candidates_by_scores_best_to_worst
¶ 1d array of integers. Candidates are sorted according to their order of elimination. When several candidates are eliminated during the same round, they are sorted by Borda score at that round and, in case of a tie, by their index (highest indexes are eliminated first).
By definition / convention,
candidates_by_scores_best_to_worst[0]
=w
.
-
scores
¶ 2d array of integers.
scores[r, c]
is the Borda score of candidatec
at elimination roundr
.By convention, if candidate
c
does not participate to roundr
, thenscores[r, c] = numpy.inf
.
-
w
¶ Integer (winning candidate).
-