Plurality

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

Plurality.

Inherits functions and optional parameters from superclasses ElectionResult and Election.

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

Each voter votes for one candidate. The candidate with most votes is declared the winner. In case of a tie, the tied candidate with lowest index wins.

Sincere voters vote for their top-ranked candidate.

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

CM(), ICM(), IM(), TM(), UM(): Exact in polynomial time.

ballots

1d array of integers. ballots[v] is the candidate on voter v‘s ballot.

scores

1d array of integers. scores[c] is the number of voters who vote for candidate c.

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.