Apportionments with minimum Gini index of disproportionality: a Quadratic Knapsack approach

The ultimate goal of proportional apportionment methods is the minimization of disproportionality, i.e., unequal distribution of political representation among voters, or citizens. The Gini index is a well known tool for measuring inequality. In this work we propose a quotient method that minimizes the Gini index of disproportionality. Our method reduces the rounding of quotas to an instance of quadratic knapsack, a widely studied combinatorial optimization problem. Preliminary computational results, including real cases from the EU Parliament and the US House of Representatives, show that the method is effective, since the instances to solve are rather easy.


Introduction
Proportional methods offer different recipes to mitigate the unavoidable distortion arising when votes are translated into seats. Several indexes of disproportionality, or inequality, have been proposed to measure this distortion; typically, it can be shown that a certain index (or class of indexes) is minimized by a corresponding (traditional or ad-hoc) apportionment method, see Grilli di Cortona et al. (1999), Balinski and Young (2001) and Edelman (2006) for an overview of these results. This leads to and supports the practice of, quoting Edelman (2006): ". . . evaluating methods of apportionment based on the objective function they optimize". In particular, this approach is followed by Grilli di Cortona et al. (1999), who describe proportional methods as procedures solving an underlying optimization problem, where the objective function (the "hidden criterion") corresponds to some inequality index. These Authors also suggest that, beyond evaluation, new proportional methods may be defined based on the optimization approach: minimize a given index subject to constraints enforcing specific properties, such as the quota property. In principle, any well-founded measure of inequality, dispersion or variability may be adopted as the objective function, D. Pretolani ( ) DISMI, Università di Modena e Reggio Emilia, Via Amendola 2, 42122 Reggio Emilia, Italy e-mail: daniele.pretolani@unimore.it including indexes developed in other application areas. For example, Grilli di Cortona et al. (1999) suggest as a suitable choice (among others) the Gini index: we pursue this idea in the present work.
The Gini index, hereafter referred to as G, is a measure of statistical dispersion introduced about one century ago by Corrado Gini (1912Gini ( , 1921 and commonly adopted in welfare economics and social sciences (and other disciplines) as an index of concentration, i.e., unequal distribution of income or wealth among a population. A discussion of the meaning and interpretation of G would go far beyond the scope of this paper; we refer the interested reader e.g. to Xu (2004). Here we adopt the usual geometric definition of G in terms of Lorenz curves, that are one of the first historical attempts to represent and compare wealth distributions. In our context, we consider the number of seats assigned to a party as the "wealth" shared by the voters of that party. In this way, we use G as an index of unequal distribution of political representation, or "voting power", among voters.
In general (we provide a simple example later on) an apportionment minimizing G may violate the quota property, that requires each party to receive either the upper or the lower integer rounding of its ideal fractional quota. In this paper we do not address the minimization of G in the general case, but rather a restricted version of the problem, where the quota property is explicitly enforced; in other words, we devise a particular quotient method. This restriction is motivated by the nice structure of the resulting optimization problem. Indeed, quotient methods perform a binary choice (rounding quota either up or down) for each party: as already noticed in Grilli di Cortona et al. (1999), this leads to a problem with a binary knapsack structure. Here we show that a rounding that gives a minimum G can be found solving an instance of the (binary) quadratic knapsack problem (QKP). This problem has been introduced by Simeone (1979) and by Gallo et al. (1980), and has been widely studied, see Kellerer et al. (2004, Chap. 12) for an overview. From a computational point of view, QKP is known to be much harder than its linear counterpart, nevertheless, instances with a few hundred variables can be solved with state of the art methods, see Pisinger et al. (2007). In our application the number of variables corresponds to the number of parties, thus the resulting QKP instances are limited in size and rather easy to solve, as confirmed by some preliminary computational tests.
Note that QKP is known to be strongly NP-hard, even if all coefficients are in {0, 1} (Kellerer et al. 2004, Chap. 12) but this does not imply that our apportionment problem (i.e., minimize G subject to the quota property) is NP-hard as well. In fact, the true computational complexity of this problem remains an open issue.
The paper is organized as follows. In the next section we introduce the necessary definitions, and discuss some examples. In Sect. 3 we provide the QKP formulation and report computational results. In the last section we draw some conclusions and suggest directions for further work.

Definitions and examples
We consider the apportionment of S seats among n parties given the vector v of votes, where v i > 0 is the number of votes cast for party i, and V = n i=1 v i is the total number of votes. We denote by s a generic apportionment, where s i is the number of seats assigned to party i, and clearly S = n i=1 s i ; note that some s i may be zero. Observe that s i can be considered as the "power" shared by the v i voters of party i; in other words, each voter of i owns (or earns) the same voting power w i = s i /v i . In this paper we take voting power as a measure of political representation, and adopt G as an index of unequal distribution of voting power.
Note that, even if stated in terms of "parties" and "votes", our results apply to the case where seats must be assigned to states based on the number of inhabitants, as happens e.g. for the US Congress and the EU Parliament; indeed, we later report some computational results for these two cases. In this context, the inverse of the voting power 1/w i = v i /s i is usually referred to as the district size; thus our method aims at minimizing inequality in the distribution of district size.

Apportionment methods
Given v, we can define for each party i its natural quota q i = v i · S/V ; we let q i = u i + r i , where u i = q i is the integer part of q i , and r i is the remainder of party i. In a quotient method, q i is assumed as the ideal fraction of seats to be assigned to party i, and each party i is assigned either u i = q i or q i seats; clearly, i is assigned exactly q i seats in the (rather unlikely) case that q i is integer, i.e., r i = 0. We denote by K = S − n i=1 q i = n i=1 r i the number of seats yet to be assigned after each party is allotted its minimum u i . We assume that K > 0, i.e., there exist some r i > 0; clearly, we have K < n. An actual quotient method is defined by a rounding rule selecting the K parties receiving q i seats instead of q i . The most commonly adopted rounding rule is Largest Remainders, where the K seats are assigned to the K (parties with the) largest r i . Some other examples of rounding rule are described later.
In the forthcoming examples we also consider divisor methods, see Balinski and Young (2001), Grilli di Cortona et al. (1999). A divisor method is defined by an increasing sequence of divisors d(t), for t = 0, 1, 2, . . . , such that t ≤ d(t) ≤ t + 1 and d(t) < d(t + 1); for each party i and divisor t the ratio v i /d(t) is computed, and seats are assigned to the largest S ratios (actually to the corresponding parties) breaking ties arbitrarily. In particular, we denote by D(a) a generic divisor method where d(t) = t + a for each t . Recall that some well known divisor methods fall in this category, e.g.,

Lorenz curves and the Gini index
The usual geometric definition of G is based on the Lorenz curve L, which is a plot of cumulative share of wealth, normalized within a unit square. For a population of N individuals, L is a piecewise linear curve with N + 1 breakpoints where W h is the cumulated wealth share of the "poorest" h individuals. In other words, individuals appear from left to right in non-decreasing order of wealth. It follows that L is convex, since the slopes of the linear pieces (p h , p h+1 ) are non-decreasing with h; moreover, L lies below the diagonal D joining p 0 and p N . Let A be the area delimited by A and D, and let B the area of the square lying below L (see the left part of Fig. 1); note that Note that G = 0 in case of perfect equality, i.e., if L coincides with D, and G = 1 − 1/N if a single individual owns the whole wealth. In our application we consider the number of seats S as the total wealth of a population consisting of the V voters. In particular, each voter of party i owns the same wealth w i . As a consequence, all the voters of party i can be represented by a single linear piece P i of L, spanning v i /V (the share of votes) horizontally, and s i /S (the share of seats) vertically; see the right part of Fig. 1. Then, L is made up of n linear pieces P i , 1 ≤ i ≤ n; clearly, these pieces appear from left to right in nondecreasing order of slopes, i.e., parties appear in nondecreasing order of voting power.

Examples
The following examples show that traditional proportional methods, or simple variants of them, are not guaranteed to minimize G. This amounts to say that minimizing G is not a trivial problem, even if we restrict to quotient methods.
For easiness of presentation, in our examples we directly provide the vector q of quotas rather than the vector of votes v. Moreover, when applying divisor methods we consider the ratios According to this choice, in Figs. 2, 3 and 4 we represent Lorenz curves normalized within their corresponding S × S square, rather than within a unit square. In this way, the vote share v i /V of party i is replaced by its quota q i = S · v i /V , and the seat share s i /S is replaced by the number of seats s i . As a result, areas A and B are scaled by a factor S 2 , but this does not affect the value G = A/(A + B); in particular, note that minimizing G is equivalent to maximizing B.
The first example shows that an apportionment minimizing G does not necessarily satisfy the quota property; this implies that any quotient method (like ours) may miss the global minimum of G.
The last example shows that any divisor method D(a) with a ≥ 1/2 (in particular, Sainte-Laguë) may fail. Combined with the previous example, this shows that no divisor method D(a) is guaranteed to minimize G in all cases.

A Quadratic Knapsack formulation
In this section we address the problem of finding an apportionment that satisfies the quota property and minimizes G. In particular, we search an apportionment s = u + x, where for each i we have s i = u i + x i and x i ∈ {0, 1}. The vector x ∈ {0, 1} N defines the rounding of quotas, and provides the variables of our optimization problem. We follow a geometric approach, where the goal is the maximization of the area B obtained from s; here we comply to the unit square normalization assumed in Eq. (1). In order to obtain a QKP formulation we need to express B as a quadratic function of x. After discussing some details of our formulation we report some preliminary computational results.

A quadratic function for area B
Given the apportionment s = u + x, we say that party i precedes party j , denoted as i x j , if i appears in L to the left of j . Recall that parties (linear pieces) appear in L, from left to right, in nondecreasing order of voting power w i = s i /v i . In case of a tie, i.e., w i = w j , we assume i x j if i < j; in this way, the total order x is completely defined by x. Moreover, we assume that parties are indexed in nondecreasing order of ratio u i /v i , i.e., i < j ⇒ u i /v i ≤ u j /v j . The following relations (used later) hold true for each party h: (2) Our goal is to express B as a quadratic function of the binary vector x: where C is a constant, and Q is an n × n upper triangular matrix with nonnegative entries. Note that q ii is the linear contribution of x i . Observe that the area B can be partitioned into n vertical "slices" B i , where each B i lies below the linear piece P i ; in turn, each B i can be partitioned as follows (see Fig. 5, left part): -the upper triangle, with area T i = v i /2SV , which is part of B i if and only if x i = 1, meaning that T i contributes to q ii ; -the middle triangle, with area T 0 i = v i · u i /2SV , which is part of B regardless of the vector x, meaning that T 0 i contributes to C; -the lower rectangle, with area R i depending on the order x : Given x, and a pair of parties i and j , two cases are possible: either i precedes j , and induces a slice of R j with area R ij = s i · v j /SV ; or j precedes i, and induces a slice of R i with area R ij = s j · v i /SV ; the former case is shown in the right part of Fig. 5. Therefore, we can write: The next step is to show that each R ij can be written as a quadratic function of x i and x j . We consider a generic pair of parties i and j with i < j, which implies u i /v i ≤ u j /v j by assumption. We distinguish two cases.
For each combination of x i and x j Table 1 shows the voting power of i and j , the order x , and the values of R ij . Note that we have j x i if and only if x i = 1 and it is routine to check that: Note that: (2).

Case 2
We have (u i + 1)/v i > (u j + 1)/v j , thus i x j if x i = 0, and j x i if x i = 1; see Table 2. Defining a ij = u j · v i − u i · v j as before, we have: Putting together (4) and the functions for R ij we can define the constant C and the matrix Q in (3). Recall that a ij = u j · v i − u i · v j for each i < j.
Note that Q has nonnegative entries, and q ii > 0 for each i.

Rounding quota to maximize B: the QKP formulation
In order to obtain a valid apportionment s = u + x we must set to one exactly K out of the n variables in the vector x. The goal is to maximize B, which amounts to maximizing the quadratic objective function x T Qx. This can be formulated as a particular case of quadratic knapsack, where each item has unit weight, the knapsack capacity is K, and Q is the profit matrix: Note that we have an inequality constraint in (P ), however, exactly K items enter the knapsack in an optimal solution, since Q is nonnegative and q ii > 0 for each i. Moreover, in problem (P ) every item may be selected to enter the knapsack, i.e., every quota can be rounded either up or down. However, in the (rather unlikely) case where some party h has an integer quota q h , h must be assigned exactly q h = u h seats, and therefore we must have x h = 0. This can be easily obtained giving h a weight greater than K, instead of a unit weight. In practice, one can simplify (P ) dropping variable x h and deleting from Q the corresponding row and column. Note that there may be k > 1 parties with integer quotas, however, we must have k < n − K, since the sum of all the remainders is K > 0.

Computational results
Recall that the quadratic knapsack problem is strongly NP-Hard, even if items have unit weights as in (P ). On the other hand, in our case the problem size is limited by the number of parties, therefore, we may expect problem (P ) to be tractable for all practical purposes. The results of a preliminary computational experience seem to confirm this hypothesis.
Our computational tests were run on a portable PC, with a dual-core 2 GHz processor and 2 GB RAM, under Linux operating system. Programs were written in C language and compiled with gcc 4.5.0, with no code optimization. To solve QKP instances we used procedure quadknap by Caprara et al. (1999); the C implementation was downloaded from http://www.diku.dk/~pisinger/.
Results for randomly generated instances are definitely encouraging. We considered instances where each number of votes v i is generated independently with a uniform distribution in the interval [1, V max ]. It turns out that problems with n = 25 parties, S = 1000 seats and V max = 8,000,000 (i.e., expected number of votes V around one hundred million) are solved in about ten milliseconds. We do not report statistics for these instances, since they would be rather meaningless. Instead, we concentrate on a few instances arising from two real cases where seats must be assigned to states based on their populations: the EU Parliament and the US House of Representatives. For these instances, we also test unicity of the optimal apportionment; to this aim, we proceed as follows.
Letx and G be the optimal solution and the minimum G obtained from (P ), respectively. For each party i such thatx i = 1 we solve a modified version of (P ), denoted as (P (i) ), where we force x i = 0 giving item i a weight K + 1. Note that, in each problem (P (i) ),x is not a feasible solution; clearly, an alternate optimal apportionment exists if and only if some of the (P (i) ) has optimal value G. In this way, we reduce the unicity test to solving K instances of QKP almost identical to problem (P ); this approach is rather naive but fits our purposes. In fact, the optimal apportionment turns out to be unique for all our instances. A summary of our results is given below. The European Parliament Current treaties introduce several limitations on the composition of the EU Parliament, with a consistent over-representation of the less populated countries. 1 However, we completely disregard these aspects here; in fact, we use existing data to create an artificial apportionment problem. We consider the allotment of S = 751 seats among the n = 27 members of the European Union, according to the 2011 population data. The total population is V = 501,103,425, and we have K = 14; overall, we solve K + 1 = 15 QKP problems in about 0.14 seconds. The optimum value of G is slightly above 0.005585. By comparison, the apportionment obtained via the Cambridge Compromise (see Grimmett 2012) yields a G slightly less than 0.128271, i.e., more than twenty times greater. These numbers may give a hint of the level of disproportionality introduced by current limitations.
The US House of Representatives In this case, the S = 435 seats of the House must be divided among n = 50 states. We considered the population data 2 for 1990, 2000 and 2010.
Problem size and results are summarized in Table 3, where G is the optimal value computed by our method, while G a refers to the actual apportionment, obtained from Equal Proportions; the overall execution times for the K + 1 QKP problems are reported in seconds. Note that for the 2010 Census the optimal rounding returns the actual apportionment. In the other two cases, our method returns a slightly different apportionment, with a slightly smaller value G. It may be interesting to note that these differences follow opposite patterns in the two cases. For the 2000 Census, our method moves one single vote from the larger state (California) to a relatively small state (Utah). On the contrary, for the 1990 Census, our method moves seats from smaller to larger states, namely from Mississippi, Oklahoma and Washington to Massachusetts, New Jersey and New York.

Conclusions
In this work we defined a quotient method that minimizes the Gini inequality index of the distribution of political representation among voters. The method adopts a rounding technique that consists in solving an instance of quadratic knapsack, a well known combinatorial optimization problem. Moreover, we showed that the method is likely to be computationally tractable for all practical purposes. From a theoretical point of view, however, our analysis is not yet complete, since we could not determine the computational complexity of the underlying optimization problem. This leaves open the possibility of finding a polynomial time rounding procedure.
Another direction of research concerns the extension of our techniques beyond quotient methods. This may be relevant, for example, in those cases where explicit violations of the quota property are required, as in the EU Parliament. Unfortunately, removing the quota restriction destroys the structure of the underlying optimization problem, therefore, the general case leads to a more complex and computationally harder model. Solving this model efficiently may turn out to be a stimulating hard task.