CondorcetVtbIRV

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

Condorcet Instant Runoff Voting

Inherits functions and optional parameters from superclasses ElectionResult and Election.

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 on IRV‘s fast algorithm. Polynomial heuristic. Can prove CM but unable to decide non-CM (except in rare obvious cases).
  • CM_option = 'slow': Rely on ExhaustiveBallot‘s exact algorithm. Non-polynomial heuristic (\(2^C\)). Quite efficient to prove CM or non-CM.
  • CM_option = 'almost_exact': Rely on IRV‘s exact algorithm. Non-polynomial heuristic (\(C!\)). Very efficient to prove CM or non-CM.
  • CM_option = 'exact': Non-polynomial algorithm from superclass Election.

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 superclass Election.

not_IIA(): Non-polynomial or non-exact algorithms from superclass Election. If IIA_subset_maximum_size = 2, it runs in polynomial time and is exact up to ties (which can occur only if V is even).

TM(): Exact in polynomial time.

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

References:

‘Condorcet criterion, ordinality and reduction of coalitional manipulability’, François Durand, Fabien Mathieu and Ludovic Noirie, working paper, 2014.
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 for c in matrix_duels_rk.

Otherwise, scores[r, c] is defined like in IRV: it is the number of voters who vote for candidate c at round r. For eliminated candidates, scores[r, c] = numpy.nan. At the opposite, scores[r, c] = 0 means that c is present at round r but no voter votes for c.

w

Integer (winning candidate).