SWF Axioms

Pareto Ranking

pref_voting.swf_axioms.has_pareto_ranking_violation(prof, swf, verbose=False, strong_Pareto=False)[source]

Returns True if all voters rank x above y in prof, but the SWF does not rank x above y.

If verbose is True, prints the profile and the violation.

If strong_Pareto is True, then a violation occurs when all voters weakly prefer x to y, some voter strictly prefers x to y, but the SWF does not rank x above y.

Parameters:
  • prof – a Profile or ProfileWithTies

  • swf (SocialWelfareFunction) – An SWF 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.swf_axioms.find_all_pareto_ranking_violations(prof, swf, verbose=False, strong_Pareto=False)[source]

Returns a list of all pairs of candidates for which the SWF violates the Pareto ranking axiom.

If verbose is True, prints the profile and the violation.

If strong_Pareto is True, then a violation occurs when all voters weakly prefer x to y, some voter strictly prefers x to y, but the SWF does not rank x above y.

Parameters:
  • prof – a Profile or ProfileWithTies

  • swf (SocialWelfareFunction) – An SWF to test.

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

Returns:

List of all pairs of candidates for which there is a violation.

Return type:

List of violations (list)

Core Support

pref_voting.swf_axioms.has_core_support_violation(prof, swf, verbose=False)[source]

Returns True if the swf violates the “core support criterion” of https://arxiv.org/abs/2308.08430 for the given profile, False otherwise. If verbose is True, prints the profile and the core support violation.

Parameters:
  • prof – a Profile.

  • swf (SocialWelfareFunction) – An SWF 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.swf_axioms.find_all_core_support_violations(prof, swf, verbose=False)[source]

Returns a list of all pairs of candidates for which the swf violates the “core support criterion” of https://arxiv.org/abs/2308.08430 for the given profile. If verbose is True, prints the profile and the core support violation.

Parameters:
  • prof – a Profile.

  • swf (SocialWelfareFunction) – An SWF to test.

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

Returns:

List of all pairs of candidates for which there is a violation.

Return type:

List of violations (list)