06_Other/RCV_IRV — RCV-IRV: the ranked ballot, counted by instant runoff¶
Rank the candidates 1st, 2nd, 3rd… then count in rounds — eliminate the last-place candidate and transfer their ballots, until someone holds a majority of what's still active.

The ballot (Equal Vote) — the same five candidates as the STAR, Approval and Ranked Robin ballots, so the four can be read side by side. This voter ranked all five, and the count reads them in order: if Andre is eliminated, the ballot moves to Carmen rather than dropping out. That transfer is the whole idea — it's what stops your honest first choice from splitting the vote with your second. Two printed lines are worth noting for later: "equal ranks are not allowed" (a restriction of this count rather than of ranked paper — Ranked Robin reads the identical ballot and does allow equal ranks), and the footer's "if your vote is unable to transfer, it is discarded" — exhausted ballots, which is why an IRV majority is a majority of the ballots still active rather than of everyone who voted.
A basic runnable RCV-IRV election and the vendored pyrankvote-based engine that counts ranked (A>C>B) or score ballots round by round.
New to RCV-IRV? The concept pages for this method live in concepts/. Start with RCV-IRV (Hare) for how the count actually works, then Why RCV-IRV — the case for it, made fairly for what the method gets right, and center squeeze for the critique this library builds on. If the name is what's confusing you — "RCV" names a ranked ballot, "IRV" names one way of counting it — Is it RCV or IRV? sorts that out. Everything below is the runnable example and the engine.
Where this library stands, so you can discount accordingly. This is a STAR Voting education repo: we argue that STAR and Ranked Robin pick better winners than instant runoff, and these pages make that argument. What we try not to do is win it cheaply. IRV's genuine strengths get their own page rather than a grudging footnote — it passes later-no-harm, mutual majority and clone independence, all of which STAR fails. Its failures are kept in proportion: Condorcet failures showed up in 2 of 182 US RCV elections studied, so "predictable in close three-way races" is the defensible claim and "usually elects the wrong winner" is not. And our own side's overreach gets its own table alongside the corrections aimed at RCV advocates. If a page here reads as a hit piece rather than an argument, that's a bug — say so.
The first two cases are ordinary elections — one minimal, one crowded and realistic. The four below them are deliberately pathological — tiny elections built to push the count into its awkward corners (elimination ties, a batch that empties the field), which is what makes them useful for testing an engine and useless as a picture of a typical RCV-IRV election. Read them as stress tests, not as evidence about how IRV usually behaves. For IRV in the wild, with real ballots, see the case studies — Alaska 2022 and a century in Australia, the latter assessed evenhandedly enough that it corrects both sides.
| Case | Page | YAML |
|---|---|---|
| RCV-IRV — a basic ranked-ballot example (3 candidates) | page | RCV_ballot_example.yaml |
| Street trees — five rounds, and the bar keeps dropping (6 candidates, 100 voters; the lead changes hands in round 3 and the majority needed falls 51 → 39) | page | street_trees_five_rounds_c6_b100.yaml |
| Parallel universes — one count, two legal answers (an elimination tie where PUT elects two) | page | put_two_universes_c3_b4.yaml |
| Batch elimination empties the field — the perfect cycle (3 voters; Hare and Coombs both run out of candidates) | page | batch_all_out_cycle_c3_b3.yaml |
| …with a Condorcet winner sitting there (one ballot changed; batch IRV still ties three ways, Coombs elects Amy) | page | batch_all_out_condorcet_c3_b3.yaml |
| …and in round two, with Pareto keeping the unanimously-last candidate out of the tie | page | batch_all_out_round2_c4_b6.yaml |
The three batch_all_out_* cases back Batch elimination — what happens when the batch is everyone.
The engine lives in RCV_IRV_tabulation_engine/; full audit mirrors are in RCV_IRV_tabulated/.
How real elections get counted. The engine here is a teaching tabulator. The one US jurisdictions actually run on election night is RCTab — federally tested under the VVSG, state-certified, open source, and free to download. That page covers what it is, whether it can be scripted (a CLI, not a web API), and how one of our cases would have to be reshaped to feed it.
Every RCV-IRV case here has been counted by RCTab as well — 71 of them, and 68 agree outright. One carries score ballots RCTab cannot read, one is a deliberately malformed negative fixture, and one genuinely disagrees: coombs_ex20_district1, where two candidates tie on first places and the arbitrary opening elimination decides the winner. RCTab printed the tie in its audit log; our engine broke it silently and a teaching claim had been resting on the result. That is the elimination-tie limitation with a real bite mark, and it is why a disagreement is often more useful than a match.