RCV is a simple ranked-choice voting implementation using an instant-runoff algorithm.
Instant runoff works as follows:
- Count the number of 1st-ranked votes for each candidate
- If any candidate reaches 50% of the votes, they win
- If no candidate reaches 50%, eliminate the candidate with the lowest number of 1st-ranked votes
- Allocate the ballots for the just-eliminated candidate to each ballot’s next-highest-ranked active candidate
- GOTO 1
My motivation for building RCV was to better understand the dynamics of instant-runoff elections. Installation steps are below, but I have the same code running on my website if you just want to try it out.
At a command line:
git clone [email protected]:segdeha/rcv.git
cd rcv
python -m http.server
open http://localhost:8000
- Add candidates to the ballot (or use the “Seed ballot” link to add sample candidates)
- Drag candidates from the “Unranked” area to the “Ranked” area and order them in order of preference
- Add a name for the person submitting the ballot (optional, if left blank a random name will be generated)
- Click “Cast ballot”