Using Algorithm X to reanalyse the last UK general election
summary
Claim: Algorithm X finds exact-cover merges of 2–4 neighboring constituencies and those merged maps feed standard PR apportionment methods. Implementation uses geopandas disjoint tests, a public Python Algorithm X package (pip install) with a pip kernel speedup and joblib parallelism; London two-merge space yields ~540 million covers (3.5 hours), full-run ~15 hours. Ran 10,000 simulations per scenario, scoring with the Gallagher index: FPTP ≈11.6, Webster ≈4.3, Hare ≈3.2, so larger merged districts and Webster/Hare produce markedly more proportional results.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 4:58First past the post problems
- 10:14Algorithm X and exact cover
- 13:45How Algorithm X works
- 16:57Merging constituencies with X
- 23:53Simulating PR elections
- 26:44Results with Gallagher index
- 28:07Summary
- 29:53Acknowledgements
related talks
29mGerrymandering Australia
17mSecrets of Antony Green: Calculating notional margins for electoral redistributions
01h 42mRecreating, Understanding, and Visualizing FiveThirtyEight's...
28mNetwork analysis inside the Italian parliament
01h 05mHow to Steal an Election
41mLarge Road-Network analysis with GraphX
30mFighting Gerrymandering with PyMC3
10mVisualizing voting results
