Home > Cumulative-Tranferable-Vote

Cumulative-Tranferable-Vote

Cumulative-Tranferable-Vote is a project mainly written in Python, it's free.

Python code to run a CTV multi-winner election, using input from a CSV file

Cumulative Transferable Voting Copyright (C) 2010-2011, Louis G. "Ted" Stern

The Problem:

Run an election that gives proportional representation, using range ballots.

Existing competitors:

  • Single Transferable Vote uses ranked ballots, and usually uses Droop Quota. This ensures that a majority party will receive a majority of the seats, but is not fully representative.

  • Cumulative Vote is semi-representational, but can eliminate candidates on the last one or two seats due to vote splitting. This means that minority factions won't be well represented.

  • Reweighted Range Voting: Developed by Warren Smith (rangvoting.org), uses a Range Ballot.

I like Cumulative Vote because it gives a total single vote to each voter, like STV, but uses all of the voter's preferences at every stage, like Range Voting. The only problem is loss of representation due to vote splitting or failure to distribute over-quota votes to other members of a faction.

To solve that problem, I run a series of rounds as in STV. In each round, over-quota or eliminated votes for a candidate are transferred to the remaining non-eliminated and non-seated candidates in proportion to their current vote totals.

Votes are read as CSV format from a *.csv file or stdin.

The first line of the file is the list of candidates.

Subsequent lines are the individual scores, with blanks corresponding to zero score.

Scores are assumed to be integers, but are converted to floats internally and each ballot is normalized to a total score of 1.0.

See ctv.py commments and output from './ctv.py --help' for more info.

For example, using june2011.csv file with results from http://rangevoting.org/June2011RealWorldRRVvotes.txt, you would run as follows:

./ctv.py -n 9 -q hare -v -f june2011.csv

Alternatively, you can create a sample ballot using sample_ballot.py and run from stdin as follows:

./sample_ballot.py | ./ctv.py -n 5 -q hare -v -f -

If you want to exclude a candidate, use the Unix tool 'cut' as follows.

Let's say we are excluding candidate '102' in the 2nd field:

cut -f1,3- -d, june2011.csv | ./ctv.py -n 9 -q hare -v -f -

EXAMPLES:

  1. june2011.csv, containing results from http://rangevoting.org/June2011RealWorldRRVvotes.txt

  2. unger.csv, containing example that has undesirable results with STV, from http://rangevoting.org/STVPRunger.html, using Borda scores.

  3. unger_new.csv, deleting two ballots from unger.csv as described in web page above.

Previous:toss