MyNixOS website logo
Description

Efficient Voting Methods for Committee Selection.

A fast 'Rcpp'-based implementation of polynomially-computable voting theory methods for committee ranking and scoring. The package includes methods such as Approval Voting (AV), Satisfaction Approval Voting (SAV), sequential Proportional Approval Voting (PAV), and sequential Phragmen's Rule. Weighted variants of these methods are also provided, allowing for differential voter influence.

fastVoteR

R-CMD-check Codecov testcoverage

Overview

fastVoteR is an R package with Efficient Rcpp Voting Methods for Committee Selection.

Still under development.

Installation

Development version:

# install.packages("pak")
pak::pak("bblodfon/fastVoteR")

Usage

library(fastVoteR)

# 5 candidates
candidates = paste0("V", seq_len(5))
candidates
#> [1] "V1" "V2" "V3" "V4" "V5"

# 4 voters
voters = list(
  c("V3", "V1", "V4"),
  c("V3", "V1"),
  c("V3", "V2"),
  c("V2", "V4")
)
voters
#> [[1]]
#> [1] "V3" "V1" "V4"
#> 
#> [[2]]
#> [1] "V3" "V1"
#> 
#> [[3]]
#> [1] "V3" "V2"
#> 
#> [[4]]
#> [1] "V2" "V4"

set.seed(42)

# voter weights
weights = c(1.1, 2.5, 0.8, 0.9)

# Approval voting (all voters equal)
rank_candidates(voters, candidates)
#>    candidate score norm_score borda_score
#>       <char> <num>      <num>       <num>
#> 1:        V3     3       0.75        1.00
#> 2:        V1     2       0.50        0.75
#> 3:        V2     2       0.50        0.50
#> 4:        V4     2       0.50        0.25
#> 5:        V5     0       0.00        0.00

# Approval voting (voters unequal)
rank_candidates(voters, candidates, weights)
#>    candidate score norm_score borda_score
#>       <char> <num>      <num>       <num>
#> 1:        V3   4.4  0.8301887        1.00
#> 2:        V1   3.6  0.6792453        0.75
#> 3:        V4   2.0  0.3773585        0.50
#> 4:        V2   1.7  0.3207547        0.25
#> 5:        V5   0.0  0.0000000        0.00

# Satisfaction Approval voting (voters unequal)
rank_candidates(voters, candidates, weights, method = "sav")
#>    candidate     score norm_score borda_score
#>       <char>     <num>      <num>       <num>
#> 1:        V3 2.0166667  0.8175676        1.00
#> 2:        V1 1.6166667  0.6554054        0.75
#> 3:        V2 0.8500000  0.3445946        0.50
#> 4:        V4 0.8166667  0.3310811        0.25
#> 5:        V5 0.0000000  0.0000000        0.00

# Sequential Proportional Approval voting (voters equal)
rank_candidates(voters, candidates, method = "seq_pav")
#>    candidate borda_score
#>       <char>       <num>
#> 1:        V3        1.00
#> 2:        V2        0.75
#> 3:        V1        0.50
#> 4:        V4        0.25
#> 5:        V5        0.00

Related work

See vote and votesys R packages. For strictly ABC-voting rules, see abcvoting Python package.


Code of Conduct

Please note that the fastVoteR project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

0.0.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows