ICRV

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

Instant-Condorcet Runoff Voting (ICRV).

Inherits functions and optional parameters from superclasses ElectionResult and Election.

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

Principle: eliminate candidates as in IRV; stop as soon as there is a Condorcet winner.

Even round r (including round 0): if a candidate w has only victories against all other non-eliminated candidates (i.e. is a Condorcet winner in this subset, in the sense of matrix_victories_rk), then w is declared the winner.

Odd round r: the candidate who is ranked first (among non-eliminated candidates) by least voters is eliminated, like in IRV.

This method meets the Condorcet criterion.

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

ICM(): Exact in polynomial time.

IM(): 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:

‘Four Condorcet-Hare Hybrid Methods for Single-Winner Elections’, James Green-Armytage, 2011.
candidates_by_scores_best_to_worst

1d array of integers.

Candidates that are not eliminated at the moment a Condorcet winner is detected are sorted by their number of victories in matrix_victories_rk (restricted to candidates that are not eliminated at that time).

Other candidates are sorted in the reverse order of their IRV elimination.

By definition, candidates_by_scores_best_to_worst[0] = w.

scores

2d array.

For even rounds r (including round 0), scores[r, c] is the number of victories for c in matrix_victories_rk (restricted to non-eliminated candidates). Ties count for 0.5.

For odd rounds r, scores[r, c] is the number of voters who rank c first (among non-eliminated candidates).

w

Integer (winning candidate).