This is a program that calculates elections according to the Swedish law of proportional voting (Lag (1992:339) om proportionellt valsätt)
The Law on Proportional Voting (SFS 1992:339) regulates how proportional elections are to be conducted in Sweden. It is used in elections within, for example, municipalities, regions, and associations when multiple individuals are to be elected to a body, such as a committee or board. The purpose of the law is to ensure that the distribution of seats or positions reflects the election results, i.e., the distribution of votes among different parties or groups.
1. Proportional Representation. Each group should receive representation in proportion to the number of votes it has received. This is particularly important in situations where elections take place between multiple parties or groups.
2. Scope of Application. The law is primarily used in indirect elections (e.g., in municipal or regional councils) and not in general elections.
1. Number of Seats and Candidates. A body (such as a committee) has a set number of seats to fill. The parties or groups participating in the election nominate their candidates
2. Use of Proportional Voting Systems. The election is conducted using a proportional voting system, often through D’Hondt’s method or similar systems. This means that:
-
Seats are allocated according to a mathematical process that benefits groups proportionally to their size.
-
The largest remaining votes determine which groups receive the remaining seats.
3. Voting. Members vote using ballots that specify the candidates nominated by the respective party or group.
4. Counting and Allocation. The votes are counted, and seats are allocated using the proportional method. To ensure proportionality, a specific quota is used to determine the number of votes required to secure a seat.
This is a python program which uses Ktinker to visualise the input and output of the calculations. Some of the code was written using ChatGPT.