parcons

class corankco.algorithms.parcons.parcons.ParCons(auxiliary_algorithm: MedianRanking | None = None, bound_for_exact: int | None = None)

ParCons is a graph-based heuristics for Kemeny-Young rank aggregation published in P. Andrieu, B. Brancotte, L. Bulteau, S. Cohen-Boulakia, A. Denise, A. Pierrot, S. Vialette, Efficient, robust and effective rank aggregation for massive biological datasets. Future Generation Computer Systems, 2021, pp 406–421. Complexity: O(nb_elements² * nb_rankings) ParCons divides the initial problem into subproblems such that concatenating an optimal solutions of each subproblem forms an optimal solution for the initial problem. If the size of a given subproblem is <= 80 elements (can be modified), the exact algorithm is run If the size of a given subproblem is > 80 elements, another algorithm, given as attribute of the instance, is run to get a consensus for the subproblem. Note that this heuristics may be aware of having an optimal solution. If no auxiliary heuristics has been used for a given instance, the returned consensus is necessarily optimal.

compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking: bool = True, bench_mode: bool = False) Consensus

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
Returns:

the name of the Algorithm i.e. “ParCons, uses ” + the name of the auxiliary algorithm + ” on

subproblems of size > ” + the value of the associated parameter

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 iif the auxiliary algorithm is compatible with the scoring scheme

Return type:

bool