ReadonlycandidatesReadonlymaxStatic ReadonlyisStatic ReadonlylabelRanking built by repeated wins instead of the method's own full ranking: run the method, record the winning tier, then re-run it restricted to the remaining candidates for the next place, and so on.
Differs from ranking() whenever the method's full ranking disagrees
with how it ranks subsets — e.g. instant runoff orders losers by
elimination time, while iterating re-elects a winner at every place.
Result of the vote. The first item lists the winners of the vote.
For example this ranking means that Bear wins, Sheep is second and Lion third
[ [ 'Bear' ], [ 'Sheep' ], [ 'Lion' ] ]
Return a new instance of the same method restricted to a subset of candidates, ranking as if only they ran.
StaticwithThe method as an Election method, with options for its constructor and
mode or label.
Optionallabel?: stringName in traces (TieBreakStep.name, StepResult.name) instead of the
method's label.
Optionalmode?: "restricted" | "full" | "recursive"Which candidates the method ranks a tie among: the tied ones
('restricted', default), everyone ('full'), or the tied ones, then
those of each tie that leaves, until none splits ('recursive').
Scores are how many candidates each one ranks above, averaged over the best orders. Runs in O(n·2ⁿ) time and memory: slow beyond ~20 candidates.
scores()throws beyondmaxCandidates(default 20, at most 30): about 16 keep it within tens of milliseconds.Wikipedia: Kemeny–Young method