exactalgorithm

class corankco.algorithms.exact.exactalgorithm.ExactAlgorithm(optimize=True)

This class provides a wrapper for exact ranking algorithms. It intelligently selects an appropriate exact algorithm depending on the availability of the Cplex library. If Cplex is not installed, the class defaults to a free solver.

The complexity of this algorithm is exponential. In practical use cases, it is expected to execute within a few seconds for ranking tasks involving fewer than 80 elements. For larger sets of elements, the performance will be significantly influenced by specific characteristics of the input rankings.

Particularly, if the size of the largest strongly connected component (as described in the research paper “Efficient, robust, and effective rank aggregation for massive biological datasets” (https://www.researchgate.net/publication/352277711_Efficient_robust_and_effective_rank_aggregation_for_massive_biological_datasets)) exceeds 100, the algorithm may not complete in a reasonable timeframe or may require excessive memory. This information can be determined using ParConsPartition class.

compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking: bool = True, bench_mode: bool = False) Consensus
Parameters:
  • dataset (Dataset (class Dataset in package 'datasets')) – A dataset containing the rankings to aggregate

  • scoring_scheme (ScoringScheme (class ScoringScheme in package 'distances')) – The penalty vectors to consider

  • return_at_most_one_ranking (bool) – the algorithm should not return more than one ranking

  • bench_mode (bool) – is bench mode activated. If False, the algorithm may return more information

:return one or more rankings if the underlying algorithm can find several equivalent consensus rankings If the algorithm is not able to provide multiple consensus, or if return_at_most_one_ranking is True then, it should return a list made of the only / the first consensus found. In all scenario, the algorithm returns a list of consensus rankings :raise ScoringSchemeNotHandledException when the algorithm cannot compute the consensus because the implementation of the algorithm does not fit with the scoring scheme

get_full_name() str
Returns:

The name of the algorithm, depends on which has been used between Cplex and PULP

is_scoring_scheme_relevant_when_incomplete_rankings(scoring_scheme: ScoringScheme)

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 ExactAlgorithmCplex can handle any ScoringScheme

Return type:

bool