votes
    Preparing search index...

    Class MinimaxTD<C>

    Requested in https://github.com/lzear/votes/issues/76

    The Minimax-TD process:

    1. Do the pairwise comparisons using Margins (the number of voters ranking X above Y minus the number of voters ranking Y above X. )
    2. Find the Smith Set, the smallest non-empty set of candidates such that each member defeats every candidate outside the set in a pairwise comparison. That Algorithm may be found here.
    3. If there is one member of the Smith set, that is the winner.
    4. If there are multiple members of the Smith set, using Margins Minimax method, the candidate in the Smith set with the lowest 'worst pairwise defeat' (which can be negative, equivalent to the lowest 'worst pairwise victory' if there are no defeats) is the winner. See examples below...
    5. Remove the winner and repeat the process to find each successive place (2nd, 3rd, etc)

    A, B, and C are the members of the Smith set.

    • A beat B: 58% to 42%. (16% margin)
    • B beat C: 68% to 32% (36% margin)
    • C beat A: 70% to 30%. (40% margin)
    • A beat D: 55% to 45%. (10% margin)
    • B beat D: 60% to 40%. (20% margin)
    • C beat D: 99% to 1%. (98% margin)

    Look for the lowest 'worst pairwise defeat' in all of the comparisons (not just within the smith set):

    • A's 'worst pairwise defeat' is 40% margin against C (70%-30%)
    • B's 'worst pairwise defeat' is 16% margin against A (58%-42%)
    • C's 'worst pairwise defeat' is 36% margin against B (68%-32%)

    B has the smallest 'worst pairwise defeat', therefore B is the winner.

    A and B are the members of the Smith set. Both of them beat every other candidate but they tied each other.

    • A tied B: 50% to 50% (0% margin)
    • A beat C: 68% to 32% (36% margin)
    • A beat D: 99% to 1% (98% margin)
    • B beat C: 70% to 30% (40% margin)
    • B beat D: 60% to 40% (20% margin)
    • C beat D: 55% to 45% (10% margin)

    Look for the lowest 'worst pairwise defeat', and since there are no defeats, look for the lowest 'worst pairwise victory' (not just within the smith set):

    • A's 'worst pairwise victory' is -36% margin against C (32% -68%)
    • B's 'worst pairwise victory' is -20% margin against C (40% -60%)

    A has the lowest "worst pairwise victory" against all the candidates, therefore A is the winner.

    Type Parameters

    • C extends string

    Hierarchy (View Summary)

    Index
    candidates: C[]
    excludeTies: boolean
    minimaxVariant: MinimaxVariant
    isRandom: boolean = false
    needsBallot: boolean = false
    needsMatrix: true
    Variants: typeof MinimaxVariant = MinimaxVariant
    • Ranking 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.

      Returns C[][]

    • 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' ] ]

      Returns C[][]

    • Return a new instance of the same method restricted to a subset of candidates.

      Type Parameters

      • D extends string

      Parameters

      • candidates: D[]

      Returns MatrixScoreMethod<D>