[EM] Preferential voting system where a candidate may win multiple seats

Vidar Wahlberg canidae at exent.net
Wed Jul 17 17:11:03 PDT 2013


On Sun, Jul 07, 2013 at 11:27:21PM +0300, Juho Laatu wrote:
>> Alternatively, instead of running Sainte-Laguë in each county, you could
>> run SL on the national result (distributing all 169 seats), something
>> which would produce a representation percentage very close to the actual
>> result, and then distribute the seats to the parties in the different
>> counties (keeping the same amount of seats in each county).
> 
> I think this makes sense if you do not like the leveling seat style of building proportionality at national level. The last seats will be distributed pretty much in the same way anyway, but in this approach all seats are in principle seen as "equal". The algorithm may either aim at some ideal allocation, or be a practical algorithm that just finds a good enough result.

Had some spare time lately so I got to implement a "proof of concept" on
calculating seats on national level and then distribute the seats to the
districts, attempting to keep the proportionality also on district
level.

I used data from the 2009 norwegian election, while the algorithm works
with preferential voting (ordered list, excluding parties and
transfering votes to next preference if the party fails to reach a given
election threshold or if they fail to win any seats, as we discussed
earlier), I'm not using this feature in the code as I want to compare
the result with the real result, and hence don't know what voters
ordered preference is, meaning that votes for any party that gets
excluded will be "wasted".
Here's a link to the code (it's extremely rough, could be bugs,
disclaimer, etc), I'm too lazy to create branches and such, hence the
link to a certain commit, I may modify it in the future:
https://github.com/canidae/voting/blob/0a194b4a92233984fa7f010ee6fe7bfee62528b3/sl.d
It's written in the D language which may be new to some of you, I don't
even know if you're coders, but it's very similar to Java/C so the
language itself should be understandable, even though the code may be
cryptic.

Here's a textual explanation of what it does:

1. Use Sainte-Laguë on national result for all 169 seats to decide how
   many seats each party won. If some parties fails to win any seats,
   votes for the party with fewest votes are transfered to the voters'
   next preference and a new tally is performed. Repeat until all
   parties have won at least 1 seat.
   Optional: Set an election threshold, excluding parties who fail to
   gain a certain percentage of the votes. Votes are transfered as for
   parties who failed to win any seats.

2. Use reverse Sainte-Laguë on the national results (only for the
   parties who won seats) to determine which order to distribute seats
   to districts. The party who won the last of the 169 seats gets the
   very first seat, in the district where the party had the highest
   percentage of the votes.
   That's not entirely true, we're using Sainte-Laguë again (or the
   party would only get seats in the same district), so the party gets
   the seat in the district with the highest:
   partyVotePercent / (2 * partyDistrictSeats + 1)
   Example:
   Party A got 30% of the votes in District 1, and 20% of the votes in
   District 2.
   The first seat for that party goes to District 1, but the second seat
   will go to District 2 because: 30% / (2 * 1 + 1) < 20% / (2 * 0 + 1)

Once a district received all its seats, it's of course excluded from
receiving any more seats.
This seems to create very good proportional representation both on
national and district level. There is no leveling seat algorithm in this
alternative method.

Below is the result from the election in 2009, and how the result would
be if "my" method was used (in this case i'm using an election threshold
of 1.4% which excludes "Rødt" ("Rod"), without this they would win 2
seats, but I wanted the result to only have the same parties as in the
real election, whether an election threshold is necessary or not is
another discussion).
The output from the program also follows, it may help understand the
textual description above.

I'd like to hear your thoughts on this method. Notably on the
distribution of district seats to parties.
My apologies for poor explaining, I seem to find the latest hours to
explain stuff like this.


----- DATA -----

Just to make it clear: The party "V" ("Venstre") fell below the election
threshold in 2009 and did not compete for leveling seats, hence the much
lower percentage of the seats relative to their vote percentage.
Since the alternative method have no leveling seats and instead of
distributing seats per district it means that this party receives more
seats. Election threshold has another meaning in the alternative method,
meaning a party must reach a certain percent to receive any seats at
all.

Party vote percentages (2009 election), percent of seats they got and
percent of seats they would get with alternative vote tally:

Party | Vote % | Seat % | Alt. %
R     |   1.3% |     0% |     0%
SV    |   6.2% |   6.5% |   6.5%
AP    |  35.4% |  37.9% |  36.1%
SP    |   6.2% |   6.5% |   6.5%
KrF   |   5.5% |   5.9% |   5.9%
V     |   3.9% |   1.2% |   4.1%
H     |  17.2% |  17.8% |  17.8%
FrP   |  22.9% |  24.3% |  23.1%


Party percentage in districts (2009 election):

                 |  Rod  |  Sos  |  Arb  |  Sen  |  Kri  |  Ven  |  Hoy  |  Fre
-----------------+-------+-------+-------+-------+-------+-------+-------+-------
        Akershus |  0.9% |  5.7% | 33.7% |  3.1% |  3.1% |  4.9% | 23.1% | 24.4%
      Aust-Agder |  0.6% |  4.3% | 32.5% |  4.4% | 11.2% |  3.4% | 16.3% | 26.1%
        Buskerud |  0.6% |  4.6% | 37.1% |  6.2% |  3.2% |  3.0% | 19.4% | 25.1%
        Finnmark |  0.8% |  8.1% | 45.4% |  4.3% |  2.8% |  2.3% | 10.7% | 22.3%
         Hedmark |  0.6% |  6.6% | 47.1% | 10.3% |  2.5% |  2.5% | 10.2% | 17.9%
       Hordaland |  2.5% |  5.5% | 30.5% |  5.5% |  7.1% |  4.6% | 20.2% | 22.8%
 More og Romsdal |  0.5% |  3.8% | 30.7% |  8.6% |  8.4% |  3.8% | 16.1% | 27.4%
        Nordland |  1.4% |  7.7% | 39.3% |  8.3% |  3.7% |  2.3% | 11.5% | 24.3%
  Nord-Trondelag |  0.6% |  6.5% | 43.5% | 15.6% |  4.0% |  2.9% |  8.9% | 17.5%
         Oppland |  0.6% |  5.1% | 45.8% | 12.4% |  3.1% |  3.0% | 11.2% | 17.5%
            Oslo |  4.0% | 10.3%|  35.0% |  1.0% |  2.7% |  6.4% | 21.7% | 17.6%
        Rogaland |  0.4% |  4.7% | 26.1% |  5.8% | 11.3% |  4.4% | 19.5% | 26.5%
 Sogn og Fjordan |  0.9% |  5.8% | 29.6% | 25.2% |  6.8% |  3.3% | 12.1% | 15.8%
   Sor-Trøndelag |  1.3% |  7.9% | 41.0% |  7.3% |  3.8% |  3.6% | 13.9% | 19.6%
        Telemark |  1.2% |  5.3% | 41.7% |  5.5% |  6.6% |  2.5% | 13.2% | 23.0%
           Troms |  1.5% |  7.5% | 36.7% |  8.3% |  3.6% |  2.6% | 12.9% | 25.2%
      Vest-Agder |  0.5% |  3.9% | 26.5% |  3.6% | 15.5% |  3.1% | 17.6% | 27.4%
        Vestfold |  0.6% |  6.5% | 33.7% |  3.2% |  4.7% |  3.0% | 19.6% | 27.2%
         Ostfold |  0.7% |  4.4% | 39.3% |  4.9% |  5.8% |  2.5% | 14.8% | 26.1%


Seat distribution:

Election 2009    | Rod | Sos | Arb | Sen | Kri | Ven | Hoy | Fre 
-----------------+-----+-----+-----+-----+-----+-----+-----+-----
        Akershus |   0 |   1 |   5 |   0 |   1 |   1 |   4 |   4 
      Aust-Agder |   0 |   0 |   1 |   0 |   1 |   0 |   1 |   1 
        Buskerud |   0 |   0 |   4 |   1 |   0 |   0 |   2 |   2 
        Finnmark |   0 |   0 |   3 |   0 |   0 |   0 |   1 |   1 
         Hedmark |   0 |   1 |   4 |   1 |   0 |   0 |   1 |   1 
       Hordaland |   0 |   1 |   5 |   1 |   1 |   0 |   3 |   4 
 More og Romsdal |   0 |   0 |   3 |   1 |   1 |   0 |   1 |   3 
        Nordland |   0 |   1 |   4 |   1 |   0 |   0 |   1 |   3 
  Nord-Trondelag |   0 |   0 |   3 |   1 |   0 |   0 |   1 |   1 
         Oppland |   0 |   1 |   3 |   1 |   0 |   0 |   1 |   1 
            Oslo |   0 |   2 |   6 |   0 |   1 |   1 |   4 |   3 
        Rogaland |   0 |   1 |   3 |   1 |   1 |   0 |   3 |   4 
 Sogn og Fjordan |   0 |   0 |   2 |   1 |   0 |   0 |   1 |   1 
   Sor-Trondelag |   0 |   1 |   4 |   1 |   1 |   0 |   1 |   2 
        Telemark |   0 |   0 |   3 |   0 |   1 |   0 |   1 |   1 
           Troms |   0 |   0 |   3 |   1 |   0 |   0 |   1 |   2 
      Vest-Agder |   0 |   1 |   1 |   0 |   1 |   0 |   1 |   2 
        Vestfold |   0 |   1 |   3 |   0 |   0 |   0 |   1 |   2 
         Ostfold |   0 |   0 |   4 |   0 |   1 |   0 |   1 |   3 
-----------------+-----+-----+-----+-----+-----+-----+-----+-----
           Total |   0 |  11 |  64 |  11 |  10 |   2 |  30 |  41 


Alternative      | Rod | Sos | Arb | Sen | Kri | Ven | Hoy | Fre 
-----------------+-----+-----+-----+-----+-----+-----+-----+-----
        Akershus |   0 |   1 |   6 |   0 |   0 |   1 |   4 |   4 
      Aust-Agder |   0 |   0 |   1 |   0 |   1 |   0 |   1 |   1 
        Buskerud |   0 |   0 |   3 |   1 |   0 |   1 |   2 |   2 
        Finnmark |   0 |   1 |   2 |   0 |   0 |   0 |   1 |   1 
         Hedmark |   0 |   1 |   4 |   1 |   0 |   0 |   1 |   1 
       Hordaland |   0 |   1 |   5 |   1 |   1 |   1 |   3 |   3 
 More og Romsdal |   0 |   0 |   3 |   1 |   1 |   1 |   1 |   2 
        Nordland |   0 |   1 |   4 |   1 |   0 |   0 |   1 |   3 
  Nord-Trondelag |   0 |   1 |   2 |   1 |   0 |   0 |   1 |   1 
         Oppland |   0 |   0 |   4 |   1 |   0 |   0 |   1 |   1 
            Oslo |   0 |   1 |   7 |   0 |   0 |   1 |   4 |   4 
        Rogaland |   0 |   1 |   3 |   1 |   2 |   1 |   2 |   3 
 Sogn og Fjordan |   0 |   0 |   1 |   1 |   1 |   0 |   1 |   1 
   Sor-Trondelag |   0 |   1 |   3 |   1 |   1 |   1 |   1 |   2 
        Telemark |   0 |   0 |   3 |   0 |   1 |   0 |   1 |   1 
           Troms |   0 |   1 |   2 |   1 |   0 |   0 |   1 |   2 
      Vest-Agder |   0 |   0 |   2 |   0 |   1 |   0 |   1 |   2 
        Vestfold |   0 |   1 |   2 |   0 |   0 |   0 |   2 |   2 
         Ostfold |   0 |   0 |   4 |   0 |   1 |   0 |   1 |   3 
-----------------+-----+-----+-----+-----+-----+-----+-----+-----
           Total |   0 |  11 |  61 |  11 |  10 |   7 |  30 |  39 


--- Output from program: ---

Result:
           Rodt:  0 seats,   36219 votes, excluded: false
Sosialistisk Ve: 11 seats,  166361 votes, excluded: false
Arbeiderpartiet: 61 seats,  949049 votes, excluded: false
  Senterpartiet: 11 seats,  165006 votes, excluded: false
Kristelig Folke: 10 seats,  148748 votes, excluded: false
        Venstre:  7 seats,  104144 votes, excluded: false
          Hoyre: 30 seats,  462458 votes, excluded: false
Fremskrittspart: 39 seats,  614717 votes, excluded: false
Excluding Rodt as they received no seats and got fewest votes

Result:
           Rodt:  0 seats,       0 votes, excluded: true
Sosialistisk Ve: 11 seats,  166361 votes, excluded: false
Arbeiderpartiet: 61 seats,  949049 votes, excluded: false
  Senterpartiet: 11 seats,  165006 votes, excluded: false
Kristelig Folke: 10 seats,  148748 votes, excluded: false
        Venstre:  7 seats,  104144 votes, excluded: false
          Hoyre: 30 seats,  462458 votes, excluded: false
Fremskrittspart: 39 seats,  614717 votes, excluded: false
Assigning seat to Venstre in Oslo
Assigning seat to Kristelig Folkeparti in Vest-Agder
Assigning seat to Senterpartiet in Sogn og Fjordane
Assigning seat to Sosialistisk Venstreparti in Oslo
Assigning seat to Hoyre in Akershus
Assigning seat to Arbeiderpartiet in Hedmark
Assigning seat to Fremskrittspartiet in Vest-Agder
Assigning seat to Kristelig Folkeparti in Rogaland
Assigning seat to Hoyre in Oslo
Assigning seat to Arbeiderpartiet in Finnmark
Assigning seat to Senterpartiet in Nord-Trondelag
Assigning seat to Sosialistisk Venstreparti in Finnmark
Assigning seat to Arbeiderpartiet in Oppland
Assigning seat to Fremskrittspartiet in Vestfold
Assigning seat to Venstre in Akershus
Assigning seat to Arbeiderpartiet in Nord-Trondelag
Assigning seat to Hoyre in Hordaland
Assigning seat to Fremskrittspartiet in More og Romsdal
Assigning seat to Arbeiderpartiet in Telemark
Assigning seat to Arbeiderpartiet in Sor-Trondelag
Assigning seat to Hoyre in Vestfold
Assigning seat to Fremskrittspartiet in Rogaland
Assigning seat to Arbeiderpartiet in Ostfold
Assigning seat to Fremskrittspartiet in Ostfold
Assigning seat to Senterpartiet in Oppland
Assigning seat to Arbeiderpartiet in Nordland
Assigning seat to Hoyre in Rogaland
Assigning seat to Kristelig Folkeparti in Aust-Agder
Assigning seat to Sosialistisk Venstreparti in Sor-Trondelag
Assigning seat to Arbeiderpartiet in Troms
Assigning seat to Fremskrittspartiet in Aust-Agder
Assigning seat to Arbeiderpartiet in Buskerud
Assigning seat to Hoyre in Buskerud
Assigning seat to Fremskrittspartiet in Troms
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Arbeiderpartiet in Vestfold
Assigning seat to Hoyre in Vest-Agder
Assigning seat to Fremskrittspartiet in Buskerud
Assigning seat to Venstre in Hordaland
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Senterpartiet in Hedmark
Assigning seat to Fremskrittspartiet in Nordland
Assigning seat to Arbeiderpartiet in Aust-Agder
Assigning seat to Sosialistisk Venstreparti in Nordland
Assigning seat to Hoyre in Aust-Agder
Assigning seat to Kristelig Folkeparti in More og Romsdal
Assigning seat to Arbeiderpartiet in More og Romsdal
Assigning seat to Fremskrittspartiet in Akershus
Assigning seat to Arbeiderpartiet in Hordaland
Assigning seat to Hoyre in More og Romsdal
Assigning seat to Fremskrittspartiet in Telemark
Assigning seat to Arbeiderpartiet in Sogn og Fjordane
Assigning seat to Arbeiderpartiet in Vest-Agder
Assigning seat to Hoyre in Ostfold
Assigning seat to Fremskrittspartiet in Hordaland
Assigning seat to Arbeiderpartiet in Rogaland
Assigning seat to Senterpartiet in More og Romsdal
Assigning seat to Sosialistisk Venstreparti in Troms
Assigning seat to Arbeiderpartiet in Hedmark
Assigning seat to Fremskrittspartiet in Finnmark
Assigning seat to Hoyre in Sor-Trondelag
Assigning seat to Arbeiderpartiet in Finnmark
Assigning seat to Kristelig Folkeparti in Hordaland
Assigning seat to Venstre in Rogaland
Assigning seat to Fremskrittspartiet in Sor-Trondelag
Assigning seat to Arbeiderpartiet in Oppland
Assigning seat to Hoyre in Telemark
Assigning seat to Arbeiderpartiet in Nord-Trondelag
Assigning seat to Fremskrittspartiet in Hedmark
Assigning seat to Arbeiderpartiet in Telemark
Assigning seat to Hoyre in Troms
Assigning seat to Fremskrittspartiet in Oslo
Assigning seat to Arbeiderpartiet in Sor-Trondelag
Assigning seat to Senterpartiet in Troms
Assigning seat to Sosialistisk Venstreparti in Hedmark
Assigning seat to Arbeiderpartiet in Ostfold
Assigning seat to Fremskrittspartiet in Oppland
Assigning seat to Hoyre in Sogn og Fjordane
Assigning seat to Arbeiderpartiet in Nordland
Assigning seat to Kristelig Folkeparti in Sogn og Fjordane
Assigning seat to Fremskrittspartiet in Nord-Trondelag
Assigning seat to Arbeiderpartiet in Troms
Assigning seat to Hoyre in Nordland
Assigning seat to Arbeiderpartiet in Buskerud
Assigning seat to Fremskrittspartiet in Sogn og Fjordane
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Venstre in More og Romsdal
Assigning seat to Hoyre in Oppland
Assigning seat to Fremskrittspartiet in Vest-Agder
Assigning seat to Senterpartiet in Nordland
Assigning seat to Arbeiderpartiet in Vestfold
Assigning seat to Sosialistisk Venstreparti in Vestfold
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Fremskrittspartiet in Vestfold
Assigning seat to Hoyre in Finnmark
Assigning seat to Arbeiderpartiet in More og Romsdal
Assigning seat to Kristelig Folkeparti in Telemark
Assigning seat to Fremskrittspartiet in More og Romsdal
Assigning seat to Arbeiderpartiet in Hordaland
Assigning seat to Hoyre in Hedmark
Assigning seat to Arbeiderpartiet in Hedmark
Assigning seat to Fremskrittspartiet in Rogaland
Assigning seat to Arbeiderpartiet in Oppland
Assigning seat to Senterpartiet in Sor-Trondelag
Assigning seat to Sosialistisk Venstreparti in Nord-Trondelag
Assigning seat to Hoyre in Nord-Trondelag
Assigning seat to Arbeiderpartiet in Vest-Agder
Assigning seat to Fremskrittspartiet in Ostfold
Assigning seat to Arbeiderpartiet in Rogaland
Assigning seat to Fremskrittspartiet in Troms
Assigning seat to Hoyre in Akershus
Assigning seat to Arbeiderpartiet in Telemark
Assigning seat to Venstre in Sor-Trondelag
Assigning seat to Arbeiderpartiet in Sor-Trondelag
Assigning seat to Fremskrittspartiet in Buskerud
Assigning seat to Kristelig Folkeparti in Ostfold
Assigning seat to Hoyre in Oslo
Assigning seat to Arbeiderpartiet in Ostfold
Assigning seat to Fremskrittspartiet in Nordland
Assigning seat to Arbeiderpartiet in Nordland
Assigning seat to Senterpartiet in Buskerud
Assigning seat to Sosialistisk Venstreparti in Akershus
Assigning seat to Arbeiderpartiet in Buskerud
Assigning seat to Hoyre in Hordaland
Assigning seat to Fremskrittspartiet in Akershus
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Fremskrittspartiet in Hordaland
Assigning seat to Arbeiderpartiet in Hedmark
Assigning seat to Hoyre in Vestfold
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Fremskrittspartiet in Sor-Trondelag
Assigning seat to Kristelig Folkeparti in Sor-Trondelag
Assigning seat to Arbeiderpartiet in Oppland
Assigning seat to Hoyre in Rogaland
Assigning seat to Fremskrittspartiet in Oslo
Assigning seat to Arbeiderpartiet in More og Romsdal
Assigning seat to Senterpartiet in Rogaland
Assigning seat to Sosialistisk Venstreparti in Hordaland
Assigning seat to Venstre in Buskerud
Assigning seat to Arbeiderpartiet in Hordaland
Assigning seat to Hoyre in Buskerud
Assigning seat to Fremskrittspartiet in Rogaland
Assigning seat to Arbeiderpartiet in Ostfold
Assigning seat to Fremskrittspartiet in Ostfold
Assigning seat to Arbeiderpartiet in Nordland
Assigning seat to Hoyre in Akershus
Assigning seat to Arbeiderpartiet in Rogaland
Assigning seat to Fremskrittspartiet in Nordland
Assigning seat to Kristelig Folkeparti in Rogaland
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Hoyre in Oslo
Assigning seat to Senterpartiet in Hordaland
Assigning seat to Sosialistisk Venstreparti in Rogaland
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Fremskrittspartiet in Akershus
Assigning seat to Arbeiderpartiet in Hordaland
Assigning seat to Hoyre in Hordaland
Assigning seat to Fremskrittspartiet in Hordaland
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Fremskrittspartiet in Oslo
Assigning seat to Hoyre in Akershus
Assigning seat to Arbeiderpartiet in Hordaland
Assigning seat to Fremskrittspartiet in Akershus
Assigning seat to Arbeiderpartiet in Oslo
Assigning seat to Hoyre in Oslo
Assigning seat to Arbeiderpartiet in Akershus
Assigning seat to Fremskrittspartiet in Oslo
Assigning seat to Arbeiderpartiet in Oslo


----- END DATA -----

-- 
Regards,
Vidar Wahlberg



More information about the Election-Methods mailing list