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.
Note
This axiom is studied in https://doi.org/10.1007/s11127-023-01042-3 and is closely related to an axiom mentioned in https://doi.org/10.1016/0022-0531(83)90024-8.
- Parameters:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
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_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.
Note
This axiom is studied in https://doi.org/10.1007/s11127-023-01042-3 and is closely related to an axiom mentioned in https://doi.org/10.1016/0022-0531(83)90024-8.
- Parameters:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
vm (VotingMethod) – A voting method to test.
verbose (bool, default=False) – If a violation is found, display the violation.
- 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.
Note
This axiom was introduced in https://doi.org/10.1007/s11127-023-01042-3.
- Parameters:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
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_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.
Note
This axiom was introduced in https://doi.org/10.1007/s11127-023-01042-3.
- Parameters:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
vm (VotingMethod) – A voting method to test.
verbose (bool, default=False) – If a violation is found, display the violation.
- 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:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
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_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:
edata (Profile, ProfileWithTies, MarginGraph) – Any election data that has a margin method.
vm (VotingMethod) – A voting method to test.
verbose (bool, default=False) – If a violation is found, display the violation.
- 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.
Independence of Clones¶
- pref_voting.variable_candidate_axioms.has_independence_of_clones_violation(prof, vm, clone_def='Tideman', conditions_to_check='all', verbose=False)[source]¶
Independence of Clones: returns True if there is a set C of clones and a clone c in C such that removing c either (i) changes which non-clones (candidates not in C) win or (ii) changes whether any clone in C wins. We call (i) a violation of “non-clone choice is independent of clones” (NCIC) and call (ii) a violation of “clone choice is independent of clones” (CIC).
- Parameters:
prof (Profile) – the election data.
vm (VotingMethod) – A voting method to test.
clone_def (str, default="Tideman") – The definition of clones. Currently only “Tideman” is supported.
conditions_to_check (str, default="all") – The conditions to check. If “all”, then both NCIC and CIC are checked. If “NCIC”, then only NCIC is checked. If “CIC”, then only CIC is checked.
verbose (bool, default=False) – If a violation is found, display the violation.
- pref_voting.variable_candidate_axioms.find_all_independence_of_clones_violations(prof, vm, clone_def='Tideman', conditions_to_check='all', verbose=False)[source]¶
Returns all violations of Independence of Clones for the given election data and voting method.
- Parameters:
prof (Profile) – the election data.
vm (VotingMethod) – A voting method to test.
clone_def (str, default="Tideman") – The definition of clones. Currently only “Tideman” is supported.
conditions_to_check (str, default="all") – The conditions to check. If “all”, then both NCIC and CIC are checked. If “NCIC”, then only NCIC is checked. If “CIC”, then only CIC is checked.
verbose (bool, default=False) – If a violation is found, display the violation.
- Returns:
List whose elements are either triples of the form (clone_set,clone,non-clone) or pairs of the form (clone_set,clone). If the triple (clone_set,clone,non-clone) is returned, then non-clone choice is not independent ot clones. If the pair (clone_set,clone) is returned, then clone choice is not independent of clones.