Abstract
This paper describes Election Algorithm (EA), an optimization and search technique, inspired by presidential election. The EA is an iterative population based algorithm, which works with a set of solutions known as population. Each individual of the population is called a person and can be either a candidate or a voter. These persons form a number of electoral parties in the solution space. Advertising campaign is the core of this algorithm and contains three main steps: positive advertisement, negative advertisement and coalition. During positive advertisement, the candidates introduce themselves through reinforcing their positive images and qualities. In the negative advertisement, candidates compete with each other to increase their popularity and defame their opponents. Also in some cases, the candidates that have similar ideas can confederate together in order toincrease the chance of success of the united party. Advertisements hopefully cause the persons to converge to a state of solution space that is the global optimum. All these efforts lead up to election day (stopping condition). On election day, the candidate who attained the most votes, is announced as the winner and equals to the best solution that is found for the problem.
In order to evaluate the performance of EA, we compared this algorithm with Continuous Genetic Algorithm (CGA), Comprehensive Learning Particle Swarm Optimizer (CLPSO), Adaptive Differential Evolution Algorithm (JDE) and Covariance Matrix Adaptation Evolution Strategy (CMA-ES) in finding the global optimum of four mathematical benchmark examples. Our experiments demonstrate the superiority of the EA for benchmark examples.
Introduction
Optimization means making something better. In other words, optimization is the process of finding an alternative approach with the highest efficiency by maximizing desired factors [15,23].
So far, many algorithms have been developed for solving various optimization problems. Two main groups of these algorithms include exact and heuristic algorithms. Exact algorithms guarantee to find optimal solutions in solving the small or moderately scale size optimization problems. Some of the well-known exact algorithms are branch and bound, dynamic programming, Lagrangian relaxation based algorithms, and linear and integer programming based methods [23]. The drawbacks of mathematical and exact algorithms are in using them for large-scale and non-linear complex optimization and engineering problems [23,27]. To overcome the limitation of exact algorithms, several heuristic algorithms have been developed. These algorithms are not guaranteed to find optimum solutions, but they can find near-optimum solutions in a limited time. Heuristic algorithms have shown good performance in solving large-scale, non-differentiable and complex nonlinear problems [6,23,27].
Various heuristic algorithms have been proposed and successfully applied to many scientific and practical fields. Beheshti and Shamsuddin [2] have been reviewed a number of population-based meta-heuristic algorithms. Some of the well-known algorithm that fall into the category of meta-heuristic algorithms include: Simulated Annealing (SA) [4], Tabu Search (TS) [10], Scatter Search (SS) [12], Iterated Local Search (ILS) [11], Variable Neighborhood Search (VNS) [14], and other population based evolutionary algorithms such as Genetic Algorithm (GA) [15], Particle Swarm Optimization (PSO) [20], Ant Colony Optimization (ACO) [5], Intelligent Water Drops (IWD) [26], River Formation Dynamics (RFD) [24], Imperialist Competitive Algorithm (ICA) [1], Artificial Bee Colony (ABC) [18], Charged System Search (CSS) [19], Firefly Algorithm (FA) [28], Gravitational Search Algorithm (GSA) [25] and Bat Algorithm (BA) [29]. These available search and optimization algorithms have been used in many fields such as economic, operations research, control engineering, chemistry and physic problems, business and industrial applications, computer science problems, image processing applications, speech recognition problems, data mining problems and mechanical design problems.
Most of optimization and search algorithms are inspired by some natural phenomena, such as ACO algorithm that is inspired by foraging behavior of real ants. ACO is useful for solving problems that require finding the shortest path. Another example is ABC algorithm, which models the intelligent behavior of honeybees. Some other meta-heuristic algorithms are non-natural inspired algorithms such as Tabu search and Iterated Local Search algorithms.
In this paper, we introduced another search and optimization algorithm, which is inspired by the socio-political phenomenon of presidential election. This algorithm is called Election Algorithm (EA) which is briefly described as follows.
EA begins its search and optimization process with a population of solutions. Each individual in the population is called a person and can be either a candidate or a voter. Forming a number of parties in the solution space, people can participate in their preferred party. Then these parties begin their advertising campaign. Advertising campaign forms the basis of this algorithm and causes the persons to converge to the global optimum of solution space. During advertisements, the popular candidates attract more voters using various techniques. Therefore, the unpopular ones lose their supporters and might resign from the election arena. Advertisement causes the persons to converge to the global optimum of solution space. On election day, voters cast their votes and the candidate that attains the most votes would be announced as the winner.
This paper describes how the EA algorithm is implemented. In addition, we evaluated and compared the performance of the proposed method with four well-known optimization algorithms including CGA [15], CLPSO [21], JDE [3] and CMA-ES [16]. These algorithms are chosen because they are popular population-based and swarm intelligence as the EA algorithm, and have been broadly applied in many applications as well. The results reveal the superiority of the proposed algorithm for the benchmark examples.
Having this short introduction, the rest of this paper would be organized as follows: After describing the election process in Section 2, we comprehensively introduce the working principle of the EA in Section 3. Then, in Section 4, the proposed algorithm is evaluated on some mathematical benchmark functions, and the simulation results are compared to the CGA, the CLPSO, the JDE and the CMA-ES algorithms. Finally, Section 5 makes conclusions and presents some future works.
General description of election
An election is a formal socio-political mechanism of selecting a person for public office or rejecting or accepting a political proposal by voting. Elections and voting are essential for a successful democracy. The people of society get to elect their representatives to rule them. These representatives supervise laws that directly affect the quality of people’s life. Elections are held in limited geographical areas in given predefined times. In modern democracies, election is used as an important tool for selecting representatives [8,9].
In history, elections were used in ancient Athens, in Rome and in the medieval period to select Popes and Holy roman emperors. Also in the early medieval Rashidun Caliphate, ancient Arabs have used election to select their caliph, Uthman and Imam Ali. The origins of elections in the modern world emerged in the beginning of the 17th century when the representative government took hold in Europe and North America [7,22].
One of the most important elections that are held in most countries is presidential election [8]. The presidential election is held on national level and is a single winner election. In the most countries the president is the highest official elected by direct and popular vote. There are various types of election to select the president of a country. One of the free and fair election methods is direct election in which voters choose freely their favorite candidate. The method by which the winners of a direct election are selected depends on the electoral system used. The electoral system is responsible to implement election in a fair and sound way.
A most simple form of a presidential election involves the following steps. First, nominates called candidates declare their candidacy voluntarily. The candidates want to be the president and hope their parties support them. Then, candidates get required supports, and ready for running a campaign all around the country. Political campaign is the process of gathering public supports for a candidate. The goal of a campaign is to provide as much information about the candidate and the party’s platform to as many people as possible [9]. Beginning advertisement time, candidates through different techniques such as direct mail, personal appearance among voters and talking to them, printed materials and even through Internet, publicize themselves and compete with one another to increase their supporters.
Obviously, the voting outcomes are greatly influenced by the type of advertisements that voters are exposed to them and the voters’ characteristics.
In general, advertisements are two types: positive and negative. During positive advertisement, candidates introduce their qualifications, agendas and ideas to the public. However, in negative advertisement, candidates focus exclusively on the negative aspects of the other opponents while emphasize on positive information about themselves [13]. Sometimes in campaign trial, two or more than two political parties that have same ideas and goals can union together. This process is called parties’ coalition. All these efforts lead up to election day. On election day people go to the polls and choose their favorite candidate to be the next president. Then the polls are closed and after counting the votes, a candidate who collects the most votes is declared as the winner. In most elections, in order to win, a candidate must obtain at least an absolute majority of the votes.
In the following, an evolutionary algorithm called Election Algorithm (EA) developed based on the presidential election process is introduced.
Our proposed algorithm: Election algorithm
This section explains the Election Algorithm (EA) in detail. This algorithm is called election algorithm, since its procedure is similar to the election process in the real world. Like many other evolutionary algorithms, this algorithm is rely on an intelligent search of a large but limited solution space using its actuators including positive and negative advertisement, and coalition.
The EA is a multi-agent algorithm in which each agent is a person and can be either a candidate or a voter. Candidates together with their voters (supporters) form some political parties. At the beginning of the algorithm, all voters are divided among candidates based on their similar opinions and ideas. After forming initial parties, a candidate in each party begins his/her advertising campaign. Advertising campaign contains two types of advertisements including positive and negative advertisement. During the positive advertisement, candidates convey their agendas and ideas to the voters and try to attract the voters toward themselves. Then candidates use negative advertisement (will be described in Section 3.3.1) to increase their own popularity and decrease the popularity of other candidates. The negative advertisement has important effect on the result of election. Unpopular candidates lose their supporters and might resign from election arena. During advertising campaign, the candidates that have the same opinions and ideas might unite and create a new party which is a combination of these parties. The coalition increases the chance of the success of united candidates.
The EA works iteratively by successively applying three operators – positive advertisement, negative advertisement and coalition – in each iteration until a termination condition is satisfied. These operators will cause all the candidates to converge to global optimum of the eligibility function. In this paper, the termination condition is set to be the maximum iteration number. EA algorithm ends on election day. Then, at the end of the algorithm, the candidate who attained the majority of votes will be announced as the winner. The winner candidate is equal to the best solution found for the optimization and search problem.
In the following, first we select the variables and eligibility function in Section 3.1. Then, in Section 3.2, we explain how parties form in this algorithm. Finally, Section 3.3 describes three types of advertisement followed by termination condition of the algorithm. In addition to be more clear, a path through the EA’s components is shown as a flowchart in Fig. 1. Each block in this flowchart is described in detail in the following sections. Also the pseudo code of the proposed algorithm is shown in Fig. 2.

Flowchart of the election algorithm.

Pseudo code of the election algorithm.
The EA begins its work by defining the optimization variables, the eligibility function, and the eligibility. The EA in each iteration works with a set of solutions collectively known as the population. Usually, in the absence of any knowledge of the problem domain, this population is generated randomly. Each individual of the population is called a person and indicates a potential solution to the problem.
In an
In the EA, each person must be assigned an eligibility value, which is related to the objective function of the problem. An eligibility function is used to assess the ability and qualifications of persons. In the optimization problems, the main goal is to find a solution having the minimum cost. Thus, in the EA, the persons who have smaller cost then larger eligibility values are assigned to them.
The eligibility of an individual is found by evaluating the eligibility function f at the variables
In maximization problems, the eligibility of person is equal to the value of problem objective function. However, in minimization optimization problems, the persons with larger objective function value will get smaller eligibility value. Therefore, in the cost minimization problems, the following transformation is used:
Forming initial parties
To begin the EA, we define an initial population of
It is arbitrary to decide how many persons to select as the initial candidates. Letting only a few persons select as initial candidates may limits the convergence rate of the algorithm and causes the algorithm get stuck at local optimums. Also selecting too many persons as initial candidates increases the workload of the algorithm.
In order to choose a proper
It is clear that the supporters are largely similar to their relevant candidate in politic, diplomacy, religion, beliefs and ideology. We used this characteristic to create initial parties. In the EA, the beliefs and ideas of the persons are determined using the eligibility function. All the supporters are divided among the candidates based on the similarity of beliefs and ideas. Thus, the eligibility distance between persons and candidates are computed to divide persons among candidates. To do so, Euclidean distance metric is used as similarity measure that is given by
In other words, person
Once the initial parties are formed, candidates begin their advertising campaign. In campaign trail, the popular candidates are reinforced; the unpopular candidates are weakened and may be resigned from the election arena. As mentioned before, advertisement is the main part of the EA and contains three main steps: positive advertisement, negative advertisements and coalition. The following subsections describe the different components of advertisements and how these mechanisms are implemented in the solution space.
Positive advertisement
As mentioned before, the aim of positive advertisement is to introduce a candidate through focusing on his/her abilities or stance on issues. During positive advertisement, candidates begin to expose their plans and ideas to voters and try to influence the decisions made by voters. Candidates attempt to create a lasting impression with the voters.
We have modeled this process by conveying some characteristics of the candidate to the voters. To fulfill this aim, in each party, the
In this paper, selection rate (
It is clear that, in an election party based on the eligibility distance between candidate and its relevant supporters, the effectiveness of advertisement varies. Therefore, it is reasonable to consider the effect of eligibility distance between candidate and its relevant supporters. To fulfill this aim, we defined eligibility distance coefficient (
In advertising process, after choosing
Based on Eq. (8), in advertisement process, the closer supporters are much more affected by their relevant candidate than farther supporters.
If a candidate has truly excellent plans and ideas, the number of his supporters will be more. During advertising, candidates try to learn good opinions and ideas from their supporters. From optimization point of view, the supporters move toward the more eligible (more popular) candidates. While positive advertisement, if a supporter has better ideas (i.e. has higher eligibility) than its relevant candidate, they can exchange these ideas with themselves. This fact increases the quality of party’s plans.
Candidates through negative advertisement try to attract the supporters of other parties toward themselves. Negative campaigning leads to an increase in the popularity of popular parties and conversely a decrease in the popularity of unpopular parties. In the implementations of this algorithm, contrast advertisement is used among different negative campaigning techniques. To do this, candidates travel to the different areas of solution space (between other parties) and they try to attract those voters toward themselves using negotiation.
To model the contrast advertisement mechanism two new terms are defined, “defender party” and “attacker party”. A party that other parties are going to take the attention of its supporters, is called defender party. The aggressor candidates are called attacker party. Obviously, in each party, if the supporters do not think as their relevant candidate and do not agree his/her ideology, then they change their willingness and easily influenced by the other candidates. There are various criteria to select a party as a defender. In this paper, randomly a party selected as the defender party.
For the implementation of the contrast advertisement, a number of supporters of the defender party are selected. Then, a race is taken place between attacker parties to possess these voters. There are various approaches to select the mentioned supporters. One of the simplest methods is to select some supporters at random. Another method is to select the farthest supporters. In this paper, the later approach is used. To do this, first, in the defender party, the distance of the eligibility between the supporters and the candidate is computed.
By using Euclidean distance metric, the distance is given by
Then the distance between selected supporters and all the attacker candidates are computed. These supporters are assigned to the closest candidates. Figure 3 depicts the big pictures of the modeled negative advertisement mechanism between defender and attacker parties.

Negative advertisement among candidates. The popular candidates will attract more supporters toward themselves. The defender party is shown in black color. The farthest voter is assigned to the nearest candidate (in this case the candidate by blue color). (The colors are visible in the online version of the article;
Sometimes parties in the solution space may converge too quickly into the local optima of the solution space. To avoid the problem of fast convergence, the algorithm must explore other areas of solution space. Negative advertisement performs this work and keeps the EA away from converging too fast before exploring the entire solution space.
Similar to the process of candidates coalition in a real election, sometimes two or more than two candidates in the solution space become more closer together. In that case, they can join and create a new party. Therefore, some candidates leave the campaign and join to another candidate who is called “leader”. The candidate who leaves the election arena is called “follower”. The follower candidates collate to the leader one and encourage their supporters to follow the leader. All of the supporters of the follower candidates become the supporters of the leader one.
Different criteria can be defined to model the coalition mechanism and to specify a candidate to be either a leader or a follower. In our implementation, among the candidates that wish to collate together, a candidate is picked at random to be the leader candidate and the remaining is considered as the followers.
Figure 4(a) and (b) illustrate a great picture of the coalition process of parties before coalition and after being collated, respectively. In Fig. 4(a), the candidates that are shown by blue, green and red color, approximately are similar, and they want to collate together. As shown in Fig. 4(b), after coalition the leader candidate is shown by blue color and the follower candidates are considered as the new supporters of the leader shown by circular head. In addition, all the new supporters of the leader are shown by blue color.

Coalition between parties in the search space. (a) The parties before coalition; (b) The parties after coalition. (The colors are visible in the online version of the article;
Until a termination condition is not satisfied three operators – positive advertisement, negative advertisement and coalition – are applied to update the population. Eventually a candidate that attains the most votes will declare as the winner and is equal to the best solution, which is found for the problem. In the implementation of this paper, the maximum iteration number is considered as the stopping condition of the algorithm.
Control parameters of the related algorithms used in the tests
Control parameters of the related algorithms used in the tests
Characteristics of benchmark examples

3D plot of the benchmark functions. (Colors are visible in the online version of the article;
To prove that the proposed EA technique works effectively, we used four benchmark functions [17,18]. We shall describe the details of these functions a little later. Since we are trying to find the global minimum of these problems, the cost function is as the negative of the eligibility function (presented in Eq. (2)), in order to put it into the form of a minimization algorithm.
In the following, the algorithms which include the proposed EA, CGA [15], CLPSO [21], JDE [3] and CMA-ES [16] are compared in accordance with the benchmark functions. Each algorithm has its own parameters that affect its performance in terms of convergence rate and quality of solutions. Common control parameters of the algorithms are population size and the number of maximum generation. In our experiments, maximum number of generations is set to 1000 for EA and CGA, and 10,000 for CLPSO, JDE and CMA-ES. The population size is chosen to be 100 for all algorithms. Table 1 shows the parameter values adopted for each of the CGA, CLPSO, JDE, CMA-ES and EA algorithms, respectively.
Benchmark functions
There are many standard test functions for validating new algorithms. In this paper, four popular mathematical benchmark functions are employed to validate and compare our proposed EA algorithm with other algorithms. These are some well-known mathematical problems. Table 2 summarizes the characteristics of these problems including the general form, the domain, the dimension and the global minimum. Also the 3D plots of these benchmark functions are illustrated in Fig. 5. In these problems, the main goal is to minimize the value of cost function. Detailed information about these problems has been provided in [17,18].
Statistical results obtained by CGA, CLPSO, CMA-ES, JDE and EA algorithms on benchmark function Statistical results obtained by CGA, CLPSO, CMA-ES, JDE and EA algorithms on benchmark function Statistical results obtained by CGA, CLPSO, CMA-ES, JDE and EA algorithms on benchmark function Statistical results obtained by CGA, CLPSO, CMA-ES, JDE and EA algorithms on benchmark function
The performance of the algorithms was compared using two criteria: (1) solution quality, and (2) the number of successful trial. The solution quality includes the minimum (best), the mean, the maximum (worst) cost value obtained in all simulation trials and the standard deviation of results. In addition, the number of successful trials is represented by the number of trial runs required for the eligibility function to reach its known global optimum value. In all experiments, the algorithms found a solution when they converge into ε tolerance and it is defined as:
Efficiency is equal to the number of successful trials among all trials.
In this section, five algorithms were evaluated and compared: CGA, CLPSO, JDE, CMA-ES and the new proposed EA algorithm. All experiments took place on a 3 GHz, and 2 GB RAM, Personal Computer Intel® Pentium® 4. All the mentioned algorithms have been coded using the MATLAB language. The algorithms ran for 30 times. The results of solving the four test problems using the five algorithms are summarized in Tables 3–6. In these tables min, mean and max are respectively the minimum, mean and maximum cost values found over 30 simulation runs. Sigma is the standard deviation of the results. Succ is the number of times the global optimum is found. Dim indicates the dimension of the problem, and Time indicates the average simulation runtime of the algorithm.
As shown in Table 4, the performance of EA on
For the
For the
For test function
From numerical simulations, it is clear that these algorithms have almost consistent behaviour for all benchmark functions. Generally, the EA algorithm almost performs well on all benchmark functions, exceeding or matching the best performance obtained by CGA, CLPSO and CMA-ES. Also, except
With the exception of the
Conclusions
In this paper, inspired by the presidential election process, an optimization and stochastic search algorithm has been presented which is called Election Algorithm (EA). EA simulates the candidates’ behavior in presidential election and it is applicable for both continuous and discrete problems. This population-based technique contains persons, either candidates or voters that collectively form some electoral parties in the solution space. Advertising campaign – including positive advertisement, negative advertisement and coalition steps – is the main part of the algorithm and causes the persons to converge into the global optimum of solution space.
In order to evaluate the performance of the EA algorithm, CGA, CLPSO, CMA-ES and JDE algorithms were tested on four numerical benchmark functions and the comparative results were represented. From the simulation runs, it is concluded that the EA technique is almost found to perform better than others in terms of solution quality and success rate. One drawback of the EA is using of the Euclidean distance in the creation of initial parties and the negative advertisement steps that decrease the speed of the algorithm.
There remain some points to improve our research. First, we have to explore an appropriate and efficient similarity measure to substitute the Euclidean distance metric with it. Second work is to investigate the effect of control parameters on the performance and convergence speed of the EA algorithm. Another issue is that we hope to improve the execution speed of the algorithm and apply the proposed algorithm to solve some practical applications.
