Invariance Axioms

Block Invariance

pref_voting.invariance_axioms.has_block_invariance_violation(edata, vm, verbose=False)[source]

Returns True if adding a block of all linear orders changes the set of winners.

Parameters:
  • edata (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:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_block_invariance_violations(edata, vm, verbose=False)[source]

Returns the symmetric difference of the winners before and after adding a block of all linear orders.

Parameters:
  • edata (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:

A list of the symmetric difference between the old and new winners.

Return type:

return_value

Upward Block Preservation

pref_voting.invariance_axioms.has_upward_block_preservation_violation(edata, vm, verbose=False)[source]

Returns True if adding a block of all linear orders causes some winner to lose.

Parameters:
  • edata (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:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_upward_block_preservation_violations(edata, vm, verbose=False)[source]

Returns the set of winners who lose as a result of adding a block of all linear orders.

Parameters:
  • edata (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:

the set of winners who lose as a result of adding a block of all linear orders.

Return type:

return_value

Upward Block Preservation

pref_voting.invariance_axioms.has_downward_block_preservation_violation(edata, vm, verbose=False)[source]

Returns True if adding a block of all linear orders causes some loser to win.

Parameters:
  • edata (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:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_downward_block_preservation_violations(edata, vm, verbose=False)[source]

Returns the set of losers who win as a result of adding a block of all linear orders.

Parameters:
  • edata (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:

the set of losers who win as a result of adding a block of all linear orders.

Return type:

return_value

Homogeneity

pref_voting.invariance_axioms.has_homogeneity_violation(edata, vm, num_copies, verbose=False)[source]

Returns True if replacing each ranking with num_copies of that ranking changes the set of winners.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_homogeneity_violations(edata, vm, num_copies, verbose=False)[source]

Returns the symmetric difference of the winners before and after multiplying the number of copies of each ranking.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

A list of the symmetric difference between the old and new winners.

Return type:

return_value

Upward Homogeneity

pref_voting.invariance_axioms.has_upward_homogeneity_violation(edata, vm, num_copies, verbose=False)[source]

Returns True if replacing each ranking with num_copies of that ranking causes some winner to lose.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_upward_homogeneity_violations(edata, vm, num_copies, verbose=False)[source]

Returns the set of winners who lose as a result of replacing each ranking with num_copies of that ranking.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

the set of winners who lose as a result of replacing each ranking with num_copies of that ranking.

Return type:

return_value

Downward Homogeneity

pref_voting.invariance_axioms.has_downward_homogeneity_violation(edata, vm, num_copies, verbose=False)[source]

Returns True if replacing each ranking with num_copies of that ranking causes some loser to win.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

Returns True if there is a violation and False otherwise.

Return type:

Result of the test (bool)

pref_voting.invariance_axioms.find_all_downward_homogeneity_violations(edata, vm, num_copies, verbose=False)[source]

Returns the set of losers who win as a result of replacing each ranking with num_copies of that ranking.

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

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

  • num_copies (int) – The number of copies to multiply each ranking by.

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

Returns:

the set of losers who win as a result of replacing each ranking with num_copies of that ranking.

Return type:

return_value