A Python implementation of Frege's voting method
For a detailed description of Frege's voting method as well as the modified Frege method, see the research paper by Harrenstein, Lackner, and Lackner .
For a fixed electorate:
from frege import * profile = [5,1,1,1,1,1] k = 10 frege(profile , k, verbose=True) modfrege(profile , k, verbose=True)
For a variable electorate:
from frege import * profiles = [[3,2,1],[3,1,1],[1,2,2]] frege(profiles, verbose=True) modfrege(profiles, verbose=True)
Further examples can be found in frege/examples.py.
The file bias-experiments.py contains the code for the experiments in "A Mathematical Analysis of an Election System Proposed by Gottlob Frege" , Section 5.3. This code requires apportionment.py from https://github.com/martinlackner/apportionment.
 Paul Harrenstein, Marie-Louise Lackner, and Martin Lackner. A Mathematical Analysis of an Election System Proposed by Gottlob Frege. 2019.