Efficient Election Campaign Optimization Using Integer Programming

Purpose: Political parties spend significant amounts of resources during their election campaigns, which are usually designed in a sub-optimal and informal way. This study aims to provide a mathematical framework for political parties to optimize their election campaigns, so that they can maximize their performance in the elections. Design/methodology/approach: In this work, we provide certain mathematical relations to determine the minimum necessary number of votes to gain additional seats in an election region under the D’hondt election rule. Also we develop a convenient mathematical model that optimizes the resource allocation scheme of a political party to maximize the potential seats won. We test our models on Turkish Parliamentary elections data Findings: Our results show that with various basic assumptions, which are suitable for real life cases, one can obtain significant gains in the election outcomes even with small budgets. We also provide the relations among swing vote rates, unit vote costs and budget with the number seats won in a parliament. Originality/value: This study provides useful insights for both political party management teams as well as researchers. Political parties need to conduct more market research to collect and work on election data to increase their performances. From the research perspective, to the best of our knowledge, this is one of first studies that approaches to the election campaigns for the D’hondt system with mathematical optimization tools.


Introduction
During the election campaign periods, political parties spend a lot effort to introduce themselves and invest their resources to convince voters (Mueller, 2003).Given that each political party already has a loyal base community, what becomes important is persuading the so called swing voters -the voters who do not have a clear decision about their choice.Election campaign optimization problem (ECOP) can be described as finding the best way to allocate a political party's resources among different election locations in order to maximize the seats or member of parliaments (MPs) won.The level of effect of advertising on earning votes or winning elections has been studied extensively in the sense of determining the best advertising strategy or determining the marketing mix (Steenburg,  2015).However, most of the studies focus on determining the magnitude and significance of the effect of spending through various regression analysis methods.The work of Jacobson (1978) is one of the first studies that tests the significance of financial support for success in elections using regression analysis.The results indicate a positive relation between the two and the significance of this relation is even higher for the challengers than for the incumbents.Welch (1980) claims that usually largest contributions are given to likely winners or to the states with close competition.After these two works, there are many other studies focusing on the significance of spending money for gaining votes.Most studies report a positive correlation between the two, however some studies claim that the effect is statistically insignificant (Fisher, 1999).Also there is still an ongoing discussion about the higher significance of money for challengers rather than the incumbents (Benoit & Marsh, 2010)   In the optimization context several different aspects of the problem are studied by various researchers.Fleck (1999)  works on how voting influences the allocation of governmental resources by an optimization model which maximizes the probability of re-election under a limiting budget constraint.Belenky (2008) proposes a knapsack model for approximately calculating the minimal fraction of the popular vote that can elect a US President in the Electoral College.Ostapenko, Ostapenko, Belyaeva and Stupnitskaya (2012) formulated the problem of choosing an optimal strategy for allocating the scarce resources among regions in which political parties compete with different levels of influence.The analysis is carried out using a game theoretic approach and the existence of a unique equilibrium is proved.
In this study our objective is to determine the election regions to focus or to market heavily so that the party wins extra MPs in those regions.For this purpose, first the amount of swing votes for each election region and the minimum amount of votes needed to pass the opponent to win extra seat(s) are computed.We assume D'hondt election rule and derive mathematical formulae to exactly deter-mine the threshold values.Next, we develop a binary integer program (BIP) representing the election campaign optimization problem.Finally, we perform detailed computational analysis on the Turkish Parliamentary elections to test our methodology, which is generic and can be applied to many different election methods easily.
The organization of the paper is as follows: In Section 2 and 3, basic assumptions and the mathematical methodology are presented.In Section 4, the details of the ECOP and the mathematical formulation are provided.In Section 5 experimental studies and results are presented.The last section concludes the paper.

Election Model and D'hondt Rule
D'hondt Rule is one of the multiple-winners election method which are used to determine the allocation of seats in the countries having a parliamentary.It has been successfully used in more than 40 countries (Argentina, Belgium, Brazil, Denmark, Japan, Netherlands, Poland, Spain, Turkey, Uruguay, and Wales are some examples).According to the D'hondt rule the number of MPs in an election region which has N seats are distributed among the parties according to the following steps.First, the votes of each party are divided into N consecutive numbers from 1 to N to determine the so called "quotients".Next, all quotients are ranked in a descending order to construct a sorted list.Finally, N seats are allocated one-by-one to the parties whose quotients are in the top N ranks of the sorted list.
In the example, the total votes of four parties add up to 25,500 and the votes of each party are displayed in the first row.Next, the remaining quotients are calculated by dividing the votes to 2-6.The top 6 entries and their rank in the quotient list are displayed in bold, ranging from 10,000 to 3,333, for each of which the corresponding party wins a seat.The total number of seats are displayed in the "Seats Won" row.Also the last row shows the true proportion, which is the theoretical fractional values for the number of seats won by each party.For example Party-1 would won ([10,000/25,500]x6 = 2.36) seats in proportion of the votes received.
Before the elections many market research companies conduct polls to predict the election results.In these polls usually the competing parties are listed along with the two extra options: undecided and not attending.Next, the votes of undecided (or sometimes both undecided and not attending) are distributed proportionally to each party and updated results are presented.Given the loyal voters or the voters whose decisions are exact, the remaining undecided voters (also called the swing voters) are of great importance.Because it has been observed many times that the final decisions of the swing voters have a considerable effect on the outcomes of the elections.In this study, we assume that political parties perform marketing activities to convince these swing voters.Given that each party is already spending a certain resource for their marketing activities, the crucial choice of allocating additional resources to some specific election regions may help a party to win extra seats, especially in closely competing regions.Therefore, it is very important to estimate the number of necessary votes to change the winner or change the seat distribution for each province.

Calculating the Amount of Necessary Votes
The mathematical relations to determine the minimum amount of necessary votes to win an extra seat under the D'hondt rule are presented in this section.First, we will start with the simplest case where there are only two competing parties, next we are going to extend our results for multiple party case.Let I show the set of parties attending to the election with |I| = I.Assume that according to the poll results the votes of the participating parties are estimated and the vote for party i is vi, iI.Also let vs be the expected amount of swing votes according to the polls.Then the total amount of valid votes is expected to be v T = v s + ∑ iI v i .
Assume that there are N seats to be distributed among two political parties with expected base votes v 1 and v 2 , respectively and v 1 > v 2 .Thus the total votes for the election region is v T = v 1 + v 2 + v s .Let q 1k and q 2k show the set of quotients computed by dividing the votes of each party to the D'hondt divisors k = 1, 2, …, N, so q 11 = v 1 , q 12 = v 1 /2, ..., q 1N = v 1 /N.Also let's assume that out of a total of N seats the first party is taking n 1 of them and the second party is taking n 2 , where n 1 + n 2 =N and n 1 ≥ n 2 .Therefore the n 1 -th quotient of first party should be greater than the n 2 -th quotient of the second party, otherwise the n 1 -th seat would go to the second party.Mathematically, q 1n 1 > q 2n 2 , or equivalently v 1 /n 1 > v 2 /n 2 .Let's define λ = (n 2 + 1)/n 1 , showing the ratio between the next number greater than the number of seats won by the challenger to the number of seats of the incumbent party.
Before the additional marketing campaign by the challenger party, the swing votes v s are split among the two parties proportional to their estimated votes.After the split of swing votes, the total votes of parties are . Now when the challenger performs the extra marketing activities and persuades v x voters where v x < v s then only remaining swing votes (v s -v x ) are split between two parties proportional to their base votes.Upon this, we can state the following proposition.
Proposition 1.Given a total of N seats and two competing parties, then the minimum number of votes v x necessary for the challenger party to win one extra seat, i.e., n 2 + 1 seats under the D'hondt rule is: (1) where λ = (n 2 + 1)/n 1 .
Proof.After the marketing campaign of the challenger to win an extra seat the last winning quotient of the incumbent should be exceeded by the first non-winning quotient of the challenger, which is mathematically stated as: After replacing (n 2 +1)/n 1 with λ and expanding the terms we obtain, Since v 1 + v 2 + v s = v T .and after grouping the terms, If the amount of swing votes v s in a region is greater than v x , then there is definitely an opportunity for the challenger party to win an extra seat.Conversely, for those election regions with v s < v x , there is no chance of winning an extra seat even if all the swing voters are convinced to choose the challenger party.
In the multiple party case with I > 2, the ranked quotients of parties would be mixed.Thus to determine the necessary votes required for an additional seat, one has to consider the last winning quotients of all the parties which are expected to win at least one seat.When the challenger party aims to win an extra seat, they must increase their vote levels such that their last non-winning quotient exceeds at least one of the last winning quotients of the competitors.We extend the definition of l such that λ i = (n k + 1)/n i as the ratio between the rank of the last nonwinning quotient of the challenger party k and the rank of the last winning quotient, i.e. number of seats of the competitor party i.Then the minimum amount of extra votes v x the challenger party k needs to win an extra seat by additional marketing activities is calculated by the following proposition.
Proposition 2. Given a total of N seats and I competing parties with a total vote of v T = v s + ∑ iI v i , the minimum necessary amount of votes v x for an extra seat under the D'hondt rule is v x >arg min iI {v xi } where the v xi values are computed from the following formula: (2) This formula is exactly the same as (1), with an additional term v R i in the denominator, where v R i = v T -v i -v k , that is the sum of the basic votes of all the remaining parties other than party i and k.
Proof.After the marketing campaign of the challenger party k to win an extra seat the last winning quotient of at least one competitor party should be exceeded by the first non-winning quotient of the challenger, which is mathematically stated as: After replacing (n k + 1)/ni with λ i , expanding, re-arranging the terms and solving for v xi , then choosing the minimum of them, the necessary amount of votes is computed.

A Mathematical Model for ECOP
After determining the minimum amount of necessary votes required for each region, a political party can use them under a decision making framework to find which election regions to focus.For this purpose we develop a BIP, which picks the best locations to invest for winning the most number of extra seats.
Let j  J represent the set of election regions.Also let B be the total available budget for the political party, which is comprised of all kind of funds acquired by the party (Soberman & Sadoulet, 2007).
In this model, the decisions are to invest or not in region j to win the k-th extra seat, which are represented with a set of binary decision variables x jk .Under a parliamentary system the number of MPs that can be selected from a region is usually more than one.Especially in populous regions, where the number of swing votes is respectively much higher than the average votes necessary for a single MP, a party can aim to win more than one additional MPs.To include this fact into the model, a second index k is introduced representing the k-th additional MP in region j.
Let m jk be the minimum amount of votes necessary to win the k-th seat in region j.They are computed by the formulae presented in the previous section.Also let c jk be the total cost to persuade at least m jk swing voters to win k more MP in region j.They are calculated by multiplying m jk with a constant p -the unit cost of persuading a single person with the help of marketing activities.Determining p is a hard task as it is difficult to materialize the monetary value to persuade an individual by a political party's marketing campaign.However, there are many studies that focus on how to find the unit cost of a vote (Benoit & Marsh, 2010).Let K j be the maximum possible number of MPs that can be selected from region j.K j are determined by identifying the last index k where ∑ k m jk ≤ s j holds, meaning that the potentially available swing votes in a region is large enough for a party to win K j seats.
Given these definitons the mathematical model ECOP is as follows: ECOP: (3) In ECOP the objective function (3) maximizes the total seats won by summing all possible decision variables corresponding to the available regions and seats in those regions.The constraint (4) is the budget restriction.The total cost of investment in all regions and for all available seats is given by the sum ∑ iJ ∑ kKj c jk x jk , which is limited by the available budget B. Constraints (5) dictate the priority relationship of selected MPs in the same region.For instance, if a party invests c j1 dollars, they win one more MP in region j.To be able to win the second MP in the same region, they should invest at least c j1 + c j2 dollars, so x j2 ≤ x j1 should be satisfied.This formulation is similar to the Partially Ordered Knapsack Problem, which is known to be NP-hard in the strong sense (Borradaile, Heeringa  & Wilfong, 2012).When we aim for only one MP from each region, then the k-index can be dropped from the formulation and constraints (5) are not required anymore, so the remaining problem reduces to the classical Knapsack Problem.Lastly the model ends with binary restrictions on the decision variables (6).Also, it is assumed that the campaigns are all local (region-wise) and no nation-wide campaigns are carried out (or their region-wise effect is ignorable).It is stated that similar to nationwide advertising, local advertising helps to gain votes (Put,  Maddens & Smulders, 2015).When this optimisation model is solved, the solution provides the optimal investment decision for a political party, which is the list of regions and how many seats in each region to be targeted.

Computational Results
The computational results on the performance of our mathematical model as well as some insights on the effect of certain parameters of the problem on the optimal solution are presented in this section.
The 2015 June Turkish Parliamentary Election data is used in our analysis, where 4 major parties compete.There are some other small parties as well as independent candidates but to simplify the computations, they are discarded from the data.There are 85 election regions in Turkey with a total of 550 seats.The results are displayed with respect to the second party in terms of total seats won.The analysis can be repeated with the remaining three parties as well.We run our tests by analyzing the three parameters: Budget (B), swing vote percentage (s) and unit vote cost (r).For the budget, there are 96 different values from B = 50,000 to, B = 1,000,000 (increasing by 10,000).
For the swing vote percentage 20 different levels, s = 1% to s = 20%, are tested.Lastly, for the unit cost of a vote 50 different values ranging between r=1 to r=50 are tested.In total the number of scenarios tested is 96 × 50 × 20 = 96,000.The integer programs are coded in C# environment and CPLEX 12.6 callable Library is used.The results are displayed in Figure 1-3.
According to Figure 1, even a small budget can result in significant number of additional seats (5 to 10) and the effects of swing votes or unit vote cost can be easily tracked.As the unit costs decrease and swing vote rate increases, the gain increases.Also notice the diminishing returns behaviour, where the number of seats gained per constant increase in budget decreases and even stops (around 30 seats).Figure 2 presents the effects of unit vote cost.When the unit costs are small its effect on the seats won is high but after a certain value its effect drastically decreases.
Lastly, Figure 3 displays the relation between swing vote percentage and the number of MPs won.For smaller values of unit votes cost and for larger values of budget, the effect is more significant as expected.Similar to the effects of budget on MPs won (Figure 1) the effects diminish at higher levels of swing vote.

Conclusions
This study focuses on Election Campaign Optimization Problem, which is a critical issue in many countries ruled by democracy.We provide certain mathematical relations to determine the minimum necessary number of votes to gain additional seats in an election region under the D'hondt election rule.Also we develop a convenient mathematical model that optimizes the resource allocation scheme of a political party to maximize the potential seats won within the existence of undecided voters.We test our models on Turkish Parliamentary elections data and find out that even small budgets can result in significant gains.Further research can be conducted on how the effect of nationwide campaigns be incorporated to the optimization scheme, as well as how the inherent stochastic nature of political elections can be reflected by designing a stochastic optimization problem.
Figure 1.Effect of Budget on MPs won Figure 2. Effects of Unit Vote Cost on Number of MPs won Figure 3. Effects of Swing Vote Rate on Number of MPs won

Table 1 .
Illustration of the D'hondt Method