Black hole white hole algorithm with local search

Black hole algorithm (BHA) is an optimization algorithm inspired by the black hole discovery in relativity theory. Recently, white hole operator, which is based on the opposite of black hole, has been introduced in BHA. In this paper, a local is added in the BHA with white hole operator


Introduction
A black hole is a region of space packed with so much matter that its own gravity prevents anything from escapingeven a ray of light.Black holes can form when massive stars run out of fuel and collapse under their own weight, creating strong gravity.
The BHA algorithm (BHA) [1] is a population-based metaheuristic algorithm inspired by the physical phenomenon of black hole.In BHA, the agent with the best solution mimics the black hole.The event horizon is calculated and any agent within the event horizon vanishes and re-initialized in the search space.
The BHA is shown in Figure 1.Let N is the number of agents and d is the number of dimension for an optimization problem, a solution, X, in a search space is kept by an agent i at iteration t as follows: (1) The BHA begins with initialization where a randomly generated population of candidate solutions are placed in the search space.For each agent i, the initial solution can be represented as: (2) After the initialization, the fitness values of the population are evaluated.The best agent, which has the best fitness value, is chosen as the black hole while other agents are selected as normal agents.For the case of function minimization problems, during initialization, the black hole agent is determined as follows: (3) In this study, the black hole agent keeps the best-so-far solution, XBH.The best-so-far solution is different than the best solution.The best solution is defined as the best solution obtained at specific iteration, t.On the other hand, the best-sofar solution is the best solution found from the initial iteration, t = 0, until current iteration, t.Hence, for t ≠ 0, an agent i is selected as the black hole agent if the fitness value of that agent, fi, is better than the fitness value of the black hole agent, fBH.Specifically, for the case of function minimization, fi < fBH.
Once the black hole agent and normal agents are identified, the radius of the event horizon, RBH, is formulated as follows: (4) where fBH is the fitness value of the black hole agent, N is the number of agents, and fi is the fitness value of the i th star.
The next step is solution update, which is applied to all agents except the black hole agent.Other than black hole agent, the agents can be categorized into two groups.The first group of agents is the agents located within the event horizon.This agent will be swallowed by the black hole agent.Then, a new agent following the swallowed one is generated and distributed randomly in the search space.This generation is to keep the number of agent constant.The second group of agents are agents located far from the black hole agent.In other words, these agents are not within the event horizon.These agents move towards the black hole agent and the updated solution can be computed as follows: (5) where Xi(t+1) and Xi(t) are the locations of the i th agent at iterations t+1 and t, respectively.The rand is a random number belonging to [0,1] and XBH is the location of the black hole agent.This solution update can be summarized in the Pseudocode 1.

PSEUDOCODE 1: Solution update in BHA
if agent i th position is within the event horizon then do re-initialization if agent i th position is not within the event horizon then update the position based on Eq. ( 5) else end After all the agents have updated their position, the next iteration begins if the termination criteria is not met.Otherwise, the best-so-far, XBH, solution is reported.

The black hole white hole (BHWH) algorithm
As oppose to black hole agent in the BHA, the white hole can be assigned to the worst agent in the population.Hence, the white hole is updated as follows: (6) Also, similar to the black hole, the white hole has its own event horizon and the radius of the event horizon, RWH, can be calculated based on the following equation: where fitWH is the fitness value of the white hole, N is the number of agents, and fiti is the fitness value of the ith star.An arbitrary agent i could be updated to a position in the search space within the event horizon of the white hole.In this case, the agent is pushed by the white hole.Due to this, the position of the agent i is updated as follows: (8) where Xi(t+1) and Xi(t) are the locations of the arbitrary agent i at iterations t+1 and t, respectively.The rand is a random number belonging to [0,1] and XWH is the location of the white hole agent.
Figure 2 shows the flowchart of the black hole algorithm with white hole operator, which is also termed as BHWH algorithm [2].The difference between the proposed BHWH algorithm with the BHA shown in Figure 1 is the inclusion of a white hole agent as the worst solution.Note that there are two kind of event horizons.These are the event horizon for black hole and white hole agents and should be calculated at every iteration.Also, due to the inclusion of white hole agent which pushes any nearby agent, the position update in BHWH algorithm can be explained in Pseudocode 2.

The proposed BHWH algorithm with local search
The basic idea of the local search is to find neighbourhood solution around the best solution.In this study, not all the agents are subjected to local search.The white hole agent that keep the worst solution at the iteration, t, is selected and the local search is applied to the white hole agent.where is the solution after the local search is applied, XBH is the location of the black hole agent, t is the iteration number, Tmax is the maximum number of iteration, and randd ∈ [0,1] is a random number, which is generated at every dimension.
The local search is applied to the worst agent in the population.It is possible to select any worst solution at iteration t during an implementation of an optimization algorithm and apply Equation (9) to the worst agent.In this study, the local search is incorporated in the BHWH algorithms.As a result, a variant of BH algorithm can be developed, which is called black hole white hole (BHWH) algorithm with local search (BHWHLS).The flowchart of BHWHLS algorithm is similar to the flowchart of BHWH algorithm in Figure 2.However, considering the local search, the solution for BHWHLS algorithm is updated according to Pseudocode 3, which replaces the Pseudocode 2.

Experiment, result, and discussion
The experiments in this study were implemented based on the parameter setting tabulated in Table 1.The performance of the BHWHLS algorithm and the original BHA were studied by solving CEC2014 benchmark functions [3].The results are tabulated in Table 2.The values in bold indicate the smaller or better result.Table 2 shows that the BHWHLS algorithm outperforms BHA for all the unimodal functions, while for simple multimodal functions, the accuracy of BHWHLS algorithm is very good, except for Function 14.For hybrid functions, the BHWHLS algorithm reaches to optimum solution for all functions except for Function 18 and Function 19.Finally, even though the BHWHLS algorithm performs BHA in most of the composition functions, the accuracy are quite unsatisfactorily for the case of Function 24 and Function 25.An example of convergence curve is shown in Figure 3.

PSEUDOCODE 3 :
Solution update in BHWHLS algorithm if agent ith is black hole agent then position not updated if agent ith position is within the event horizon of black hole then do re-initialization if agent ith is the white hole then apply local search based on Equation (9) if agent ith position is within the event horizon of white hole then update the position based on Equation (8) else update the position based on Equation (5) end

Table 1 .
Experimental setting parameter

Table 2 .
Performance comparison between the BHA and BHWHLS