copeland¶
- class corankco.algorithms.copeland.copeland.CopelandMethod¶
Copeland’s method is one of the most famous electoral system published in : A. H. Copeland, A reasonable social welfare function, seminar on Applications of Mathematics to the social sciences, University of Michigan, 1951. Complexity: O(nb_elements² * nb_rankings) This method can be easily adapted to incomplete rankings with ties using the framework of Andrieu et al., 2023 A victory for x against y becomes before(x,y) < before(y,x), score += 1 for x and += 0 for y An equality for x against y becomes before(x,y) = before(y,x), score += 0.5 for both x and y
- compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking=True, bench_mode=False) ConsensusSingleRanking ¶
Calculate and return the consensus rankings based on the given dataset and scoring scheme.
- Parameters:
dataset (Dataset) – The dataset of rankings to be aggregated.
scoring_scheme (ScoringScheme) – The scoring scheme to be used for calculating consensus.
return_at_most_one_ranking (bool) – If True, the algorithm should return at most one ranking.
bench_mode (bool) – If True, the algorithm may return additional information for benchmarking purposes.
- Returns:
Consensus rankings. If the algorithm is unable to provide multiple consensuses or
return_at_most_one_ranking is True, a single consensus ranking is returned. :rtype: Consensus :raise ScoringSchemeNotHandledException: When the algorithm cannot compute the consensus because the implementation does not support the given scoring scheme.
- get_full_name() str ¶
Return the full name of the algorithm.
- Returns:
The string ‘CopelandMethod’.
- Return type:
str
- is_scoring_scheme_relevant_when_incomplete_rankings(scoring_scheme: ScoringScheme) bool ¶
Check if the scoring scheme is relevant when the rankings are incomplete.
- Parameters:
scoring_scheme (ScoringScheme) – The scoring scheme to be checked.
- Returns:
True as CopelandMethod can handle any ScoringScheme
- Return type:
bool