Baldwin

class svvamp.Baldwin(population, **kwargs)[source]

Baldwin method.

Inherits functions and optional parameters from superclasses ElectionResult and Election.

Example:
>>> import svvamp
>>> pop = svvamp.PopulationSpheroid(V=100, C=5)
>>> election = svvamp.Baldwin(pop)

Each voter provides a strict order of preference. The candidate with lowest Borda score is eliminated. Then the new Borda scores are computed. Etc. Ties are broken in favor of lower-index candidates: in case of a tie, the candidate with highest index is eliminated.

Since a Condorcet winner has always a Borda score higher than average, Baldwin method meets the Condorcet criterion.

CM(): Non-polynomial or non-exact algorithms from superclass Election.

ICM(): Exact in polynomial time.

IM(): Deciding IM is NP-complete. Non-polynomial or non-exact algorithms from superclass Election.

not_IIA(): Exact in polynomial time.

TM(): Exact in polynomial time.

UM(): Non-polynomial or non-exact algorithms from superclass Election.

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_by_scores_best_to_worst[-r] is the candidate eliminated at elimination round r.

By definition / convention, candidates_by_scores_best_to_worst[0] = w.

scores

2d array of integers. scores[r, c] is the Borda score of candidate c at elimination round r.

By convention, if candidate c does not participate to round r, then scores[r, c] = numpy.inf.

w

Integer (winning candidate).