{'fraction_non_alphanumeric': 0.03188728216536893, 'fraction_numerical': 0.01260659992584353, 'mean_word_length': 4.6865776528461, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
BAS: Beetle Antennae Search Algorithm for Optimization Problems

Meta-heuristic algorithms have become very popular because of powerful performance on the optimization problem. A new algorithm called beetle antennae search algorithm (BAS) is proposed in the paper inspired by the searching behavior of longhorn beetles. The BAS algorithm imitates the function of antennae and the random walking mechanism of beetles in nature, and then two main steps of detecting and searching are implemented. Finally, the algorithm is benchmarked on 2 well-known test functions, in which the numerical results validate the efficacy of the proposed BAS algorithm.


I. INTRODUCTION
M ETA-HEURISTIC algorithms have attracted an amount of attention over the last decades because of their simplicity, flexibility and local optimum avoidance. Specially, some of them play an fairly important role in not only academic society mainly concluding computer science but also many other practical engineering fields. Mirjalili et al. [1] propose a grey wolf optimizer by mimicking the leadership and prey of grey wolves in nature. Inspired by some cuckoo species' brood parasitism, Yang and Deb [2] develop a metaheuristic algorithm called cuckoo search which could be applied to optimization and optimal search. Dorigo et al. [3] propose an ant colony optimization, which is inspired by the foraging movement of some ant species, to exploit for solutions of optimization problems. Two essential common characteristics of these different meta-heuristics are exploration and exploitation. This paper design a new meta-heuristic algorithm, which is named as beetle antennae search algorithm (BAS) to solve the optimization problems, taking inspiration from detecting and searching behavior of longhorn beetles.

II. BEETLE ANTENNAE SEARCH ALGORITHM DESIGN
Longhorn beetles shown in Fig.1(a) are a family of beetles, characterized by extremely long antennae, which are often as long as or even longer than the beetle's body. The family is large with over 26,000 species described. Slightly most of them having long antennae. The pattern of antennae, which usually consists of many kinds of olfactory receptor cells, is often unique in particular species, and the functions of such sensing systems are still debating. However, two fundamental functions of such large antennaes are to bind to odours of prey, and to obtain the sex pheromone of potential suitable mate, in which large antennae could enlarge the detecting area. In addition, large antennae may also act as a protective warning mechanism.
We know that a beetle wobbles each antennae in one side of the body to receive the odour when it is preying or finding mates. That is to say, the beetle explores nearby area randomly using both antennae. Further more, when the antennae in one side detects a higher concentration of odour, the beetle would turn to the direction towards the same side, otherwise, it would turn to the other side. These two combined factors make most beetles to prey or seek for a mate as demonstrated in Fig.1(b), which inspire us to design a meta-heuristic optimization algorithm. Based on these two aspects, the basic steps of the proposed BAS algorithm can be summarized as the pseudo code shown in Algorithm 1.
Searching behavior of beetles with two antennae could be formulated in such a way that it is associated with an objective function to be optimized, which makes it possible to formulate new optimization algorithms. In the following sections, we will first outline the formulation of the BAS algorithm and then discuss the implementation as well as the analysis in detail.
For the sake of illustration, we denote the position of the beetle as a vector x t at tth time instant (t = 1, 2, · · · ) and denote the concentration of odour at position x to be f (x) known as a fitness function, where a maximum value of f (x) corresponds to the source point of the odour.
For simplicity in describing our BAS algorithm, we now use the following two rules inspired by the behavior of beetle searching with antennae, which includes searching behavior and detecting behavior. Note that the beetle searches randomly to explore an unknown environment. Firstly, to model the searching behavior, we propose describing a random direction of beetle searching as follows, where rnd(.) denotes a random function, and k represents the dimensions of position. Further more, we present the searching behaviors of both right-hand and left-hand sides respectively to imitate the activities of the beetle's antennae: where x r denotes a position lying in the searching area of right-hand side, and x l denotes that of the left-hand side. d is the sensing length of antennae corresponding to the exploit ability, which should be large enough to cover an appropriate searching area to be cable of jumping out of local minimum points at the beginning and then attenuate as time elapses. Secondly, to formulate the behavior of detecting, we further generate iterative model as follows to associate with the odour detection by considering the searching behavior, where δ is the step size of searching which accounts for the convergence speed following a decreasing function of t instead of an increasing function or a constant. The initialization of δ should be equivalent to the searching area. sign(.) represents a sign function. In terms of searching parameters i.e., antennae length d and step size δ, examples of update rules are presented for the designer as follows, It is worth pointing out that both of the parameters could be designated as constants if necessary.
Generate the direction vector unit − → b according to (1); Search in variable space with two kinds of antennae according to (2); Update the state variable x t according to (3) Update sensing diameter d and step size δ with decreasing functions (4) and (5) respectively, which could be further studied by the designers. return x bst , f bst .

III. BENCHMARK VALIDATION
To verify the efficacy of the proposed BAS algorithm, we use various benchmarks [6] to validate the new algorithm.
At first, considering the Michalewicz function where m = 10 and i = 1, 2, · · · , the minimized value satisfies f * ≈ −1.801 locating in x * ≈ (2.20319, 1.57049) in i = 2 dimension. The performance of BAS algorithm shows in Fig. 2 along time step from 0 to 100 under the parameter configuration that sensing length d updates following rule 4 with initialized value d 0 = 2, and step size δ follows rule 5 with initialization δ 0 = 0.5. It can be observed from Fig. 2 that BAS algorithm could find the global minimum of function (6). Numerically, the solution of function (6) f bst = −1.8008 is approximate to f * at the corresponding points x bst = [2.1997, 1.5679] T . We also consider the Goldstein-Price function: where the input domain is usually on the square {x|x i ∈ [−2, 2], i = 1, 2}.
There are several local minima for function (7) whose global minimum is f (x * ) = 3 at x * = [0, −1] T . By taking 100 iterative steps and the parameters configurations the same as those in the aforementioned simulation, the visualization of simulation result of proposed BAS algorithm is demonstrated in Fig. 3, in which (a) denotes the searching trajectory to seek the global optimum and (b) presents the convergence of the minimum along movement steps. The solution achieved in numerical experiment by the algorithm is f bst = 3.0064 at x bst = [0.0052507, −0.99933] T approaching f * at x * . Results of the simulation substantiate the effectiveness of the proposed BAS algorithm sufficiently.

IV. CONCLUSION
This work presents a novel nature-inspired BAS algorithm to solve the optimization problem. This method mimics the detecting and searching behaviors of beetles and further parameter selections could be studied for the convergence of the algorithm. Two typical test functions are considered to benchmark performances of the algorithm in terms of convergence and local minimum avoidance. Both visualization results and numerical solutions validate the efficacy of the proposed algorithm.