Setup The "quota" q of each party is calculated, being the integral part of v*c/V, where v is the number of votes received by the party, c is the number of constituencies and V is the total number of votes cast over all constituencies in the election.
Phase 1 The first phase of the algorithm identifies "eligible" as those who are either front-runners or have received 20% of the votes cast in their constituencies. In any constituency with only one eligible candidate, that candidate is elected.
Phase 2 In the main part of the algorithm, parties and MPs are selected as follows.
0 if m=q, that is, the party has already reached its quota;
(1+c)*v if m=0 , that is, the party has not yet got an MP, but q is greater than 0;
v/m if m is greater than 0 but less than q.
The party with the highest quota is assigned to get another MP.
if there is a front-runner, we pick the one with the greatest lead over the next candidate in that constituency;
if there is no front-runner, we pick the one with the smallest gap between him and the front-runner in that constituency.
Now we have another MP and return to the beginning of Phase 2.
Phase 3 At the end of Phase 2, there are normally constituencies still without MPs; in these constituencies the front-runners are elected.
You can see my program (I apologize for the language).
Return to general description of the scheme.
24 May 2005