RuleCondorcetDictatorship#

class svvamp.RuleCondorcetDictatorship(**kwargs)[source]#

Condorcet-dictatorship rule.

Options#

>>> RuleCondorcetDictatorship.print_options_parameters()
cm_option: ['fast', 'exact']. Default: 'fast'.
icm_option: ['exact']. Default: 'exact'.
iia_subset_maximum_size: is_number. Default: 2.
im_option: ['lazy', 'exact']. Default: 'lazy'.
precheck_heuristic: is_bool. Default: True.
tm_option: ['exact']. Default: 'exact'.
um_option: ['exact']. Default: 'exact'.

Notes

Each voter must provide a strict total order. If there is a Condorcet winner (in the sense of matrix_victories_rk), then she is elected. Otherwise, the candidate ranked first by voter 0 (the dictator) is elected.

This rule is a very simple Condorcet-consistent rule: it meets the Condorcet criterion but is not anonymous. As a consequence, it does not meet the criteria “with candidate tie-breaking” (e.g. if half of the voters rank candidate 0 first, she does not necessarily win). Contrary to the other rules of SVVAMP, the position of each voter in the profile matters. In particular, for the manipulation problems where a coalition of a given size is considered (cf. necessary_coalition_size_cm_, sufficient_coalition_size_cm_ and their counterparts for ICM), the following convention is used: if voter 0 does not prefer c to the sincere winner w (in the sense of utilities), she is a sincere voter and never joins the coalition; if she prefers c to w, she is considered as the first manipulator, i.e. she belongs to the coalition as soon as it is not empty.

  • is_cm_():

    • cm_option = 'fast': Polynomial algorithm. It is exact, except when the candidates whom the manipulators must prevent from being a Condorcet winner cannot be handled one after the other (cf. prevent_condorcet_winner()). In that case, it may return numpy.nan.

    • cm_option = 'exact': Exact algorithm. It is polynomial in the number of voters, but its cost may be exponential in the number of candidates (in practice, it is much faster than the exhaustive algorithm of the superclass Rule).

  • is_icm_(): Exact in polynomial time.

  • is_im_(): Non-polynomial or non-exact algorithms from superclass Rule.

  • is_iia(): Exact in polynomial time.

  • is_tm_(): Exact in polynomial time.

  • is_um_(): Exact in polynomial time.

Examples

>>> profile = Profile(preferences_ut=[
...     [ 0. , -0.5, -1. ],
...     [ 1. , -1. ,  0.5],
...     [ 0.5,  0.5, -0.5],
...     [ 0.5,  0. ,  1. ],
...     [-1. , -1. ,  1. ],
... ], preferences_rk=[
...     [0, 1, 2],
...     [0, 2, 1],
...     [1, 0, 2],
...     [2, 0, 1],
...     [2, 1, 0],
... ])
>>> rule = RuleCondorcetDictatorship()(profile)
>>> rule.demo_results_(log_depth=0)

************************
*                      *
*   Election Results   *
*                      *
************************

***************
*   Results   *
***************
profile_.preferences_ut (reminder) =
[[ 0.  -0.5 -1. ]
 [ 1.  -1.   0.5]
 [ 0.5  0.5 -0.5]
 [ 0.5  0.   1. ]
 [-1.  -1.   1. ]]
profile_.preferences_rk (reminder) =
[[0 1 2]
 [0 2 1]
 [1 0 2]
 [2 0 1]
 [2 1 0]]
ballots =
[[0 1 2]
 [0 2 1]
 [1 0 2]
 [2 0 1]
 [2 1 0]]
scores =
[[1. 0. 0.]
 [2. 1. 0.]]
candidates_by_scores_best_to_worst
[0 1 2]
scores_best_to_worst
[[1. 0. 0.]
 [2. 1. 0.]]
w = 0
score_w = [1. 2.]
total_utility_w = 1.0

*********************************
*   Condorcet efficiency (rk)   *
*********************************
w (reminder) = 0

condorcet_winner_rk_ctb = 0
w_is_condorcet_winner_rk_ctb = True
w_is_not_condorcet_winner_rk_ctb = False
w_missed_condorcet_winner_rk_ctb = False

condorcet_winner_rk = 0
w_is_condorcet_winner_rk = True
w_is_not_condorcet_winner_rk = False
w_missed_condorcet_winner_rk = False

***************************************
*   Condorcet efficiency (relative)   *
***************************************
w (reminder) = 0

condorcet_winner_ut_rel_ctb = 0
w_is_condorcet_winner_ut_rel_ctb = True
w_is_not_condorcet_winner_ut_rel_ctb = False
w_missed_condorcet_winner_ut_rel_ctb = False

condorcet_winner_ut_rel = 0
w_is_condorcet_winner_ut_rel = True
w_is_not_condorcet_winner_ut_rel = False
w_missed_condorcet_winner_ut_rel = False

***************************************
*   Condorcet efficiency (absolute)   *
***************************************
w (reminder) = 0

condorcet_admissible_candidates =
[ True False False]
w_is_condorcet_admissible = True
w_is_not_condorcet_admissible = False
w_missed_condorcet_admissible = False

weak_condorcet_winners =
[ True False False]
w_is_weak_condorcet_winner = True
w_is_not_weak_condorcet_winner = False
w_missed_weak_condorcet_winner = False

condorcet_winner_ut_abs_ctb = 0
w_is_condorcet_winner_ut_abs_ctb = True
w_is_not_condorcet_winner_ut_abs_ctb = False
w_missed_condorcet_winner_ut_abs_ctb = False

condorcet_winner_ut_abs = 0
w_is_condorcet_winner_ut_abs = True
w_is_not_condorcet_winner_ut_abs = False
w_missed_condorcet_winner_ut_abs = False

resistant_condorcet_winner = nan
w_is_resistant_condorcet_winner = False
w_is_not_resistant_condorcet_winner = True
w_missed_resistant_condorcet_winner = False
>>> rule.demo_manipulation_(log_depth=0)

*****************************
*                           *
*   Election Manipulation   *
*                           *
*****************************

*********************************************
*   Basic properties of the voting system   *
*********************************************
with_two_candidates_reduces_to_plurality =  False
is_based_on_rk =  True
is_based_on_ut_minus1_1 =  False
meets_iia =  False

****************************************************
*   Manipulation properties of the voting system   *
****************************************************
Condorcet_c_ut_rel_ctb (False)     ==>     Condorcet_c_ut_rel (False)
 ||                                                               ||
 ||     Condorcet_c_rk_ctb (False) ==> Condorcet_c_rk (True)      ||
 ||           ||               ||       ||             ||         ||
 V            V                ||       ||             V          V
Condorcet_c_ut_abs_ctb (False)     ==>     Condorcet_ut_abs_c (True)
 ||                            ||       ||                        ||
 ||                            V        V                         ||
 ||       maj_fav_c_rk_ctb (False) ==> maj_fav_c_rk (True)        ||
 ||           ||                                       ||         ||
 V            V                                        V          V
majority_favorite_c_ut_ctb (False) ==> majority_favorite_c_ut (True)
 ||                                                               ||
 V                                                                V
IgnMC_c_ctb (False)                ==>                IgnMC_c (True)
 ||                                                               ||
 V                                                                V
InfMC_c_ctb (False)                ==>                InfMC_c (True)

*****************************************************
*   Independence of Irrelevant Alternatives (IIA)   *
*****************************************************
w (reminder) = 0
is_iia = True
log_iia: iia_subset_maximum_size = 2.0
example_winner_iia = nan
example_subset_iia = nan

**********************
*   c-Manipulators   *
**********************
w (reminder) = 0
preferences_ut (reminder) =
[[ 0.  -0.5 -1. ]
 [ 1.  -1.   0.5]
 [ 0.5  0.5 -0.5]
 [ 0.5  0.   1. ]
 [-1.  -1.   1. ]]
v_wants_to_help_c =
[[False False False]
 [False False False]
 [False False False]
 [False False  True]
 [False False  True]]

************************************
*   Individual Manipulation (IM)   *
************************************
is_im = nan
log_im: im_option = lazy
candidates_im =
[ 0.  0. nan]

*********************************
*   Trivial Manipulation (TM)   *
*********************************
is_tm = False
log_tm: tm_option = exact
candidates_tm =
[0. 0. 0.]

********************************
*   Unison Manipulation (UM)   *
********************************
is_um = False
log_um: um_option = exact
candidates_um =
[0. 0. 0.]

*********************************************
*   Ignorant-Coalition Manipulation (ICM)   *
*********************************************
is_icm = False
log_icm: icm_option = exact
candidates_icm =
[0. 0. 0.]
necessary_coalition_size_icm =
[0. 6. 4.]
sufficient_coalition_size_icm =
[0. 6. 4.]

***********************************
*   Coalition Manipulation (CM)   *
***********************************
is_cm = False
log_cm: cm_option = fast, um_option = exact, tm_option = exact
candidates_cm =
[0. 0. 0.]
necessary_coalition_size_cm =
[0. 2. 4.]
sufficient_coalition_size_cm =
[0. 2. 4.]
property candidates_by_scores_best_to_worst_#

1d array of integers. Candidates are sorted lexicographically by scores_, i.e. the Condorcet winner first if she exists, then the other candidates in the order of voter 0’s ranking.

Examples

>>> profile = Profile(preferences_rk=[[1, 0, 2], [0, 2, 1], [2, 1, 0]])
>>> rule = RuleCondorcetDictatorship()(profile)
>>> rule.candidates_by_scores_best_to_worst_
array([1, 0, 2])
>>> profile = Profile(preferences_rk=[[2, 1, 0], [1, 2, 0], [2, 0, 1]])
>>> rule = RuleCondorcetDictatorship()(profile)
>>> rule.candidates_by_scores_best_to_worst_
array([2, 1, 0])
property scores_#

2d array.

  • scores[0, c] is 1 if c is the Condorcet winner (in the sense of matrix_victories_rk), 0 otherwise.

  • scores[1, c] is the score of c in the fallback rule, i.e. the Borda score of c in the ranking of voter 0 (cf. preferences_borda_rk).

Examples

>>> profile = Profile(preferences_rk=[[1, 0, 2], [0, 2, 1], [2, 1, 0]])
>>> rule = RuleCondorcetDictatorship()(profile)
>>> rule.scores_
array([[0., 0., 0.],
       [1., 2., 0.]])
property w_#

Integer (winning candidate).

Default behavior: the candidate with highest value in vector scores_ is declared the winner. In case of a tie, the tied candidate with lowest index wins.