Voting Utilities

Download C++ and Java source for Borda, Condorcet, Raw Rated, Acceptance and Instant Runoff voting.

Aside from using the code to write your own things, there's a wrapper program that reads voting data of a certain format and tallies it.

Usage

vote [-bBcdfhHpqRrw][-n number of choices][-i vote file][vote file ...]
        -b      binary
        -B      text (default)
        -c      Condorcet
        -D      Borda count (default)
        -d      integer (default)
        -f      float (-1.0 .. 1.0)
        -h      this help
        -H      output html table
        -i f    immediately load and run vote file f
        -I      Instant Runoff Vote
        -n N    number of choices
        -N f    file with names of choices
        -p      print full state, not just winner
        -q      quiet, don't print winner
        -R      numbers are rankings (1 best) (default)
        -r      numbers are ratings (higher better)
        -s      script friendly output (zero indexed \n separated list of winners)
        -S      make histogram of ranked or rated votes
        -T #    histogram style #
        -w      Raw Sum of ratings
	-Y	verify that votes are valid

File Format

The preferred file format is ascii text, one vote per line, tab separated, no other text (no comments). Vote data can be rankings or ratings, floating point or integer. Examples are included in the test directory.

Files can also be binary data. There is no metadata, it's just an array of 32 bit int or float (in current machine's endianness) data, (choices)*(votes) items long.

Bugs

Vote data is not be verified. It is assumed that the software collecting the votes only accepts valid input. (there are library functions for validation)

File format is also not verified.

Acceptance Voting is implemented by using '-w' raw summation on data externally thresholded to 0 and 1

Allows you to use floating point data for rankings. Don't do that. There is no Nth-and-a-half place.


Brian's voting theory and simulations page
Email me.