Resubmit May's runner-up
Resubmit June's runner-up
StackSTV
Stack Exchange uses an STV-based system for holding elections. They use the software OpenSTV to host it.
That software is no longer being maintained, and the system is being rebranded as OpaVote, and will no longer be free.
This month's challenge:
Build an implementation of the same STV algorithm used for Stack Exchange moderator elections, that consumes data in the same format that Stack Exchange provides, and produces the same results.
Algorithm
The actual algorithm use is linked in this Meta.StackExchange question/answer: How are moderator election votes counted, in plain English?
Specifically, using the "Meek STV" algorithm here - in Wikipedia.
Inputs
For examples of input data, see: Stack Overflow Elections
Typical data looks something like:
10 3
1 1 2 3 0
1 4 5 6 0
1 6 7 2 0
1 3 6 1 0
1 6 8 4 0
1 6 3 2 0
1 4 1 9 0
1 8 9 3 0
1 8 7 3 0
....
1 8 2 1 0
1 9 4 6 0
1 4 8 3 0
1 3 4 8 0
1 4 5 10 0
0
"meagar"
"Raghav Sood"
"Bohemian"
"0x7fffffff"
"Undo"
"bluefeet"
"Matt"
"Jon Clements"
"Siddharth Rout"
"Doorknob"
The format is essentially:
- The number of candidates, and seats on the first line - 10, and 3 represent there are 10 candidates, and 3 positions.
- a list of any candidates that have withdrawn preceded with a negative number - one per line (Stack Exchange won't have these, likely).
a count of people with a specific combination of votes For example, in the first line: 1 1 2 3 0
that means that one person voted with the combination first-choice candidate 1, second choice candidate 2, third choice candidate 3. The 0 represents the end of that line. Note that combinations can be duplicated, potentially. In other words, three people voting for candidates 1, 2, and 3 in that order, could be represented as one of the following alternatives:
1 1 2 3 0
1 1 2 3 0
1 1 2 3 0
or
1 1 2 3 0
2 1 2 3 0
or
3 1 2 3 0
Though, it should be noted, that stack exchange elections will only have the first style of output.
a zero on a line by itself represents the end of the vote section.
- following that, is the names of the candidates, in the order of the choices.
Feel free to implement it in the language of your choice, and to embellish it with GUI, graphs, charts, etc.
Challenge entries