CondorcetSumDefeats¶
-
class
svvamp.
CondorcetSumDefeats
(population, **kwargs)[source]¶ Condorcet with sum of defeats.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.CondorcetSumDefeats(pop)
An elementary move consists of reversing a voter’s preference about a pair of candidate
(c, d)
(without demanding that her whole relation of preference stays transitive). The score for candidatec
is minus the number of elementary moves needed so thatc
becomes a Condorcet winner.It is the same principle as Dodgson’s method, but without looking for a transitive profile.
In practice:
\[\texttt{scores}[c] = - \sum_{c \text{ does not beat } d}\left( \left\lfloor\frac{V}{2}\right\rfloor + 1 - \texttt{matrix_duels_rk}[c, d] \right)\]In particular, for
V
odd:\[\texttt{scores}[c] = - \sum_{c \text{ does not beat } d}\left( \left\lceil\frac{V}{2}\right\rceil - \texttt{matrix_duels_rk}[c, d] \right)\]CM()
: Non-polynomial or non-exact algorithms from superclassElection
.ICM()
: Algorithm from superclassElection
. It is polynomial and has a window of error of 1 manipulator.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
.-
scores
¶ 1d array of integers.
\[\texttt{scores}[c] = - \sum_{c \text{ does not beat } d}\left( \left\lfloor\frac{V}{2}\right\rfloor + 1 - \texttt{matrix_duels_rk}[c, d] \right)\]
-
w
¶ Integer (winning candidate).
- Default behavior in superclass
ElectionResult
: - The candidate with highest value in vector
scores
is declared the winner. In case of a tie, the tied candidate with lowest index wins.
- Default behavior in superclass
-