Variable Candidate Axioms

Stability for Winners

pref_voting.variable_candidate_axioms.has_stability_for_winners_violation(edata, vm, verbose=False, strong_stability=False)[source]

Returns True if there is some candidate A who wins without another candidate B in the election, A is majority preferred to B, but A loses when B is included in the election.

If strong_stability is True, then A can be weakly majority preferred to B.

Parameters:
Returns:

True if there is a violation, False otherwise.

Return type:

bool

pref_voting.variable_candidate_axioms.find_all_stability_for_winners_violations(edata, vm, verbose=False, strong_stability=False)[source]

Returns all violations of Stability for Winners (some candidate A wins without another candidate B in the election, A is majority preferred to B, but A loses when B is included in the election) for the given election data and voting method.

If strong_stability is True, then A can be weakly majority preferred to B.

Parameters:
Returns:

List of pairs (cand1,cand2) where cand1 wins without cand2 in the election, cand1 is majority preferred to cand2, but cand1 loses when cand2 is included in the election.

Immunity to Spoilers

pref_voting.variable_candidate_axioms.has_immunity_to_spoilers_violation(edata, vm, verbose=False, strong_immunity=False)[source]

Returns True if there is some candidate A who wins without another candidate B in the election, A is majority preferred to B, but both A and B lose when B is included in the election.

If strong_immunity is True, then A can be weakly majority preferred to B.

Parameters:
Returns:

True if there is a violation, False otherwise.

Return type:

bool

pref_voting.variable_candidate_axioms.find_all_immunity_to_spoilers_violations(edata, vm, verbose=False, strong_immunity=False)[source]

Returns all violations of Immunity to Spoilers (some candidate A wins without another candidate B in the election, A is majority preferred to B, but both A and B lose when B is included in the election) for the given election data and voting method.

If strong_immunity is True, then A can be weakly majority preferred to B.

Parameters:
Returns:

List of pairs (cand1,cand2) where cand1 wins without cand2 in the election, cand1 is majority preferred to cand2, but both cand1 and cand2 lose when cand2 is included in the election.

Independence of Smith-Dominated Alternatives

pref_voting.variable_candidate_axioms.has_ISDA_violation(edata, vm, verbose=False)[source]

Independence of Smith-Dominated Alternatives: returns True if there is a candidate A outside of the Smith set such that removing A changes the set of winners according to the voting method vm.

Parameters:
Returns:

True if there is a violation, False otherwise.

Return type:

bool

pref_voting.variable_candidate_axioms.find_all_ISDA_violations(edata, vm, verbose=False)[source]

Returns all violations of ISDA (some candidate A outside of the Smith set such that removing A changes the set of winners according to the voting method vm) for the given election data and voting method.

Parameters:
Returns:

List of candidates A outside of the Smith set such that removing A changes the set of winners according to the voting method vm.

Independence of Pareto-Dominated Alternatives

pref_voting.variable_candidate_axioms.has_IPDA_violation(prof, vm, verbose=False, strong_Pareto=False)[source]

Independence of Pareto-Dominated Alternatives: returns True if there is a candidate A who is Pareto-dominated by another candidate B such that removing A changes the set of winners according to the voting method vm.

If strong_Pareto is True, then a candidate A is dominated if there is a candidate B such that some voter prefers B to A and no voter prefers A to B.

Parameters:
  • prof (Profile, ProfileWithTies) – the election data.

  • vm (VotingMethod) – A voting method to test.

  • verbose (bool, default=False) – If a violation is found, display the violation.

Returns:

True if there is a violation, False otherwise.

Return type:

bool

pref_voting.variable_candidate_axioms.find_all_IPDA_violations(prof, vm, verbose=False, strong_Pareto=False)[source]

Returns all violations of IPDA (some candidate A who is Pareto-dominated by another candidate B such that removing A changes the set of winners according to the voting method vm) for the given election data and voting method.

If strong_Pareto is True, then a candidate A is dominated if there is a candidate B such that some voter prefers B to A and no voter prefers A to B.

Parameters:
  • prof (Profile, ProfileWithTies) – the election data.

  • vm (VotingMethod) – A voting method to test.

  • verbose (bool, default=False) – If a violation is found, display the violation.

Returns:

List of candidates A who are Pareto-dominated by another candidate such that removing A changes the set of winners according to the voting method vm.