Manipulating Districts to Win Elections: Fine-Grained Complexity
MManipulating Districts to Win Elections: Fine-GrainedComplexity
Eduard Eiben, Fedor V. Fomin, Fahad Panolan, Kirill Simonov Department of Computer Science, Royal Holloway, University of London, UK Department of Informatics, University of Bergen, Norway Department of Computer Science and Engineering, IIT Hyderabad, [email protected], { fedor.fomin, kirill.simonov } @uib.no, [email protected] February 2020 Abstract
Gerrymandering is a practice of manipulating district boundaries and locations in order to achieve a politicaladvantage for a particular party. Lewenberg, Lev, and Rosenschein [AAMAS 2017] initiated the algorithmicstudy of a geographically-based manipulation problem, where voters must vote at the ballot box closest to them.In this variant of gerrymandering, for a given set of possible locations of ballot boxes and known political pref-erences of n voters, the task is to identify locations for k boxes out of m possible locations to guarantee victoryof a certain party in at least (cid:96) districts. Here integers k and (cid:96) are some selected parameter.It is known that the problem is NP -complete already for political parties and prior to our work only heuristicalgorithms for this problem were developed. We initiate the rigorous study of the gerrymandering problem fromthe perspectives of parameterized and fine-grained complexity and provide asymptotically matching lower andupper bounds on its computational complexity. We prove that the problem is W [1]-hard parameterized by k + n and that it does not admit an f ( n, k ) · m o ( √ k ) algorithm for any function f of k and n only, unless the ExponentialTime Hypothesis (ETH) fails. Our lower bounds hold already for parties. On the other hand, we give analgorithm that solves the problem for a constant number of parties in time ( m + n ) O ( √ k ) . In 1812, Massachusetts governor Elbridge Gerry immortalized his name by signing a bill that created a mytho-logical salamander shaped district in the Boston area to the benefit of his political party. Since then the termgerrymandering has been used for the practice of establishing a political advantage by manipulating voting districtboundaries. Wikipedia article Gerrymandering contains a lot of notable gerrymandering examples in electoralsystems of many countries. One of possible responses of such manipulations is a more “rational” definition ofvoting districts, for example the system where voters should always go to a ballot box (or central area) that isclosest to them [19].However, even in the “rational” geographical settings manipulations are still possible. [15] considered thevariant of the gerrymandering problem in which the agent in charge of the design of voting districts has to followa clear rule: all voters vote in the ballot box nearest to them.
As it was shown by [15], even with clear and rationalrules, manipulation is possible. This brought Lewenberg et al. to the following natural question. Is there anefficient algorithmic procedure that would allow an agent, who is obliged to follow the rules, to optimize divisionfor his personal preferred outcome? The good news here is that the existence of such a procedure is highly unlikely,because as it was shown in [15], the problem is NP -complete already for political parties.On the other hand, when the number of districts k is small, the problem is trivially solvable in time m k n O (1) ,where m is the number of all possible locations of ballot boxes and n is the number of voters, by a brute-forceenumerating all possible locations for k boxes. Thus in the situation when the number of districts is small, there isan efficient procedure for finding an optimal manipulation. This immediately brings us to the following questionwhich serves as the departure point of our work. Question 1.
Is it possible to solve the gerrymandering problem faster than the brute-force?
To answer this question, we study G
ERRYMANDERING through the lens of Parameterized Complexity, whichis a multivariate paradigm of algorithm analysis introduced by [7]. In Parameterized Complexity, one measures the1 a r X i v : . [ c s . D S ] F e b erformance of algorithms not merely in terms of the size of the input, but also with respect to certain propertiesof the input or the output (captured by one or several numerical parameters , k ). This gives rise to two notions oftractability, both of which correspond to polynomial-time tractability in the classical setting, when the parameteris constant. First is the class FPT that contains all problems that can be solved in time f ( k ) · n O (1) (for somecomputable function f ), while the (asymptotically less efficient) class XP contains all problems that can be solvedin time n f ( k ) . Aside from these complexity classes, we will make use of the complexity class W [1], the classof parameterized problems that can be in time f ( k ) · n O (1) reduced to I NDEPENDENT S ET parameterized by thesolution size. FPT (cid:54) = W [1] is the working hypothesis of Parameterized Complexity and it is widely believed thatno W [1]-hard problem is in FPT . Finally, our more fine-grained lower bound result depends on the ExponentialTime Hypothesis (ETH) [13, 16], which states that the satisfiability of k - CNF formulas (for k ≥ ) is not solvablein subexponential-time o ( n ) , where n is the number of variables in the formula. We refer to the recent books [4]and [8] for more exposition on these complexity notions. Contribution [15] proved that G
ERRYMANDERING plurality (the Gerrymandering problem when the winner ateach district is decided by plurality voting rule) is NP -complete, even when the number of candidates | C | is .We enhance this intractability result by providing a fine-grained complexity of the problem. Also note that ourreduction also implies that the problem is NP-complete for any number | C | ≥ of candidates. Theorem 1.
For any number | C | ≥ of candidates, G ERRYMANDERING plurality is W [1]-hard parameterizedby k + n . Moreover, there is no algorithm solving G ERRYMANDERING plurality in time f ( k, n ) · m o ( √ k ) for anycomputable function f , unless ETH fails.
The tools we used to obtain lower bounds are based on the grid-tiling technique of [17]. We refer to the bookof [4] for further discussions of subexponential algorithms.Interestingly, the ETH lower bound from Theorem 1 is asymptotically tight. We give an algorithm whoserunning time matches our lower bound.
Theorem 2.
For any constant number of candidates and for any voting rule g , G ERRYMANDERING g is solvablein time ( m + n ) O ( √ k ) . To obtain our algorithm, we use the machinery developed by [18]. The main idea is to guess roughly √ k manyballot boxes from an optimal solution that separate the plane into two parts such that each part contains between k/ and k/ ballot boxes of the solution. Related work
The G
ERRYMANDERING problem was introduced by [15]. It is an example of general controlproblem, where a central agent may influence the outcome using its power over the voting process [1, 2, 9, 12, 14].The problem also belongs to the large family of voting manipulation problems, whose computational aspectsare widely studied in the computational social choice community, see [3, 10, 11, 20] for further references. Inparticular, parameterized complexity of manipulation was studied in [5, 6].
For an integer i , we let [ i ] = { , , . . . , i } . We denote by N the set of natural numbers and by R the set of realnumbers. Given two points p = ( x , y ) , p = ( x , y ) in the plane R , the distance between p and p is dist( p , p ) = (cid:112) ( x − x ) + ( y − y ) . ERRYMANDERING
Given a set of voters V = { v , . . . , v n } and a set of candidates C , the preference ranking of voter v i is a totalorder (i.e., transitive, complete, reflexive, and antisymmetric relation) (cid:31) i over C . The interpretation of c (cid:31) i c isthat the voter v i strictly prefers candidate c over candidate c . We denote by π ( C ) the set of preference rankingsfor the set of candidate C . A voting rule is then a function f : π ( C ) n → C . An election E f = ( C, V ) isthen comprised of a set of voters V , a set of candidates C , a preference ranking (cid:31) i over C for each voter and avoting rule f . In this paper, we will only consider voting rules that do not distinguish between voters. That is theoutcome of the voting rule only depends on the number of voters with each preference ranking and not their order.An example of such rule is plurality , in which for each voter only the topmost candidate counts and the winner isthe candidate that got the most votes. 2n a district-based election E f,g voters are divided into disjoint sets V , . . . , V s such that (cid:83) i ∈ [ s ] V i = V . Thesesets define elections E if = ( C, V i , ) . The ultimate winner from amongst the winners of E if is determined by votingrule g , which for us will be a threshold function . Definition 1 (G ERRYMANDERING [15]) . The input of the G ERRYMANDERING f problem is: • A set of candidates C . • A set of n voters V = { v , . . . , v n } ⊂ R , where every voter v i ∈ V is identified by their location on theplane, and a preferred ranking (cid:31) i ∈ π ( C ) . • A set of m possible ballot boxes B = { b , . . . , b m } ⊂ R . • Parameters (cid:96), k ∈ N , such that (cid:96) ≤ k ≤ m . • A target candidate p ∈ C .The task is to decide whether there is a subset of k ballot boxes B (cid:48) ⊆ B , such that they define a district-basedelection, in which every voter votes at their closest ballot box in B (cid:48) , the winner at every ballot box is determinedby voting rule f , and p wins in at least (cid:96) ballot boxes. We assume that there are no two possible ballot boxes and a voter such that the voter is equidistant from thetwo boxes, meaning that no voter could ever be exactly on the boundary between two districts and so a fixed setof ballot boxes unambiguously defines the partition of voters into districts.In Figure 1, we give an example of an input of G
ERRYMANDERING g and two possible solutions.Figure 1: The example of [15]. The green circle and red cross are voters voting for a different candidates. Thesquares are ballot boxes. In the bottom are two examples with 3 ballot boxes opened giving a different outcome. To describe our algorithm, we require the notion of a Voronoi diagram. For a finite set of points P on the plane, the Voronoi region of a point p ∈ P is the set of those points of the plane that are closer to p than to any other pointin P . We may also use the Voronoi cell as a synonym. A Voronoi region is convex and its boundary is a polylineconsisting of segments and possibly infinite rays, since the Voronoi region of p ∈ P is essentially the intersectionof | P | − half-planes. The Voronoi diagram of P is the tuple of the Voronoi regions of all the elements of P .The Voronoi diagram could be considered a planar graph. The faces of the graph correspond to the Voronoiregions, the edges correspond to the segments which form the boundaries of the individual regions, and the verticesare the endpoints of these segments. The technical details of this correspondence can be found in [18].Voronoi diagrams appear naturally in G ERRYMANDERING problem, since when the set S of ballot boxeschosen is fixed, the Voronoi diagram of S defines exactly which regions of the plane are assigned to vote in aparticular ballot box. To obtain our ETH lower bound and prove W [1]-hardness of G ERRYMANDERING , we reduce from the following W [1]-hard problem. Definition 2 (G RID T ILLING [17]) . The input of the G RID T ILING problem is: Lewenberg et al. [15] also define the weighted problem, where every voter v has weight w v . We focus on the version without weights. Integers k, n ∈ N , and a collection S of k nonempty sets S i,j ⊆ [ n ] × [ n ](1 ≤ i, j ≤ k ) .The task is to decide whether there is a set of pairs s i,j ∈ S i,j , for each ≤ i, j ≤ k , such that: • If s i,j = ( p, q ) and s i +1 ,j = ( p (cid:48) , q (cid:48) ) , then p = p (cid:48) . • If s i,j = ( p, q ) and s i,j +1 = ( p (cid:48) , q (cid:48) ) , then q = q (cid:48) . Lemma 1 ([17], see also Theorem 14.28 in [4]) . G RID T ILING is W[1]-hard parameterized by k and, unless ETH fails, it has no f ( k ) n o ( k ) -time algorithm for any computable function f . Figure 2: Example of a hardness reduction from Grid Tiling for n = 3 and k = 2 . The sets are S , = { (1 , , (2 , , (3 , } , S , = { (1 , , (2 , , (2 , , (3 , } , S , = { (1 , , (2 , , (3 , } , and S , = { (1 , , (3 , } . The voters are denoted by × , where our candidate is red and the other candidate is blue. Themultiplicity of red voters in each cell is more than the sum of the blue voters in the same cell. The ballot boxesare depicted as • . A solution to an instance is the set of red ballot boxes. Overview of the Proof.
Before we give a formal proof of Theorem 1, we first give an informal description of ourreduction from G
RID T ILING problem that excludes some tedious computations that are necessary for the proofto work, but are not important for understanding where the difficulty of the problem lies. The main idea is to putall voters and ballot boxes inside large k × k grid such that the cell ( i, j ) of this grid correspond to the set S i,j .In the center of each cell is one much smaller n × n grid corresponding to the set S i,j (see Figure 2). The ballotboxes are placed on appropriate positions inside small grid, with a small catch – for two neighboring cells of largegrid, the small grids are “mirrored”. This way, if we select precisely the same pair ( p, q ) for each set S i,j , then thevoters inside each large cell vote in the ballot box inside the same cell.We will place a number of the “other candidate” voters, determined by a calculation later in the proof, veryclose to the center of each of 4 borders of the cell (see Figure 2). By selecting the right distances, for the size ofthe large grid, size of the small grid, and distance of the “other candidate” voters to the border of the cell, we canforce that if we select ballot boxes corresponding to s i,j = ( p, q ) ∈ S i,j and s i +1 ,j = ( p (cid:48) , q (cid:48) ) ∈ S i +1 ,j (resp. s i,j +1 = ( p (cid:48) , q (cid:48) ) ∈ S i,j +1 ), then the voters near the border between cells corresponding to S i,j and S i +1 ,j (resp. S i,j +1 ) vote inside their corresponding cells if and only if p = p (cid:48) (resp. q = q (cid:48) ).Finally, we place in the center of each large cell the number of the “our candidate” voters that is just 1 largerthan the number of the “other candidate” voters inside the cell. As we placed “our candidate” voters on k k ballot boxes, in each box in a solution has to vote all voters from precisely one ofthese positions. Furthermore, by selecting the number of voters in each cell to grow exponentially, we get that theonly way to win all ballot boxes is if all voters in the same cell vote in the same ballot box. This is only possibleif we choose in each cell precisely one ballot box and if the corresponding selection of pairs in S i,j ’s is actually asolution to the original G RID T ILING instance.In the remaining of the section we formalize above intuition by assigning the voters and ballot boxes specificpositions in the plane and computing distances between positions of ballot boxes and “other candidate” voters.
Theorem 1.
For any number | C | ≥ of candidates, G ERRYMANDERING plurality is W [1]-hard parameterizedby k + n . Moreover, there is no algorithm solving G ERRYMANDERING plurality in time f ( k, n ) · m o ( √ k ) for anycomputable function f , unless ETH fails.Proof.
We will prove the theorem by a reduction from G
RID T ILING . Let k, n ∈ N be integers and S be a collec-tion of k nonempty sets S i,j ⊆ [ n ] × [ n ](1 ≤ i, j ≤ k ) . We will construct an instance I = ( C, V, B, k , k , “red” ) of G ERRYMANDERING plurality with two candidates “red” and “blue”, O ( k ) voters and O (cid:0) k n (cid:1) ballot boxesand all voters and boxes positioned at the integral points inside [ O (cid:0) k · n (cid:1) ] × [ O (cid:0) k · n (cid:1) ] grid. Ballot boxes.
Let ( p, q ) ∈ S i,j , we let x i,j ( p,q ) = (10 n + 4 n )( i −
1) + 5 n + 4 p if i is even and x i,j ( p,q ) =(10 n + 4 n )( i −
1) + 5 n + 4( n − p ) if i is odd. Similarly, we let y i,j ( p,q ) = (10 n + 4 n )( j −
1) + 5 n + 4 q if j iseven and y i,j ( p,q ) = (10 n + 4 n )( j −
1) + 5 n + 4( n − q ) if j is odd. We then identify the pair ( p, q ) ∈ S i,j with aballot box b i,j ( p,q ) = ( x i,j ( p,q ) , y i,j ( p,q ) ) . Finally, we will denote by B i,j the set of ballot boxes associated with pairs in S i,j . Voters.
For each pair of ≤ i, j ≤ k we will place ( i − · k +( j − “blue” voters at each of the following fourpositions: ((10 n +4 n )( i − , (10 n +4 n )( j − n +2 n ) , ((10 n +4 n )( i − n +2 n, (10 n +4 n )( j − , ((10 n +4 n ) i − , (10 n +4 n )( j − n +2 n ) , and ((10 n +4 n )( i − n +2 n, (10 n +4 n ) j − .We denote the sets of voters at the above four positions by V i,j ← , V i,j ↑ , V i,j → , and V i,j ↓ , respectively. And we willplace · ( i − · k +( j − + 1 “red” voters at the position ((10 n + 4 n ) + 5 n + 2 n, (10 n + 4 n )( j −
1) + 5 n + 2 n ) ,we denote the set of these voters V i,jR .The goal is to assign k ballot boxes such that in each ballot box “red” has majority. Correctness.
We will show that ( k , n , S ) is a YES-instance of G RID T ILLING if and only if ( C , V , B , k , k , “red” ) is a YES-instance of G ERRYMANDERING plurality . Let s i,j be a pair in S i,j for all i, j ∈ [ k ] and let B (cid:48) = { b i,js i,j | i, j ∈ [ k ] } . The following two claims show that if (cid:83) i,j ∈ [ k ] { s i,j } is a solution to G RID T ILLING ,then B (cid:48) is a solution to G ERRYMANDERING plurality . Moreover, if B (cid:48) is a solution such that for all i, j ∈ [ k ] thevoters in (cid:83) (cid:3) ∈{ R, ← , → , ↑ , ↓} vote in b i,js i ,j , then (cid:83) i,j ∈ [ k ] { s i,j } is a solution to G RID T ILLING . n − n − p p n − q n − p (cid:48) n − q (cid:48) b i,j ( p,q ) b i +1 ,j ( p (cid:48) ,q (cid:48) ) q (cid:48) − nV i,j → V i +1 ,j ← Figure 3: The situation in Claim 1. The distance dist( b i,j ( p,q ) , V i,j → ) = (cid:112) (5 n + 4 n − p − + (2 n − q ) .Which is clearly between n + 4 n − p − and n + 4 n − p . Similarly, dist( b i +1 ,j ( p (cid:48) ,q (cid:48) ) , V i +1 ,j → ) is between n + 4 n − p (cid:48) − and n + 4 n − p (cid:48) . Claim 1.
Let b i,j ( p,q ) and b i +1 ,j ( p (cid:48) ,q (cid:48) ) be two ballot boxes. Then for every voter v ∈ V i,j → it holds dist( v, b i,j ( p,q ) ) < dist( v, b i +1 ,j ( p (cid:48) ,q (cid:48) ) ) if and only if p ≤ p (cid:48) . Similarly, for every v (cid:48) ∈ V i +1 ,j ← it holds dist( v (cid:48) , b i +1 ,j ( p (cid:48) ,q (cid:48) ) ) < dist( v (cid:48) , b i,j ( p,q ) ) ifand only if p ≥ p (cid:48) . roof. Let us assume that both i and j are even. The remaining cases are analogous. Then b i,j ( p,q ) is at po-sition ((10 n + 4 n )( i −
1) + 5 n + 4 p, (10 n + 4 n )( j −
1) + 5 n + 4 q ) and b i +1 ,j ( p (cid:48) ,q (cid:48) ) is at position ((10 n +4 n ) i + 5 n + 4( n − p (cid:48) ) , (10 n + 4 n )( j −
1) + 5 n + 4 q (cid:48) ) . Moreover, voters in V i,j → and V i +1 ,j ← are at positions (cid:0) (10 n + 4 n ) i − , (10 n + 4 n )( j −
1) + 5 n + 2 n (cid:1) and (cid:0) (10 n + 4 n ) i + 1 , (10 n + 4 n )( j −
1) + 5 n + 2 n (cid:1) ,respectively.Since both q and q (cid:48) are numbers between and n , it follows from Pythagorean theorem that the distancebetween b i,j ( p,q ) and V i,j → is between d = 5 n + 4 n − p − and d = (cid:112) ( d ) + (2 n ) < d + 1 (seeFigure 3). For the same reasoning, the distance between b i,j ( p,q ) and V i +1 ,j ← is between d + 2 and d + 3 , thedistance between b i +1 ,j ( p (cid:48) ,q (cid:48) ) and V i +1 ,j ← is between d = 5 n + 4 n − p (cid:48) − and d + 1 , and finally the distancebetween b i +1 ,j ( p (cid:48) ,q (cid:48) ) and V i,j → is between d + 2 and d + 3 . It follows that whenever p > p (cid:48) , then d + 3 < d and the voters in V i,j → are closer to b i +1 ,j ( p (cid:48) ,q (cid:48) ) than to b i,j ( p,q ) . Similarly, if p < p (cid:48) then d + 3 < d and the votersin V i +1 ,j ← are closer to b i,j ( p,q ) than to b i +1 ,j ( p (cid:48) ,q (cid:48) ) .Repeating the same argument for ballot boxes b i,j ( p,q ) and b i,j +1( p (cid:48) ,q (cid:48) ) , we obtain also the following claim. Claim 2.
Let b i,j ( p,q ) and b i,j +1( p (cid:48) ,q (cid:48) ) be two ballot boxes. Then for every voter v ∈ V i,j ↓ it holds dist( v, b i,j ( p,q ) ) < dist( v, b i,j +1( p (cid:48) ,q (cid:48) ) ) if and only if q ≤ q (cid:48) . Similarly, for every v (cid:48) ∈ V i,j +1 ↑ it holds dist( v (cid:48) , b i,j +1( p (cid:48) ,q (cid:48) ) ) < dist( v (cid:48) , b i,j ( p,q ) ) ifand only if q ≥ q (cid:48) . From the above claims it directly follows that if we start with a YES-instance of G
RID T ILING , we end upwith a YES-instance of G
ERRYMANDERING .For the reverse direction, it remains to show that any solution B (cid:48) to the reduced instance I of G ERRYMAN - DERING has to select exactly one ballot box b i,j ( p,q ) in each B i,j and that for each such box, the set of voters votingthere is precisely the set of voters associated with ( i, j ) .First note that there are precisely k positions of “red” voters. Hence each ballot box in a solution has tobe closest to precisely one of these positions. Moreover, there are only k more “red” voters than “blue” voters.Hence, if “red” wins in all boxes, then by pigeon-hole principle “red” has to win in each ballot box by precisely . Now let b ∈ B (cid:48) be a ballot box closest to V i,jR . Since V i,jR is precisely the set of “red” voters that vote in b ,none of voters in (cid:83) (cid:3) ∈{← , → , ↑ , ↓} V i (cid:48) ,j (cid:48) (cid:3) such that ( i (cid:48) − k + j (cid:48) − > ( i − k + j − can vote in b . Now thenumber of the remaining “blue” voters is precisely · ( i − k +( j − − · (cid:80) ( i − k +( j − (cid:96) =0 (cid:96) . Therefore, if onegroup of voters among V i,j ← , V i,j ↑ , V i,j → , and V i,j ↓ does not vote at b , then “red” wins b by more than vote and bypigeon-hole principle, there will be a ballot box where “red” does not win. Finally, it is easy to see that if there ismore than one ballot box selected from B i,j , then the box where V i,jR vote cannot take all four groups of voters V i,j ← , V i,j ↑ , V i,j → , and V i,j ↓ . Therefore, it follows that in each B i,j exactly one ballot box is selected in B (cid:48) and theset of voters in this ballot box is precisely the set of voters associated with ( i, j ) . It follows from Claims 1 and 2that the set of pairs associated with any such solution is a solution to G RID T ILING . Our algorithm uses the machinery developed by Marx and Pilipczuk [18] for guessing a balanced separator in theVoronoi diagram of a potential solution. The main idea of our algorithm is as follows. The Voronoi diagram of S could be viewed as a 3-regular planar graph with k faces and O ( k ) vertices. From [18] we know that for sucha graph there exists a polygon Γ which goes through O (cid:16) √ k (cid:17) faces and vertices and there are at most k facesstrictly inside Γ and at most k faces strictly outside Γ . Moreover, Γ could be defined by the sequence of O (cid:16) √ k (cid:17) elements of B . This allows us to guess all possible variants of Γ without actually knowing the solution S , and foreach Γ we recurse into two smaller subproblems defined inside and outside of Γ . Since the separator Γ is balancedand the recurrence T ( k ) = n O ( √ k ) T ( k ) solves to T ( k ) = n O ( √ k ) , we obtain the desired time bound. SeeFigure 4 for the illustration.We assume that no four elements of B lie on the same circle. From this assumption, it follows that no vertexof any Voronoi diagram corresponding to a possible solution has degree more than 3. We also assume that for anyfour distinct points in B , one is never exactly the center of the unique circle passing through the three others. It6igure 4: The Voronoi diagram of a potential solution. The solution is represented by large squares, small squaresare the other possible ballot boxes. A separating polygon Γ is in red and dashed, the boxes on Γ are also in red.Our algorithm guesses Γ , takes the red boxes in the solution and then solves the inside (blue and red squares) andthe outside (black and red squares) separately.means that for any subset S of B , the vertices of the Voronoi diagram of S are disjoint from B . Both assumptionsare for the ease of presentation and could be achieved by a small perturbation of the coordinates.Next we state the result of Marx and Pilipczuk about finding small balanced separators in Voronoi diagrams. Lemma 2 ([18]) . Let S be a set of k points on the plane. Consider the Voronoi diagram of S , and the planargraph G associated with it. There is a polygon Γ which has length O (cid:16) √ k (cid:17) and its vertices alternate betweenelements of S and vertices of G and each segment of Γ lies inside a face of G . At most k faces lie strictly inside Γ , and at most k strictly outside. Note that since Γ passes through O (cid:16) √ k (cid:17) faces, the number of faces which lie non-strictly inside (outside) Γ is bounded by k when k is greater than γ , where γ is some constant.Now we are ready to prove Theorem 2 which we restate for convenience. Theorem 2.
For any constant number of candidates and for any voting rule g , G ERRYMANDERING g is solvablein time ( m + n ) O ( √ k ) .Proof. Our algorithm is a recursive brute-force search. An input to the recursion step is a particular state R = ( V , B , (cid:96) , k , F , v , ∆) . A state consists of a set of voters V , a set of possible ballot boxes B , parameters (cid:96) , k such that (cid:96) ≤ k ≤ | B | , a subset of boxes F ⊂ B , for any f ∈ F and σ ∈ π ( C ) there is an integer v ( f, σ ) from to | V | ,and a set of segments ∆ , the segments form the boundary of the region containing V and B . Each segment δ ∈ ∆ has exactly one endpoint in F , and we denote this endpoint by δ F . The algorithm returns whether the given stateis valid . Definition 3 (Valid state) . A state is valid if there exists a subset S ⊂ B \ F such that | S | + | F | = k , and inthe election with voters V and boxes S ∪ F the target party p wins in at least (cid:96) boxes of S , and for each f ∈ F and σ ∈ π ( C ) there are exactly v ( f, σ ) voters with preference list σ voting in box f . Additionally, in the Voronoidiagram of S ∪ F , each segment δ of ∆ lies completely inside the cell (touching the border) corresponding to thebox δ F . If the state is valid, the algorithm also returns a particular subset S ⊂ B \ F satisfying Definition 3.Intuitively, V and B correspond to a set of voters and possible boxes in the current subtask, F corresponds toa set of boxes which we have already decided to take into the solution on the previous steps of the recursion, and7or any box in F the number of voters with a particular preference list is also fixed through v . Among the boxesof B \ F we are supposed to select at most k − | F | to go into the solution, and in at least (cid:96) of them the target partyshould win. The condition that segments of ∆ lie inside the corresponding cells enforces that these cells actuallyseparate the whole state from the outside of the region defined by ∆ .Initially, to run our algorithm having the input ( C, V, B, (cid:96), k, p ) to G ERRYMANDERING f , we proceed as fol-lows. First, find an equilateral triangle T such that V and B are completely inside T . Then mirror each vertexof the triangle against the opposing side, and denote the resulting set of three points as F . Consider the Voronoidiagram of B ∪ F , by construction the outer faces are exactly the cells of F , and these faces are disjoint from B and V . Construct a polygon ∆ in the following way. Start from a point of F and go to a next clockwise pointof F by a sequence of two segments having as the common point a vertex of the diagram on the border betweenthe corresponding outer faces; repeat until the polygon reaches the starting point again.The initial state is definedas R = ( V , B ∪ F , (cid:96) , k + 3 , F , v , ∆) where v ( f, σ ) = 0 for any f ∈ F and σ ∈ π ( C ) . Since for any v ∈ V any b ∈ B is closer to v than any f ∈ F , R is valid if and only if ( C, V, B, (cid:96), k, p ) is a YES-instance ofG ERRYMANDERING f . The recursive step.
On the given state R = ( V , B , (cid:96) , k , F , v , ∆) the algorithm proceeds as follows. If k − | F | isat most γ , where γ is the constant mentioned below the statement of Lemma 2, we try all possible S ⊂ B of size k − | F | and for each check the conditions of validity in polynomial time, since γ = O (1) the whole procedureworks in polynomial time as well. If k − | F | > γ , try all possible polygons Γ of the form as in Lemma 2, that is,alternating between elements of B and potential vertices of the Voronoi diagram of the solution, and having lengthat most α √ k where α is the constant under O in the lemma. Since a vertex of a Voronoi diagram constructedover any subset of B is equidistant from three elements from this subset and is uniquely determined by these threeelements, there are at most | B | potential locations for a Voronoi diagram vertex. Therefore there are at most | B | α √ k variants for Γ . We consider only these Γ which do not go out of the region defined by ∆ .For each possible Γ , we split the instance in two parts. Denote by Q the set of boxes on Γ . Let V ( V ) be theset of voters inside (outside) of Γ , and B ( B ) be the set of possible boxes inside (outside) of Γ , V ∪ V = V , V ∩ V = ∅ , B ∪ B = B . For i ∈ { , } , let F i = Q ∪ ( F ∩ B i ) and let ∆ i be those segments δ in ∆ suchthat δ F ∈ F i . The fixed preference counts v and v for F and F respectively are defined as follows. For boxesin F \ Q the value of v is transferred directly to v or v depending on to which part the box went. For boxesin F ∩ Q and for any preference list σ ∈ π ( C ) we guess how the value of v ( f, σ ) is split between v ( f, σ ) and v ( f, σ ) . For boxes in Q \ F we guess separately the value of v ( f, σ ) and v ( f, σ ) .Finally, guess how k + | Q \ F | is split between the two parts k and k , k and k must be each at most k .Also guess how (cid:96) − w is split between (cid:96) and (cid:96) , where w is the number of boxes in Q \ F where the target party p wins if voters from V and V vote according to v and v .Next, we run the recursion on the state R = ( V , B , (cid:96) , k , F , v , ∆ ∪ Γ) and on the state R = ( V , B , (cid:96) , k , F , v , ∆ ∪ Γ) . If both R and R are reported as valid states, we return that R is valid and take S = S ∪ S ∪ ( Q \ F ) . Otherwise, we continue to the next choice of Γ . If for all choices of Γ we do not succeed,we return that R is not valid. The correctness.
Now we prove the correctness of the algorithm above. The proof is by induction on k . In thebase case k − | F | ≤ γ the algorithm tries all possible ways to select the ballot boxes and then checks the definitiondirectly. In the case k − | F | > γ , assume first that the algorithm reports a given state R = ( V , B , (cid:96) , k , F , v , ∆) asvalid. So for some Γ the corresponding splitting states R = ( V , B , (cid:96) , k , F , v , ∆ ∪ Γ) and R = ( V , B , (cid:96) , k , F , v , ∆ ∪ Γ) are reported as valid by the algorithm, and by induction that means that they are actuallyvalid states since both k and k are at most k . Consider sets S ⊂ B \ F and S ⊂ B \ F returned by therecursive calls, by induction S and S also satisfy Definition 3 on the validity of R and R , respectively. Asbefore, denote S ∪ S ∪ ( Q \ F ) by S . We claim that S satisfies Definition 3 for R , and therefore R is valid.By construction of R and R , k = k + k − | Q \ F | , and since S , S , and Q \ F are pairwise disjoint, thesize of S is indeed equal to k − | F | . Next, we show that in the election with boxes S ∪ F the target party p wins inat least (cid:96) districts of S and that the votes in districts of F are distributed according to v . The next claim shows thatfor voters in each part the box where they vote is the same in the election with boxes S i ∪ F i and in the electionwith boxes S ∪ F . Claim 3.
For i ∈ { , } and any voter x ∈ V i , the closest box to x in S ∪ F belongs to S i ∪ F i as well.Proof. Let i = 1 , the other case is analogous. Assume the contrary, there is a voter x ∈ V such that there is a box b ∈ S ∪ F \ Q which is strictly closer to x than any box in S ∪ F , since two boxes cannot be at the same distanceto x . Consider a straight line segment from x to b , since x and b lie on the different sides of Γ , the segment crosses Γ at least once, denote any intersection point by y . Since R is valid, the segments of Γ lie completely inside the8ells of Q in the Voronoi diagram of S ∪ F . That means that there is q ∈ Q such that y is at least as close to q asto any other box in S ∪ F , including b . But then dist( x, q ) ≤ dist( x, y ) + dist( y, q ) ≤ dist( x, y ) + dist( y, b ) =dist( x, b ) , where the first inequality is the triangle inequality, and this contradicts the initial assumption.By Claim 3, for each i ∈ { , } and for each box in S i exactly the same set of voters votes there in the electionwith boxes S ∪ F compared to the election with boxes S i ∪ F i . It means that among the boxes in S and S thetarget party p wins in exactly (cid:96) + (cid:96) of them. For each i ∈ { , } and each box f in F i \ Q it also holds thatexactly the same set of voters votes in f in the election with boxes S ∪ F as votes in f in the election with boxes S i ∪ F i . Since v ( f, σ ) = v i ( f, σ ) for any σ ∈ π ( C ) , the vote distribution on F i \ Q is as desired. For each box q ∈ Q and each σ ∈ π ( C ) by construction v ( q, σ ) = v ( q, σ ) + v ( q, σ ) . Since voters from V and V who votein q are exactly preserved, v ( q, σ ) is indeed equal to the number of voters with preference list σ who vote in q .This finishes the proof that R is valid and S satisfies Definition 3.Finally, we show that for each δ ∈ ∆ , δ lies inside the cell of δ F in the Voronoi diagram of S ∪ F . If δ F ∈ Q ,since R and R are valid, δ lies inside the cell of δ F in the Voronoi diagram of S i ∪ F i for i ∈ { , } , then noother point in S ∪ F is closer to each point on δ than δ F . If δ F / ∈ Q , δ is completely inside or outside of Γ , andthe same argument as in Claim 3 shows that for any point on δ the closest box is preserved, then it has to be δ F ,since δ is in ∆ i for some i ∈ { , } , and R i is valid.Towards the other direction, assume that R is valid, we show that the algorithm correctly reports the validityof R . Consider a particular S from Definition 3, by Lemma 2 for the Voronoi diagram of S ∪ F , there exists apolygon Γ of length O ( √ k ) which is a balanced separator for S ∪ F . Since the algorithm tries all polygons of thisform, it will try Γ as well, or report that R is valid earlier. When considering the polygon Γ , the algorithm willguess the right values of k , k , (cid:96) , (cid:96) , and v , v on the boxes of Q \ F , according to the elections on S ∪ F .Thenew states R and R are valid since the elections on S ∩ F exactly induce conditions on R i , and there exists avalid selection of boxes S i = ( S ∪ F ) ∩ B i \ Q , for each i ∈ { , } . Therefore the recursive call will find R i validby induction. Thus the proof of correctness is finished. Running time analysis.
Denote by T ( k ) the worst-case running time of our algorithm where k is the respectiveparameter of the input state. If k ≤ γ , the algorithm does a brute force in polynomial time so T ( k ) = ( n + m ) O (1) .If k > γ , we try at most m α √ k polygons Γ , for each of them we in time at most k(cid:96)n α √ k guess the parametersof the new two instances k , (cid:96) , v and k , (cid:96) , v . We run our algorithm on the two instances recursively, and inboth instances the value of the parameter is bounded by k , so we get the following recurrence relation, (cid:40) T ( k ) ≤ ( n + m ) β √ k T ( k ) , k > γT ( k ) ≤ ( n + m ) β , k ≤ γ, where β is some constant. Now, by applying the first upper bound until the expression under T is at most γ we get T ( k ) ≤ ( n + m ) β √ k (1+ q + q + ... + q t ) ≤ ( n + m ) β √ k/ (1 − q ) = ( n + m ) O ( √ k ) , where q = (cid:112) / and t = (cid:100) log / ( k/γ ) (cid:101) . We initiated study of a gerrymandering problem from the perspective of fine-grained and parameterized complex-ity. Our main result is asymptotically tight algorithm with respect to parameter k , the number of opened ballotboxes, together with a matching lower bound.For future work, it would be interesting to investigate the complexity of finding an approximate solution forthe problem. That is the question whether there is an efficient (polynomial time) algorithm that either finds aset of k ballot boxes such that p wins (cid:96)c districts, for some constant c , or correctly decides that in no electionswith k districts the candidate p wins (cid:96) of them. Another interesting question is what happens, when we introduceobstacles, such as lakes or hills, in the instance so that the distances are not anymore Euclidean distances in theplane. Can we still get better than trivial m k algorithm in this case? Finally, it is also natural to impose restrictionson sizes of districts, so they are not too disproportional. 9 Acknowledgments
This work is supported by the Research Council of Norway via the project “MULTIVAL”.
References [1] John J. Bartholdi, III, Craig A. Tovey, and Michael A. Trick. How hard is it to control an elec-tion?
Math. Comput. Model. , 16(8-9):27–40, August 1992. URL: http://dx.doi.org/10.1016/0895-7177(92)90085-Y , doi:10.1016/0895-7177(92)90085-Y .[2] Allan Borodin, Omer Lev, Nisarg Shah, and Tyrone Strangway. Big city vs. the great outdoors: Voterdistribution and how it affects gerrymandering. In Proc. IJCAI 2018 , pages 98–104. IJCAI/AAAI Press,2018.[3] Vincent Conitzer and Toby Walsh. Barriers to manipulation in voting. In Felix Brandt, Vincent Conitzer,Ulle Endriss, J´erˆome Lang, and Ariel D. Procaccia, editors,
Handbook of Computational Social Choice ,pages 127–145. Cambridge University Press, 2016. doi:10.1017/CBO9781107446984.007 .[4] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, D´aniel Marx, Marcin Pilipczuk, MichalPilipczuk, and Saket Saurabh.
Parameterized Algorithms . Springer, 2015. URL: https://doi.org/10.1007/978-3-319-21275-3 , doi:10.1007/978-3-319-21275-3 .[5] Palash Dey, Neeldhara Misra, and Y. Narahari. Kernelization complexity of possible winner and coalitionalmanipulation problems in voting. In Proc. AAMAS 2015 , pages 87–96. ACM, 2015.[6] Palash Dey, Neeldhara Misra, and Y. Narahari. Complexity of manipulation with partial information invoting. In
Proc. IJCAI 2016 , pages 229–235. IJCAI/AAAI Press, 2016.[7] R. Downey and M. Fellows.
Parameterized Complexity . Springer, New York, 1999.[8] Rodney G. Downey and Michael R. Fellows.
Fundamentals of Parameterized Complexity . Texts in ComputerScience. Springer, 2013. URL: https://doi.org/10.1007/978-1-4471-5559-1 , doi:10.1007/978-1-4471-5559-1 .[9] Piotr Faliszewski, Edith Hemaspaandra, and Lane A. Hemaspaandra. Using complexity to protect elections. Commun. ACM , 53(11):74–82, November 2010. URL: http://doi.acm.org/10.1145/1839676.1839696 , doi:10.1145/1839676.1839696 .[10] Piotr Faliszewski, Edith Hemaspaandra, and Lane A Hemaspaandra. The complexity of manipulativeattacks in nearly single-peaked electorates. Artificial Intelligence , 207:69–99, 2014. URL: , doi:https://doi.org/10.1016/j.artint.2013.11.004 .[11] Piotr Faliszewski and Ariel D. Procaccia. AI’s war on manipulation: Are we winning? AI Magazine ,31(4):53–64, 2010.[12] Edith Hemaspaandra, Lane A. Hemaspaandra, and J¨org Rothe. Anyone but him: The complexity of preclud-ing an alternative.
Artif. Intell. , 171(5-6):255–285, 2007.[13] R. Impagliazzo and R. Paturi. On the complexity of k -SAT. Journal of Computer and System Sciences ,62(2):367–375, 2001.[14] Omer Lev and Yoad Lewenberg. “Reverse Gerrymandering”: a decentralized model for multi-group decisionmaking. In
Proc. AAAI 2019 . AAAI Press, 2019.[15] Yoad Lewenberg, Omer Lev, and Jeffrey S. Rosenschein. Divide and conquer: Using geographic manipula-tion to win district-based elections. In
Proc. AAMAS 2017 , pages 624–632. ACM, 2017.[16] D. Lokshtanov, D´aniel Marx, and S. Saurabh. Lower bounds based on the exponential time hypothesis.
Bulletin of the EATCS , 105:41–72, 2011. 1017] D´aniel Marx. On the optimality of planar and geometric approximation schemes. In
Proc. FOCS 2007 , pages338–348. IEEE, 2007.[18] D´aniel Marx and Michał Pilipczuk. Optimal Parameterized Algorithms for Planar Facility Location ProblemsUsing Voronoi Diagrams. In
Proc. ESA 2015 , pages 865–877, Berlin, Heidelberg, 2015. Springer BerlinHeidelberg.[19] Jon Terbush. How to fix gerrymandering and stop future shutdowns, 2013.[20] Lirong Xia, Michael Zuckerman, Ariel D. Procaccia, Vincent Conitzer, and Jeffrey S. Rosenschein. Com-plexity of unweighted coalitional manipulation under some common voting rules. In