a fast exact algorithm for the allocation of seats for the eu parliament

8
A fast exact algorithm for the allocation of seats for the EU Parliament Janusz Łyko, Radosław Rudek Wrocław University of Economics, Komandorska 118/120, 53-345 Wrocław, Poland article info Keywords: Allocation of seats Elections Degressive proportionality Branch and bound abstract In this paper, we analyse the problem of allocation of seats for the EU Parliament. To solve it, we propose a fast exact algorithm which overwhelms limitations of the existing methods. It allows us to examine all feasible allocations of seats within few minutes. On this basis, an in-depth analysis of the problem is pro- vided and some of its properties are revealed (e.g., the number of feasible allocations of seats holding the Treaty of Lisbon), which have never been presented in the scientific literature. Furthermore, the proposed algorithm is not limited to dealing with the problem of allocation of seats for the EU Parliament, but it can be applied in the expert system for any other similar problem, especially under degressive proportional- ity constraints. Ó 2013 Elsevier Ltd. All rights reserved. 1. Introduction Undoubtedly, the allocation of seats for the European Parlia- ment is not only a significant problem, but also a scientific chal- lenge. Namely, the Committee on Constitutional Affairs (AFCO) of European Parliament commissioned a Symposium of Mathemati- cians to ‘‘identify a mathematical formula for the distribution of seats which will be durable, transparent and impartial to politics’’ (see Grimmett et al., 2011). Following Grimmett (2012), the purpose was to eliminate the political bartering which has characterised the distribution of seats by enabling a smooth reallocation of seats taking into account migration, demographic shifts and the acces- sion of new Member States. Let us recall the main documents. The Treaty of Lisbon (2010) constitutes that ‘‘The European Parliament shall be composed of rep- resentatives of the Union’s citizens. They shall not exceed seven hun- dred and fifty in number, plus the President. Representation of citizens shall be degressively proportional, with a minimum thresh- old of six members per Member State. No Member State shall be allo- cated more than ninety-six seats’’. 1 Guidelines for understanding degressive proportionality can be found in the annex to the draft of the European Parliament resolution (Lamassoure & Severin, 2007). Furthermore, according to the same document ‘‘the minimum and maximum numbers set by the Treaty must be fully utilized to ensure that the allocation of seats in the European Parliament reflects as closely as possible the range of populations of the Member States’’. Thus, these documents outline requirements for feasible allocations of seats. To obtain an unprejudiced rule for the composition of the EU Parlia- ment, a fair analysis is needed, which requires examining of all fea- sible allocations of seats (holding the above constraints). However, due to the intractability of the considered problem an exhaustive search cannot be applied. Therefore, lots of methods have been pro- posed, which construct compositions of the EU Parliament (e.g. Martínez-Aroza & Ramírez-González, 2008; Ramírez-González et al., 2012; Serafini, 2012; Słomczyn ´ ski & _ Zyczkowski, 2012). How- ever, they face an essential problem – they are not able to generate (examine) all feasible allocations of seats (solutions). Thus, an algo- rithm that is able to find all feasible solutions is highly desirable. In this paper, we will propose a fast exact algorithm LaRSA, which overwhelms boundaries of the existing methods and it allows us to examine all feasible allocations of seats for the EU Parliament in a reasonable time, which does not exceed few min- utes. On this basis, we construct an expert system that allows us to provide an in-depth analysis, which has not been presented nor possible due to the limitations of the known methods. To the best of our knowledge the given properties of the composition of the EU Parliament (e.g., the number of feasible allocations of seats holding the Treaty of Lisbon) have never been presented in the sci- entific literature. Note that the algorithm and the expert system presented in this paper, can be easily extended to analyse different allocation crite- ria (configurations). Furthermore, they are not limited to dealing with the problem of allocation of seats for the EU Parliament, but they can be applied for any other similar problem, especially under degressive proportionality constraints. The remainder of this paper is organized as follows. In the next section, the allocation of seats is formulated as a combina- torial optimization problem. On this basis, the detailed descrip- tion of the proposed algorithm is given, which is followed by a 0957-4174/$ - see front matter Ó 2013 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.eswa.2013.03.035 Corresponding author. Tel.: +48 71 368 0378; fax: +48 71 368 0376. E-mail addresses: [email protected] (J. Łyko), [email protected], [email protected] (R. Rudek). 1 Note that according to the newest decision of the EU Parliament (19 February 2013), there are 766 seats and 28 countries including Croatia. Expert Systems with Applications 40 (2013) 5284–5291 Contents lists available at SciVerse ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa

Upload: radoslaw

Post on 27-Dec-2016

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: A fast exact algorithm for the allocation of seats for the EU Parliament

Expert Systems with Applications 40 (2013) 5284–5291

Contents lists available at SciVerse ScienceDirect

Expert Systems with Applications

journal homepage: www.elsevier .com/locate /eswa

A fast exact algorithm for the allocation of seats for the EU Parliament

0957-4174/$ - see front matter � 2013 Elsevier Ltd. All rights reserved.http://dx.doi.org/10.1016/j.eswa.2013.03.035

⇑ Corresponding author. Tel.: +48 71 368 0378; fax: +48 71 368 0376.E-mail addresses: [email protected] (J. Łyko), [email protected],

[email protected] (R. Rudek).1 Note that according to the newest decision of the EU Parliament (19 February

2013), there are 766 seats and 28 countries including Croatia.

Janusz Łyko, Radosław Rudek ⇑Wrocław University of Economics, Komandorska 118/120, 53-345 Wrocław, Poland

a r t i c l e i n f o a b s t r a c t

Keywords:Allocation of seatsElectionsDegressive proportionalityBranch and bound

In this paper, we analyse the problem of allocation of seats for the EU Parliament. To solve it, we proposea fast exact algorithm which overwhelms limitations of the existing methods. It allows us to examine allfeasible allocations of seats within few minutes. On this basis, an in-depth analysis of the problem is pro-vided and some of its properties are revealed (e.g., the number of feasible allocations of seats holding theTreaty of Lisbon), which have never been presented in the scientific literature. Furthermore, the proposedalgorithm is not limited to dealing with the problem of allocation of seats for the EU Parliament, but it canbe applied in the expert system for any other similar problem, especially under degressive proportional-ity constraints.

� 2013 Elsevier Ltd. All rights reserved.

1. Introduction

Undoubtedly, the allocation of seats for the European Parlia-ment is not only a significant problem, but also a scientific chal-lenge. Namely, the Committee on Constitutional Affairs (AFCO) ofEuropean Parliament commissioned a Symposium of Mathemati-cians to ‘‘identify a mathematical formula for the distribution of seatswhich will be durable, transparent and impartial to politics’’ (seeGrimmett et al., 2011). Following Grimmett (2012), the purposewas to eliminate the political bartering which has characterisedthe distribution of seats by enabling a smooth reallocation of seatstaking into account migration, demographic shifts and the acces-sion of new Member States.

Let us recall the main documents. The Treaty of Lisbon (2010)constitutes that ‘‘The European Parliament shall be composed of rep-resentatives of the Union’s citizens. They shall not exceed seven hun-dred and fifty in number, plus the President. Representation ofcitizens shall be degressively proportional, with a minimum thresh-old of six members per Member State. No Member State shall be allo-cated more than ninety-six seats’’.1 Guidelines for understandingdegressive proportionality can be found in the annex to the draftof the European Parliament resolution (Lamassoure & Severin,2007). Furthermore, according to the same document ‘‘the minimumand maximum numbers set by the Treaty must be fully utilized to ensurethat the allocation of seats in the European Parliament reflects as closelyas possible the range of populations of the Member States’’. Thus, thesedocuments outline requirements for feasible allocations of seats. To

obtain an unprejudiced rule for the composition of the EU Parlia-ment, a fair analysis is needed, which requires examining of all fea-sible allocations of seats (holding the above constraints). However,due to the intractability of the considered problem an exhaustivesearch cannot be applied. Therefore, lots of methods have been pro-posed, which construct compositions of the EU Parliament (e.g.Martínez-Aroza & Ramírez-González, 2008; Ramírez-Gonzálezet al., 2012; Serafini, 2012; Słomczynski & _Zyczkowski, 2012). How-ever, they face an essential problem – they are not able to generate(examine) all feasible allocations of seats (solutions). Thus, an algo-rithm that is able to find all feasible solutions is highly desirable.

In this paper, we will propose a fast exact algorithm LaRSA,which overwhelms boundaries of the existing methods and itallows us to examine all feasible allocations of seats for the EUParliament in a reasonable time, which does not exceed few min-utes. On this basis, we construct an expert system that allows usto provide an in-depth analysis, which has not been presentednor possible due to the limitations of the known methods. To thebest of our knowledge the given properties of the composition ofthe EU Parliament (e.g., the number of feasible allocations of seatsholding the Treaty of Lisbon) have never been presented in the sci-entific literature.

Note that the algorithm and the expert system presented in thispaper, can be easily extended to analyse different allocation crite-ria (configurations). Furthermore, they are not limited to dealingwith the problem of allocation of seats for the EU Parliament, butthey can be applied for any other similar problem, especially underdegressive proportionality constraints.

The remainder of this paper is organized as follows. In thenext section, the allocation of seats is formulated as a combina-torial optimization problem. On this basis, the detailed descrip-tion of the proposed algorithm is given, which is followed by a

Page 2: A fast exact algorithm for the allocation of seats for the EU Parliament

J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291 5285

case study, where the algorithm is used to examine the alloca-tion of seats for the EU Parliament. The last section concludesthe paper.

2. Problem formulation

In this section, we will formally define the analysed problem.There are n countries, where pi denotes the population of countryi for i = 1, . . . ,n. For convenience, the countries are indexed accord-ing to the non-increasing order of pi, i.e., p1 6 p2 6 � � � 6 pn, if it isnot a case, we can renumber them. Each country i has assignedthe number of seats si, where si 2 smin

i ; . . . ; smaxi

� �(for i = 1, . . . ,n)

is the integer number, smini and smax

i are its minimal and maximalvalues, respectively. These values are globally bounded by theminimum m and the maximum M possible numbers of seats,i.e., m 6 smin

i and smaxi 6 M for i = 1, . . . ,n. The sum of all allocated

seats (the house size) is H, i.e.,Pn

i¼1si ¼ H. Due to the Treaty ofLisbon, allocations of seats are required to satisfy a condition ofdegressive proportionality, i.e., a sequence s1,s2, . . . ,sn is degres-sively proportional with respect to p1 6 p2 6 � � � 6 pn if and onlyif s1 6 s2 6 � � � 6 sn and p1/s1 6 p2/s2 6 � � � 6 pn/sn. On this basis,the feasible allocation of seats (i.e., a solution) can be expressedas a tuple S = (s1,s2, . . . ,sn) of n elements (i.e., n-tuple), whichhas to hold the above constraints and P is the set of all feasiblesolutions (allocation of seats), which hold the mentionedconstraints.

For the actual case of the EU Parliament, there are millions ofsuch feasible solutions (they are discussed further in Section 4).Therefore, in practice, they are evaluated in reference to someadditional functions. Let Aq:[0,+1) ? [0,+1) be a non-decreasingfunction with respect to the given population p, where rational val-ues are allowed. It describes a desired ideal allocation of seats, i.e.,‘‘ideal quotas’’ (e.g. Ramírez-González et al., 2012; Serafini, 2012).On this basis, the objective is to find such a feasible solutionS 2P that minimizes the criterion value fAq ðSÞ related with thefunction Aq. Formally, the optimal solution S⁄ is defined as followsS� , arg minS2PffAq ðSÞg.

In the next section, we will present an exact algorithm thatfinds all feasible solutions P for the known cases of the EU Parlia-ment, whereas the calculations for particular Aq and fAq will be pro-vided and analysed in Section 4.

3. The exact search space algorithm

To the best of our knowledge there are no efficient exact algo-rithms dedicated to the analysed problem of the allocation of seatsfor the EU Parliament nor to any other related problems. Therefore,in this section, we will describe the proposed algorithm that allowsus to search the solution space and to find all feasible allocations ofseats (solutions), i.e., the set P. The searching process as well as Pare independent on Aq and fAq . In the further part, we will denotethe proposed exact search space algorithm by LaRSA (Łyko and Ru-dek’s Search Algorithm). Some preliminary concepts were pre-sented in (Łyko et al., 2012).

Recall that according to the assumptions of feasible allocation ofseats (resulted inter alia from the Treaty of Lisbon Lamassoure &Severin, 2007; Ramírez-González et al., 2012 or Słomczynski &_Zyczkowski, 2012), each feasible S 2P has to hold the followingconstraints:

C1: s1 ¼ smin1 ¼ smax

1 ¼ m and sn ¼ sminn ¼ smax

n ¼ M,C2: m 6 smin

i and smaxi 6 M for i = 2, . . . ,n � 1,

C3: s1 6 s2 6 � � � 6 sn, where si 2 smini ; smax

i

� �for i = 1, . . . ,n

C4: p1/s1 6 p2/s2 6 � � � 6 pn/sn,C5:

Pni¼1si ¼ H.

Let P00 denote the solution space that contains all allocations,which hold assumptions C1–C3 and jP00j denotes its cardinality.The idea of the algorithm LaRSA is based on generating and search-ing the subset P00 for finding solutions that hold C4 (degressiveproportionality) and C5 (the total required number of seats). Onthis basis, the set P of all feasible solutions is obtained and theoptimal solution can be found.

At first, we will present the process of searching the solutionspace. It is based on generating in lexicographical order all possibletuples (allocations) that hold C1–C3. It is illustrated in Example 1.

Example 1. Let n = 4, smini ¼ m ¼ 6 and smax

i ¼ M ¼ 8 for i = 1, . . . ,n.According to C1–C3, the following tuples S are generated inlexicographical order: ð6;6;6;6Þ; ð6;6;6;7Þ; ð6;6;6;8Þ; ð6;6;7;7Þ;ð6;6;7;8Þ; ð6;6;8;8Þ; ð6;7;7;7Þ; ð6;7;7;8Þ; ð6;7;8;8Þ; ð6;8;8;8Þ;ð7;7;7;7Þ; ð7;7;7;8Þ; ð7;7;8;8Þ; ð7;8;8;8Þ; ð8;8;8;8Þ.

Note that for example the solution ð6;8;7;6Þ is infeasible(according to C3), however, it can be reordered to ð6;6;7;8Þ, whichis feasible. On this basis, it can be observed in Example 1 thatC1–C3 (especially C3) generate the 4-element multisets withelements from the 3-element set {6,7,8}, i.e., 4-combinations of 3elements with repetitions in lexicographical order.

Let us extend the above observation on the considered problem.The number of the N-element multisets with elements from theK-element set is defined by the following binomial coefficients(multiset number):

N

K

� �� �¼

N þ K � 1K

� �¼ NðN þ 1ÞðN þ 2Þ þ � � � þ ðN þ K � 1Þ

K!:

Since s1 and sn are fixed, then C1–C3 generate N = n � 2 multisetswith elements from the set {m, . . . ,M}, thereby K = M �m + 1. Forinstance, if n = 27, m = 6 and M = 96, then we can calculate the car-dinality of the solution space P00 as follows (allocations that holdC1–C3):

jP00j ¼N

K

� �� �¼

2591

� �� �> 1025:

In particular, if we assume that each solution (allocation of seats)can be generated and examined as one floating point operationand we are able to use the world’s fastest supercomputer IBMSequoila (TOP500, 2012), which performs 16.32 PFLOPS (i.e.,16.32 � 1015 floating point operations per second), then examiningthe solution space (for the given values of n,m,M) will take over24 years.

Therefore, the proposed algorithm LaRSA do not generate thetotal set P00, but at first it trims the range smin

i ; . . . ; smaxi

� �for each si

such that smini (for i = 2, . . . ,n � 1) are the greatest possible values

(but not greater than M) that hold:

p1

smin1

¼ p1

m6

p2

smin2

6 � � � 6 pn�1

sminn�1

6pn

sminn¼ pn

M;

whereas smaxi (for i = 1, . . . ,n) are the smallest possible values (but

not smaller than m) that hold:

p1

smax1¼ p1

m6

p2

smax26 � � � 6 pn�1

smaxn�16

pn

smaxn¼ pn

M:

Thus, we obtain the reduced set P0 # P00. The feasible values smini

and smaxi of seats for each country holding degressive proportionality

for years 2007 and 2012 are presented in Table 1.Although P0 # P00, it is still intractable for the considered

instances and an exhaustive search cannot be used. Therefore, thealgorithm LaRSA searches the solution space P0 as a tree (seeFig. 1), which allows us to analyse not only complete solutions(allocations) but first and foremost partial solutions, which isfundamental for the proposed algorithm. Such an approach to

Page 3: A fast exact algorithm for the allocation of seats for the EU Parliament

5286 J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291

search a solution space is called branch and bound and has beensuccessfully used for different intractable combinatorial optimiza-tion problems (e.g. Lee, Chen, & Wu, 2010; Rudek, 2013).

The general idea of searching P0 by the algorithm LaRSA can bedescribed as follows. The set of all possible solutions P0 isrepeatedly partitioned into smaller subsets described by thefollowing parameters: Sp = (s1,s2, . . . ,sk) – a partial tuple (solution),k 6 n – the number of elements in Sp. For each Sp (representing apartial solution from P0) the following prune procedures areexamined:

P1: pk�1/sk�1 > pk/sk for k P 2,

P2:Pk

i¼1si þPn

i¼kþ1 max smini ; sk

� �> H,

P3:Pk

i¼1si þPn

i¼kþ1smaxi < H.

If any of them holds, then the examined subset of solutions isexcluded from the further considerations, i.e., there are no feasiblesolutions that start with the given Sp = (s1,s2, . . . ,sk). Otherwise thesubset of solutions is further partitioned into n � k disjoint subsetsby assigning to element sk+1 values from smin

kþ1; . . . ; smaxkþ1

n othat have

to hold C3. If k = n and C1–C5 hold, then for such a feasible solutionS the criterion value is calculated and it is compared with the bestalready found. This process is continued until all possible solutionsare checked or excluded, thereby the optimal solution is found. Onthis basis, the set of all feasible solutions P is examined.

For a better comprehension of procedures P1, P2 and P3 let usanalyse Examples 2–4, respectively, where data from year 2007 areconsidered with H = 751.

Example 2. Given the following partial solution: Sp = ð6;6;6;6;7;8Þand k = 6, where p5 = 2,010,377 and p6 = 2,281,305. Note that p5/s5 � 287,196, p6/s6 � 285,163, thus, p5/s5 > p6/s6. Therefore, basedon P1 any solution that starts with Sp cannot be feasible, and thealgorithm moves to the next subset of solutions starting withSp = ð6;6;6;6;8Þ and k = 5. See Fig. 1, where a grey arrow showsmoving from one partial solution to another, which is forced bypruning.

Example 3. Given the following partial solution: Sp = (6,6,6,6,8,8,11,14,16,16,16,22) and k = 12. Knowing that ðsmin

13 ; . . . ; smin27 Þ ¼

ð22;22;22;22;22;22;22;22;27;47;54;71;72;75;96Þ and sk = s12 =22 the following can be easily obtained:

Pki¼1si þ

Pni¼kþ1 max

smini ; sk

� �¼ 753 > 751 ¼ H. Therefore, based on P2 any solution

that starts with Sp cannot be feasible and the algorithm moves tothe next subset of solutions starting with Sp = ð6;6;6;6;8;8;11;14;16;16;17Þ and k = 11.

Example 4. Given the following partial solution: Sp = ð6;6;6;6;6;6;8;10;10;10;10;13;14;15;16;16;16;16;16;22;29;51;58Þand k = 23. Knowing that smax

24 ; . . . ; smax27

� �¼ ð96;96;96;96Þ the fol-

lowing can be easily obtained:Pk

i¼1si þPn

i¼kþ1smaxi ¼ 750 < 751.

Therefore, based on P3 any solution that starts with Sp cannot befeasible and the algorithm moves to the next subset of solutionsstarting with Sp = ð6;6;6;6;6;6;8;10;10;10;10;13;14;15;16;16;16;16;16;22;29;51;59Þ and k = 23.

Finally, we present the implementation of LaRSA in pseudocode,where the Depth-First Search strategy is used. To search solutiontree, we use subroutine Next (Algorithm 1). For the given S = (s1, -. . . ,sn), it returns the next (in lexicographical order) tuple (seeExample 1) and integer k, which is the first changed element ofthe output in reference to the input; see also Fig. 1. The parameterk 6 n is a level in a searching three in the implemented DFS. On thisbasis, the mentioned partial tuple is obtained, i.e., Sp = (s1, . . . ,sk). In

the algorithm LaRSA (Algorithm 2), the following steps can bedistinguished: branching (Steps 12 and 19), bounding (Steps 2, 5and 8) and pruning (Steps 3, 6 and 9). The given presentation formof LaRSA is to clearly show the idea, which can be duplicated. Nev-ertheless, the final implementation of LaRSA was coded in C++without redundant calculations.

Algorithm 1. [S,k] = Next(S)

1: k = n + 1 and S = (s1, . . . ,sn)2: For i = n To 13: si = si + 14: If si 6 smax

i Then go to Step 7

5: k = i6: End7: For i = k To n8: si ¼max si�1; smin

i

� �9: End10: k = k � 111: Return [S,k]

Algorithm 2. LaRSA

1: Trim smini and smax

i ; S : smin1 ; . . . ; smin

n

� �; k ¼ 1; S� ¼ ;;

f �Aq¼ þ1

2: If P1 holds Then

3: si ¼ smaxi "(i = k, . . . ,n), [S,k] = Next(S), go to Step 21

4: End5: If P2 holds Then

6: si ¼ smaxi "(i = k, . . . ,n), [S,k] = Next(S), go to Step 21

7: End8: If P3 holds Then

9: si ¼ smaxi 8ði ¼ kþ 1; . . . ;nÞ; ½S; k� ¼ NextðSÞ, go to Step 21

10: End11: If k – n Then

12: k = k + 1, go to Step 2

13: End

14: IfPk

i¼1si ¼¼ H Then

15: P = P [ {S}16: If fAq ðSÞ < f �Aq

Then

17: S⁄ = S and f �Aq¼ fAq ðSÞ

18: End

19: [S,k] = Next(S)20: End21: If k = = 0 Then go to Step 2

22: P is the set of all feasible solutions, S⁄ is the

optimal allocation

4. Research results – case study

In this section, we will use LaRSA to provide the allocations ofseats for the EU Parliament taking into consideration populationsin 2007 and 2012 (EuroStat, 2012) (see Table 1). The proposedalgorithm LaRSA was coded in C++ and calculations were run onPC, CPU Intel�Core™i7-2600 K 3.40 GHz and 8 GB RAM.

Recall according to the Treaty of Lisbon, the resolution(Lamassoure & Severin, 2007) and following inter alia (Ramírez-González et al., 2012; Serafini, 2012) that n = 27,s1 = m = 6,sn =M = 96 and H = 751. Such values were analysed mostly in the

Page 4: A fast exact algorithm for the allocation of seats for the EU Parliament

Fig. 1. LaRSA searching tree.

Table 1Minimal smin

i and maximal smaxi feasible values of seats for each country holding

degressive proportionality.

i Country 2007 2012

Population smini

smaxi Population smin

ismax

i

1 Malta 407,810 6 6 416,110 6 62 Luxembourg 476,187 6 7 524,853 6 73 Cyprus 778,684 6 11 862,011 6 114 Estonia 1,342,409 6 18 1,339,662 6 175 Sloveniaa 2,010,377 6 26 2,041,763 6 256 Latviaa 2,281,305 6 29 2,055,496 6 257 Lithuania 3,384,879 8 43 3,007,758 6 368 Ireland 4,312,526 9 54 4,582,769 9 549 Finland 5,276,955 10 66 5,401,267 10 6310 Slovakia 5,393,637 10 67 5,404,322 10 6311 Denmark 5,447,084 10 67 5,580,516 10 6512 Bulgaria 7,679,290 13 94 7,327,224 13 8513 Austria 8,282,984 13 96 8,443,018 14 9614 Sweden 9,113,257 14 96 9,482,855 15 9615 Hungary 10,066,158 15 96 9,957,731 15 9616 Czech Republic 10,287,189 15 96 10,505,445 15 9617 Belgiuma 10,584,534 15 96 10,541,840 15 9618 Portugala 10,599,095 15 96 11,041,266 15 9619 Greece 11,171,740 15 96 11,290,067 15 9620 Netherlands 16,357,992 21 96 16,730,348 22 9621 Romania 21,565,119 27 96 21,355,849 27 9622 Poland 38,125,479 47 96 38,538,447 47 9623 Spain 44,474,631 54 96 46,196,276 56 9624 Italy 59,131,287 71 96 60,820,764 73 9625 United Kingdom 60,781,346 72 96 62,989,550 75 9626 France 63,645,065 75 96 65,397,912 77 9627 Germany 82,314,906 96 96 81,843,743 96 96

a Due to the different relations in populations of Slovenia and of Latvia for years2007 and 2012, these countries are considered for year 2012 in the reversed orderthan presented in Table 1; it is the same for Belgium and Portugal.

J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291 5287

literature. Therefore, in this paper, we also take them intoconsideration to provide a fair comparison. However, additionally,we present calculations concerning the newest decision of the EUParliament, where H = 766 and n = 28 (including Croatia).

At first, we will focus on finding the sets of all feasibleallocations of seats for the analysed years. Next we will analysethe problem of finding such allocations of seats that minimizethe Squared Euclidean Distance from the given Aq(p); two popularfunctions will be considered that are known from literature and

practice. Finally, we will consider the robustness of LaRSA, andpresent the calculations concerning the expansion of EU.

It is worth highlighting that such analysis have not been pre-sented nor possible due to the limitations of the known methods.However, the proposed algorithm LaRSA allows us to overwhelmthese boundaries. To the best of our knowledge the values (e.g.,the number of feasible allocations of seats) provided in the furtherpart, have never been determined.

4.1. Feasible solutions

LaRSA allows us to find out that the number of feasible alloca-tions of seats are jPj = 195,411,484 for 2007 and jPj = 28,989,321for 2012. These values have not been determined till now. A signif-icant difference in the cardinality of these sets for 2007 and 2012can be observed, whereas the demographic structure has not chan-ged crucially. Furthermore, using LaRSA, we can determine the realfeasible values of the minimum s�min

i and of the maximum s�maxi

number of seats for each country i (see Table 2). Since LaRSA findsall feasible solutions, thus, we can also analyse diversification ofallocations, which can be crucial for decision-makers. Namely,the range of different values of seats for 2007 is {9,10, . . . ,22}and for 2012 is {10,11, . . . , 21}. For instance, value 9 means thatthere are 9 groups of countries, which have the same number ofseats. We can also determine the numbers of seats, which cannotappear for feasible allocations. There are no feasible solutions, forwhich any country has the following number of seats {43,. . . ,46,89, . . . ,95} for 2007 and {40, . . . ,46,72,90, . . . ,95} for 2012.

Finally, the algorithm LaRSA required no more than 160 s and30 s to find all feasible solutions (holding C1–C5) for years 2007and 2012, respectively. Moreover, if at least one of the proceduresP1–P3 is not used during the searching process, then the algorithmis not able to find all solutions in a reasonable time. Namely, wehave terminated the searching process after few hours for such set-tings. Thus, the analysis proved a high efficiency of LaRSA.

4.2. Criterion functions

In this part, we will analyse the problem of finding such alloca-tions of seats that minimize the Squared Euclidean Distance fromthe given Aq(p) that is defined as:

Page 5: A fast exact algorithm for the allocation of seats for the EU Parliament

Table 2Minimal s�min

i and maximal s�maxi feasible numbers of seats for each country.

i Country 2007 2012

Population s�mini

s�maxi Population s�min

is�max

i

1 Malta 407,810 6 6 416,110 6 62 Luxembourg 476,187 6 7 524,853 6 73 Cyprus 778,684 6 11 862,011 6 114 Estonia 1,342,409 6 16 1,339,662 6 155 Sloveniaa 2,010,377 6 17 2,041,763 6 166 Latviaa 2,281,305 6 17 2,055,496 6 167 Lithuania 3,384,879 8 18 3,007,758 7 178 Ireland 4,312,526 9 18 4,582,769 10 189 Finland 5,276,955 10 19 5,401,267 11 1810 Slovakia 5,393,637 10 19 5,404,322 11 1811 Denmark 5,447,084 10 19 5,580,516 11 1812 Bulgaria 7,679,290 13 21 7,327,224 14 2113 Austria 8,282,984 14 22 8,443,018 15 2114 Sweden 9,113,257 15 22 9,482,855 15 2215 Hungary 10,066,158 16 24 9,957,731 15 2316 Czech Republic 10,287,189 16 24 10,505,445 15 2317 Belgiuma 10,584,534 16 24 10,541,840 15 2318 Portugala 10,599,095 16 24 11,041,266 15 2419 Greece 11,171,740 16 25 11,290,067 15 2420 Netherlands 16,357,992 21 33 16,730,348 22 3321 Romania 21,565,119 27 42 21,355,849 27 3922 Poland 38,125,479 47 66 38,538,447 47 6323 Spain 44,474,631 54 72 46,196,276 56 7124 Italy 59,131,287 71 85 60,820,764 73 8525 United Kingdom 60,781,346 72 85 62,989,550 75 8826 France 63,645,065 75 88 65,397,912 77 8927 Germany 82,314,906 96 96 81,843,743 96 96

a Due to the different relations in populations of Slovenia and of Latvia for years 2007 and 2012, these countries are considered for year 2012 in the reversed order thanpresented in Table 1; it is the same for Belgium and Portugal.

Table 3The optimal solution S�Aq

and the best solution with the smallest SSAq

and largest SLAq

diversification for Aq 2 {A1,A2} and years 2007 and 2012.

i Country 2007 2012

A1 A2 A1 A2

S�A1 SSA1

SLA1

S�A2 SSA2

SLA2

S�A1 SSA1

SLA1

S�A2 SSA2

SLA2

1 Malta 6 6 6 6 6 6 6 6 6 6 6 62 Luxembourg 7 6 7 6 6 7 7 6 7 6 6 63 Cyprus 9 9 8 6 6 8 8 9 8 6 6 74 Estonia 9 9 9 6 9 9 9 9 9 6 6 85 Sloveniaa 10 9 10 6 9 10 10 9 10 6 9 96 Latviaa 10 9 11 6 9 11 10 9 10 6 9 97 Lithuania 12 13 12 8 13 12 11 9 11 7 9 108 Ireland 13 13 13 9 13 13 12 13 12 10 13 129 Finland 14 13 14 11 13 14 13 13 13 11 13 1310 Slovakia 14 13 14 11 13 14 13 13 13 11 13 1311 Denmark 14 13 14 11 13 14 13 13 13 11 13 1312 Bulgaria 16 18 16 15 18 16 16 17 16 14 17 1613 Austria 17 18 17 16 18 17 17 19 18 16 17 1814 Sweden 18 18 18 17 18 18 19 19 20 17 17 2015 Hungary 19 18 19 18 18 19 19 19 21 17 17 2116 Czech Rep. 19 18 19 18 18 19 19 19 22 17 17 2217 Belgiuma 19 18 19 18 18 19 19 19 22 17 17 2218 Portugala 19 18 19 18 18 19 19 19 22 17 17 2319 Greece 20 18 20 18 18 20 19 19 22 17 17 2320 Netherlands 26 26 26 25 26 22 26 28 23 25 24 2421 Romania 31 33 31 32 34 29 31 28 29 31 30 2722 Poland 50 57 50 55 58 50 50 50 47 55 53 4823 Spain 57 57 57 63 58 57 58 59 56 65 63 5724 Italy 73 75 73 83 75 75 75 77 73 85 82 7425 UK 75 75 75 85 75 77 77 77 75 87 82 7626 France 78 75 78 88 75 80 79 77 77 89 82 7827 Germany 96 96 96 96 96 96 96 96 96 96 96 96

Criterion fAq134 225 135 1231 2373 2308 86 126 165 1043 1562 2524

a Due to the different relations in populations of Slovenia and of Latvia for years 2007 and 2012, these countries are considered for year 2012 in the reversed order thanpresented in Table 1; it is the same for Belgium and Portugal.

5288 J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291

Page 6: A fast exact algorithm for the allocation of seats for the EU Parliament

Table 4The optimal solution S�Aq

and the best solution with the smallest SSAq

and largest SLAq

diversification for Aq 2 {A1,A2}, year 2012, H = 766 and including Croatia.

i Country Population s�mini

s�maxi A1 A2

S�A1 SSA1

SLA1

S�A2 SSA2

SLA2

1 Malta 416,110 6 6 6 6 6 6 6 62 Luxembourg 524,853 6 7 7 6 7 6 6 73 Cyprus 862,011 6 11 8 9 8 6 6 84 Estonia 1,339,662 6 15 9 9 9 6 6 95 Latvia 2,041,763 6 16 10 9 10 7 9 106 Slovenia 2,055,496 6 16 10 9 10 7 9 107 Lithuania 3,007,758 8 17 11 13 11 7 9 118 Croatia 4,398,150 10 18 12 13 12 10 13 129 Ireland 4,582,769 10 18 12 13 12 10 13 1210 Finland 5,401,267 11 18 14 13 13 11 13 1311 Slovakia 5,404,322 11 18 14 13 13 11 13 1312 Denmark 5,580,516 11 18 14 13 13 11 13 1313 Bulgaria 7,327,224 14 21 16 17 16 14 17 1614 Austria 8,443,018 15 21 17 17 18 16 17 1815 Sweden 9,482,855 15 22 19 19 20 17 17 2016 Hungary 9,957,731 15 23 19 19 21 17 17 2117 Czech Rep. 10,505,445 15 23 19 19 22 17 17 2218 Portugal 10,541,840 15 23 19 19 22 17 17 2219 Belgium 11,041,266 15 24 19 19 23 17 17 2320 Greece 11,290,935 15 24 19 19 23 17 17 2321 Netherlands 16,730,348 22 33 26 28 24 25 24 2422 Romania 21,355,849 27 39 31 28 29 31 30 2723 Poland 38,538,447 47 64 50 50 47 55 54 4824 Spain 46,196,276 56 73 58 59 56 65 64 5725 Italy 60,820,764 73 85 75 77 73 85 82 7326 UK 62,989,550 75 88 77 77 75 88 82 7527 France 65,397,912 77 91 79 77 77 91 82 7728 Germany 81,843,743 96 96 96 96 96 96 96 96

Criterion fAq100 138 185 1142 1741 2949

Fig. 2. The function A1 and the optimal allocation S�A1for 2007.

J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291 5289

fAq ðSÞ ¼Xn

i¼1

ðAqðpiÞ � siÞ2; ð1Þ

where following inter alia (Martínez-Aroza & Ramírez-González,2008; Słomczynski & _Zyczkowski, 2012), the two functions Aq(p)are considered:

A1ðpÞ ¼ mþ M �mpn � p1

ðp� p1Þ; ð2Þ

A2ðpÞ ¼HP

p; ð3Þ

where P ¼Pn

i¼1pi and during calculations p has a value of a popula-tion pi for the given country i.

Let S�Aqdenote the optimal solution (allocation of seats) for func-

tion Aq and population data for the given year. Additionally, let SSAq

and SLAq

denote the best allocation among such with the smallestand largest diversification, respectively, for function Aq. The resultsfor n = 27 and H = 751 are presented in Table 3 for years 2007 and2012, where the criterion values are rounded to integers. The opti-mal solutions for the criterion fA1 and fA2 in year 2007 are presentedin Figs. 2 and 3, respectively.

Page 7: A fast exact algorithm for the allocation of seats for the EU Parliament

Fig. 4. The function A1 and the optimal allocation S�A1for 2012 including Croatia.

Fig. 3. The function A2 and the optimal allocation S�A2for 2007.

5290 J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291

Once again, it is worth highlighting that such analysis have notbeen possible till now.

4.3. Robustness

In this part, we will take into consideration the latest resolvefrom the 19 February 2013, which constitutes that the total num-ber of seats H is set to 766, when Croatia finally concludes itsaccession to the EU. The calculations are done for the actual popu-lation, which is from 2012.

LaRSA required less than 30 s to examine all feasible allocationsof seats for such settings. It allows us to find out that the number of

feasible solutions for the newest resolve is jPj = 33,493,213. Therange of different values of seats (diversification) is{10,11, . . . ,21}. Furthermore, there are no feasible solutions, forwhich any country has the following number of seats{40, . . . ,46,92, . . . ,95}.

The results are presented in Table 4, where the criterion valuesare rounded to integers. The real feasible values of the minimums�min

i and of the maximum s�maxi number of seats for each country

i are also given. Additionally, the optimal solutions for the criterionfA1 and fA2 are presented in Figs. 4 and 5, respectively.

It can be observed in Table 4, from the perspective of theoptimal solution for fA1 , the new decision affects only Finland,

Page 8: A fast exact algorithm for the allocation of seats for the EU Parliament

Fig. 5. The function A2 and the optimal allocation S�A2for 2012 including Croatia.

J. Łyko, R. Rudek / Expert Systems with Applications 40 (2013) 5284–5291 5291

Slovakia and Denmark, for which the number of seats is increasedfrom 13 to 14 (see also Table 3), whereas Croatia receives 12seats. In the optimal solution for fA2 , Estonia, Latvia and UK re-ceive 1 additional seat, France has 2 additional seats, whereasCroatia has 10 seats.

The analysis showed that the proposed algorithm as well as thecriterion fA1 are robust.

5. Conclusions

In this paper, we analysed the problem of allocation of seats forthe EU Parliament. To solve it, we proposed the fast exact algo-rithm LaRSA. It overwhelmed limitations of the existing methods,since it examines all feasible allocations of seats, whereas itsrunning time does not exceed 160 s. On this basis, we providedan in-depth analysis of the problem taking into considerationpopulations for years 2007 and 2012. It revealed some problemproperties, which have never been presented in the scientificliterature. Moreover, robustness of the algorithm as well as ofthe criterion fA1 were shown.

Since the proposed algorithm can be easily extended to analysedifferent allocation criteria fAq (configurations), thus, it can be fur-ther used for the analysis of other ‘‘quotas’’ and criteria. Therefore,it can constitute an expert system that supports obtaining unprej-udiced rule for the composition of the EU Parliament. Finally, thealgorithm (and the related expert system) can be applied for anyother similar problem, especially under degressive proportionalityconstraints.

Note that LaRSA can examine branches of a searching tree inde-pendently. Therefore, it can be easily transformed to a distributedversion, which will be our future work.

Acknowledgement

This work was partially supported by the Polish National Sci-ence Centre under Grant No. N N111 553440.

References

EuroStat. (2012). Populations of EU counties. <http://epp.eurostat.ec.europa.eu>[accessed: 2012-12-22].

Grimmett, G. R. (2012). European apportionment via the Cambridge compromise.Mathematical Social Science, 63, 68–73.

Grimmett, G. R., Laslier, J. -F., Pukelsheim, F., Ramírez González, V., Rose, R.,Słomczynski, W., Zachariasen, M. & _Zyczkowski, K. (2011). The allocationbetween the EU Member States of the seats in the European Parliament.European Parliament Studies PE 432.760. <http://tinyurl.com/6f3ff6u>[accessed: 2012-06-14].

Lamassoure, A., & Severin, A. (2007). European Parliament Resolution on ‘‘Proposalto amend the Treaty provisions concerning the composition of the EuropeanParliament’’, adopted on 2007-10-11 (INI/2007/2169).

Lee, W.-C., Chen, S., & Wu, C.-C. (2010). Branch-and-bound and simulated annealingalgorithms for a two-agent scheduling problem. Expert Systems withApplications, 37, 6594–6601.

Łyko, J., Rot, A., & Rudek, R. (2012). Application of the criterion of proportionalallocation in the case of degressively proportional division. In Proceedings ofInternational Conference on Mathematical Sciences & Computer Engineering (Vols.29-30), (pp. 33-37). Kuala Lumpur, Malaysia.

Martínez-Aroza, J., & Ramírez-González, V. (2008). Several methods for degressivelyproportional allotments. A case study. Mathematical and Computer Modelling, 48,1439–1445.

Ramírez-González, V., Martínez-Aroza, J., & Márquez-García, A. (2012). Splinemethods for degressive proportionality in the composition of the Europeanparliament. Mathematical Social Sciences, 63, 114–120.

Rudek, R. (2013). On single processor scheduling problems with learning dependenton the number of processed jobs. Applied Mathematical Modelling, 37,1523–1536.

Serafini, P. (2012). Allocation of the EU Parliament seats via integer linearprogramming and revised quotas. Mathematical Social Science, 63, 107–113.

Słomczynski, J. W., & _Zyczkowski, K. (2012). Mathematical aspects of degressiveproportionality. Mathematical Social Science, 63, 94–101.

The Treaty of Lisbon. (2010). The Treaty of Lisbon. <http://europa.eu/lisbon_treaty/full_text/index_en.htm> [accessed: 2010-05-18].

TOP500. (2012). TOP500 Press Release: Lawrence Livermore’s SequoiaSupercomputer Towers above the rest in latest TOP500 List. <http://www.top500.org/lists/2012/06/press-release> [accessed: 2012-06-14].