cdc_dodgson {votesys}R Documentation

Dodgson Method

Description

The original Dodgson method checks the number of votes each candidate has to rob from other candidates; the winner is with the smallest number. However, the function cdc_dodgson uses two alternative methods rather than the original Dodgson method. The two methods are Tideman score method and Dodgson Quick method. See Details.

Usage

cdc_dodgson(x, allow_dup = TRUE, min_valid = 1, dq_t = "dq")

Arguments

x

it accepts the following types of input: 1st, it can be an object of class vote. 2nd, it can be a user-given Condorcet matrix, 3rd, it can be a result of another Condorcet method, which is of class condorcet.

allow_dup

whether ballots with duplicated score values are taken into account. Default is TRUE.

min_valid

default is 1. If the number of valid entries of a ballot is less than this value, it will not be used.

dq_t

the alternative Dodgson methods to be used. Default is "dq", for Dodgson Quick method; it can also be "t", Tideman score method.

Details

Suppose the candidates are A, B, C and D. If A wins B in pairwise comparison or has equal votes with B, then add 0 to A. If C wins A, then add to A adv(C, A), that is, the number of voters that prefer C than A, minus the number of voters that prefer A than A. Again, if D wins A, then add to A that number. Then, we sum up the points belong to A. We do the same thing to B, C and D. The one gets the least points is the winner. This is what we do in Tideman score method. In Dodgson Quick method, we first compute the number of votes, then divide it by 2 and get the ceiling, and sum all of them up.

Value

a condorcet object, which is essentially a list.

References

Examples

raw <- list2ballot(
    x = list(
        c('A', 'B', 'C', 'D', 'E', 'F'), 
        c('F', 'A', 'B', 'C', 'D', 'E'),
        c('E', 'D', 'C', 'B', 'F', 'A'),
        c('B', 'A', 'C', 'D', 'E', 'F'),
        c('F', 'E', 'D', 'C', 'B', 'A'),
        c('F', 'B', 'A', 'C', 'D', 'E'),
        c('E', 'D', 'C', 'A', 'F', 'B'),
        c('E', 'B', 'A', 'C', 'D', 'F'),
        c('F', 'D', 'C', 'A', 'E', 'B'),
        c('D', 'B', 'A', 'C', 'E', 'F'),
        c('F', 'E', 'C', 'A', 'D', 'B')
    ), 
    n = c(19, 12, 12, 9, 9, 10, 10 , 10 , 10, 10, 10)
)
vote <- create_vote(raw, xtype = 3, candidate = c('A', 'B', 'C', 'D', 'E', 'F'))
win1 <- cdc_simple(vote) # no winner
win2 <- cdc_dodgson(vote, dq_t = "dq") # A
win2 <- cdc_dodgson(win1, dq_t = "dq") # A
win3 <- cdc_dodgson(vote, dq_t = "t") # B
win3 <- cdc_dodgson(win2, dq_t = "t") # B

[Package votesys version 0.1.1 Index]