Red piranha optimization (RPO): a natural inspired meta-heuristic algorithm for solving complex optimization problems

An optimization algorithm is a step-by-step procedure which aims to achieve an optimum value (maximum or minimum) of an objective function. Several natural inspired meta-heuristic algorithms have been inspired to solve complex optimization problems by utilizing the potential advantages of swarm intelligence. In this paper, a new nature-inspired optimization algorithm which mimics the social hunting behavior of Red Piranha is developed, which is called Red Piranha Optimization (RPO). Although the piranha fish is famous for its extreme ferocity and thirst for blood, it sets the best examples of cooperation and organized teamwork, especially in the case of hunting or saving their eggs. The proposed RPO is established through three sequential phases, namely; (i) searching for a prey, (ii) encircling the prey, and (iii) attacking the prey. A mathematical model is provided for each phase of the proposed algorithm. RPO has salient properties such as; (i) it is very simple and easy to implement, (ii) it has a perfect ability to bypass local optima, and (iii) it can be employed for solving complex optimization problems covering different disciplines. To ensure the efficiency of the proposed RPO, it has been applied in feature selection, which is one of the important steps in solving the classification problem. Hence, recent bio-inspired optimization algorithms as well as the proposed RPO have been employed for selecting the most important features for diagnosing Covid-19. Experimental results have proven the effectiveness of the proposed RPO as it outperforms the recent bio-inspired optimization techniques according to accuracy, execution time, micro average precision, micro average recall, macro average precision, macro average recall, and f-measure calculations.


Introduction
Recently, a wide spectrum of Nature-Inspired Optimization (NIO), also called meta-heuristic, techniques have considerably emerged to address real-world complex optimization problems by mimicking the natural phenomenon (Sharma and Kaur 2021;Monga et al. 2022). Some of them have proved advantage over conventional optimization algorithms, while the others are still under development. NIO, which are also named as meta-heuristic algorithms, have gained higher popularity in the last two decades because, they are; (i) flexible as they can be applied to different problems with no change in their structure, (ii) simple as they are derived from nature, such as physical phenomena or animal behavior, which rely on straightforward concepts, (iii) easy to be applied as they usually consider problems just like black boxes, (iv) have the ability to search extensively within the search space as well as preventing stagnation in local optima as they have stochastic nature (Sharma and Kaur 2021;Monga et al. 2022). NIO algorithms begin with a random assumptions with no need for calculating the derivative of the search space to obtain the optimal value. Hence, they have become more suitable for real world optimization problems than conventional optimization techniques. Moreover, NIO optimization techniques can discover the optimal solutions to a wide range of problem areas in reasonable time (Sharma and Kaur 2021;Monga et al. 2022;Gao et al. 2020;Sharma and Singh 2020;Singh 2020;Wei et al. 2021;Agrawal et al. 2021;George and Raimond 2013).
Generally, NIO can be broadly classified into; Single-Solution optimization (SSO) and Multi-Solution Optimization (MSO) (Hameed et al. 2021). On SSO, searching for the optimal solution begins with one proposed random candidate 1 3 solution improved throughout a consequent set of iterations until the optimum solution is achieved. On the other hand, MSO is initialized by a random set of population solutions in a given search space, which are enhanced during the iterations till the best solution is obtained or a stop criteria is achieved. MSO has some advantages over SSO which are; (i) several possible best solutions are available, (ii) MSO has better ability to bypass the local optima problem due to the information sharing among multiple solutions, whereas SSO may trap into local optima which may prevent achieving the global optimum as SSO reforms only one randomly generated solution for a given problem, (iii) MSO can significantly explore the search space with the aid of multiple solutions compares with SSO. NIO algorithms tries to achieve the global optimal solution for a given problem through an adequate balance between two important factors, namely; exploration and exploitation (Sharma and Kaur 2021;Hameed et al. 2021;Mirjalili et al. 2014). Exploration investigates the algorithm ability to discover new search regions for finding global optima, whereas exploitation focuses on finding of optimal solutions (e.g., local optima) within the promising regions (Sharma and Kaur 2021;Mirjalili et al. 2014). Accordingly, extensive exploration does not result in an optimal solution whereas deep exploitation locks up the algorithm in a local optima (Sharma and Kaur 2021;Mirjalili et al. 2014). Due to the stochastic nature of NIOs, it will be difficult to balance between exploration and exploitation. Overexploitation with too little exploration cause the system to converge more quickly, but the true global optimum may not be achieved. Conversely, little exploitation with much exploration cause the search path to wander around in too slow convergence. Hence, a successful NIO algorithm is the one that has the ability to fine-tuning of the two factors to obtain the near-optimal solution.
Despite the rapid development that NIO has achieved recently, not all of the proposed techniques are highly efficient. Only few of them have proven their efficiency and thus achieved widespread fame and popularity in solving real world problems. Moreover, among those popular algorithms, no one performs well in solving all optimization problems. In other words, an algorithm may perform well for some problems while it may perform poorly for others. Based on the source of inspiration, NIO can be classified into three main types, which are; Evolutionary Algorithms (EA) (Gao et al. 2020;Agrawal et al. 2021), Physics and Chemistry based Optimization (PCO) algorithms (Gao et al. 2020;Agrawal et al. 2021), and Swarm Intelligence (SI) algorithms (Monga et al. 2022;Gao et al. 2020;Agrawal et al. 2021). Nature, as an excellent and immense source of inspiration, can help significantly in finding optimal solutions for complex real world problems. In the recent past, the number of SI optimization algorithms in literature has grown considerably (Monga et al. 2022;George and Raimond 2013). SI has become a growing research area that has several open issues, which are not fully addressed. SI deploys the principle of Collective Intelligence (CI) in which a number of agents work cooperatively to accomplish a specific task. To solve an optimization problem using a SI based algorithm, one should scan the huge available algorithms to decide which one is suitable for the problem in hand (Monga et al. 2022;George and Raimond 2013). Some algorithms may introduce superior results in a specific problem, while they may give degraded performance in other problems. The good performance of an algorithm in solving specific problems does not necessarily mean its ability to solve other problems. The reason for this is the different nature of the problems themselves. Hence, as the success of the optimization algorithm depends on the application area, there is a critical need to introduce new SI algorithms that can suit as many as possible optimization problems. Therefore, developing an efficient SI algorithm is an open research issue. This motivates us to develop a novel SI algorithm for efficiently solving wide range of real world optimization problems in a timely manner.
Piranhas are among the most popular fish in the application of cooperative attack and defense strategies. Many voice messages between the herd members allow for cooperation and coordination of work among them, which certainly allows successful hunting and attacking of prey. Piranha is a very popular; however, the controversial behavior of this fish has not been studied in detail. For example, the attack and defense tactics of the piranha fish have not been studied or modeled. The main contribution of this paper is to introduce a new SI optimization algorithm inspired from the attack behavior of Red Piranha fish, hence, it is called Red Piranha Optimization (RPO). The proposed RPO has very limited algorithm parameters and can successfully avoid local optima. Hence, it can be applied in several optimization problems. A case study is also presented by employing the proposed RPO in selecting the most informative features for diagnosing  Experimental results have shown that the proposed RPO introduces outstanding performance when compared to its peers of the SI based optimization techniques such as; particle swarm, genetic, gray wolf, ant lion, chimpanzee, whale, fire fly, bat, and sine cosine optimization algorithms. The remainder of the paper is organized as follows; Sect. 2 introduces the proposed RPO technique, and Sect. 3 presents a case study for verifying the high performance and suitability of the proposed RPO. Finally, Sect. 4 concludes the study and outlines the main directions for future work.

The proposed red piranha optimization (RPO)
Red Piranha Optimization (RPO) is a nature inspired metaheuristic optimization algorithm which mimics the hunting behavior of Red Piranha fish. Piranha is a schooling, opportunistic ferocious fish (Britannica 2020;Bradford 2017;Mancini 2021). It is omnivorous and has aggressive appetite for meat. Some of their prey includes fish, mollusks, birds, insects, and land animals that enter the water. There are three types of maneuvers associated with feeding piranhas, and they are: (i) Searching, (ii) Encircling, and (iii) Attacking. These maneuvers will be mathematically modeled in the following subsections as the three sequential phases of the proposed RPO algorithm. Although the movement of the piranha swarm is mostly random while searching for prey, this random movement is led by fish with experience in hunting and searching for food called Scouts. When a scouts spot potential prey, it releases a special signal called a "Prey Encircling Signal" (PES) (Britannica 2020;Bradford 2017;Mancini 2021). Hence, the fishes of the flock receive this signal, they begin to surround (Encircle) the prey in the form of spiral movements, the center of which is the prey. When the piranha flock get so close that the prey is within reach of one of the fish, the feeding frenzy begins, as the first fish to reach the prey releases a special signal called "Frenzy Signal" (FS) (Britannica 2020; Bradford 2017; Mancini 2021). Here, the piranha flock regulate its movement, as each fish takes a bite of the prey and makes room for the next fish to take a bite as well in the "Attack-Then-Escape"(ATE) manner until the prey is finished.

Searching for a prey
While piranha fish search for food, they move in the form of an organized flock in a layered manner. Hence, the weaker and smaller fish are often in the middle to enjoy the greatest protection. On the other hand, the largest and strongest fish in the flock are on the outskirts of the group, where they enjoy protection from the inside, but they represent the outer frame of the group and are usually called group "scouts". Scouts have several tasks which are; (i) guaranteeing the group safety as they represent the outer protective shield, (ii) they are vulnerable to attack in the event of predators presence such as crocodiles, and (iii) scouts represent the group explorers, where they urge the rest of the herd to surround the prey at the moment of discovering a potential one. A scout will broadcast "Encircle Signal" (ES) when a potential prey is detected. When alerted, piranhas are very orderly, hence, they start surrounding the prey to prevent it from moving or escaping. Then, after the prey surrounding has been accomplished the attack begins. Hence, fish follow ATE behavior in which some of the fish will take a bite of the prey and then move aside so another fish can take a bite till the prey becomes a skeleton. With no doubt, successful searching for a prey enhances the exploration ability for the algorithm. In order to accomplish such aim, red piranha schools search randomly according the positions of the school individuals. Since the position of the optimal solution (the prey) is not known, piranha scouts search for prey randomly. A number of scouts are randomly selected to guide the search during the exploration and allow the RPO algorithm to perform a global search. This is quite different from the exploitation phase in which piranhas update their position based on the positions of the leaders (best solutions near to the prey). Hence, the basic key to achieve successful exploration is the randomness. Scouts are the herd leaders in this stage, which are chosen randomly. Assuming Z to be the total number of iterations, which are uniformly distributed among the three phases of the algorithm (e.g., Searching, Encircling, and Attacking). Hence, the number of iterations for searching, encircling, and attacking, denoted respectively as; Z Srch , Z Enc , and Z Att can be calculated as; . For illustration, assuming Z = 10, and Z Att = (10 − 2 * 3) = (10 − 6) = 4 . Assuming S is the set of n available solutions (piranha fish), initially, the number of leading scouts (λ) is set, where λ = | | | n | | | in which 2 ≤ ξ ≤ n is a scaling factor. The next step is to select λ random individuals to be the leading scouts, which are expressed by the set SCT = {sct 1 , sct 2 , sct 3 , sct 4 ,……, sct λ }. The remaining individuals of the piranha school, which are expressed by the set R = S-L, are randomly categorized into λ clusters. Each cluster has a leading scout as well as ⌈ n− ⌉ individuals except the last cluster, which may have individuals ≤ ⌈ n− ⌉ . Finally, the position of the mth individual that belongs to the ith cluster is updated based on the scout of its cluster (e.g., st i ). This can be modeled mathematically using (1-4).
where �� ⃗ D P m is the distance between the mth piranha fish (mth solution) and the prey, �⃗ X Sct i (t) is the position vector of the scout of the ith cluster, �� ⃗ r 1 , �� ⃗ r 2 , �� ⃗ r 3 and �� ⃗ r 4 are random vectors in which �� ⃗ r 1 ∈{0,1}, �� ⃗ r 2 ∈[0,1[, ∈ �� ⃗ r 3 ]0,1], and �� ⃗ r 4 ∈[0,1], � ⃗ A and �� ⃗ C are coefficient vectors. The different steps for the searching phase of the RPO is depicted in algorithm 1. Generally, � ⃗ A has a random value inside the interval [− a,a] in which a decreases from 2 to 0 over the 1 3 successive iterations. During searching for a prey (e.g., exploration) � ⃗ A has a random values that are greater than 1 or less than − 1. Based on this assumption, piranhas are able to move far away from their randomly chosen reference scout, instead of the best leaders found so far. This allows the fish to perfectly scan the solution domain and discover new regions by moving far away from their reference scout. Hence, RPO algorithm starts from a set of random solutions (random positions of search agents or simply piranha fish). After each iteration, high exploration ability is accomplished due to the position updating mechanism of piranhas using (2). However, during the attacking phase in which similar update position equations will be used, high exploitation and convergence are achieved by allowing the vector � ⃗ A to be in interval [− 1,1]. The behavior of piranhas is simulated by decreasing the value of � ⃗ a , which in turn decreases � ⃗ A . As � ⃗ A value lies inside the interval [− 1,1], the new position of the piranha will be in somewhere between its current position and the position of its leaders (which roughly represents the place of prey).
Accordingly, RPO algorithm insures high local optima avoidance and convergence speed during the iterations as search agents (piranhas) constantly getting close to prey. So, based on the adaptive variation of the search vector � ⃗ A at searching and attacking phases, RPO is considered as a perfect global optimizer. This is because RPO algorithm easily transit between exploration and exploitation. Simply, RPO algorithm can perform a perfect global search during exploration; also it is eliminating local optima during exploitation with minimal internal parameter adjustments. After each iteration of the searching phase, the location vector of each search agent (except the scouts) is updated and the corresponding objective function is calculated, which reflects the agent's closeness to the potential prey. After finishing Z Srch iterations, there exists ⌊ in additional to the initial random position assumed initially for the agent. Piranha is a greedy fish, hence, greedy selection is performed after performing the iterations of the searching phase. To accomplish such aim, the best position of each search agent is accepted. The best position for the search agent P i is the agent's position vector that introduces the maximum verification of the given objective function over all other positions of P i obtained during the searching phase. Then, each agent is allowed to start the encircling phase form its best position. As an illustrative example, assuming we have n = 10 search agents (piranha fish) in two dimensional space x 1 and x 2 . It is assumed that x 1 and x 2 ∈ [− 5,5], which is assumed to be the search domain. By using ξ = 4, the number of scouts; λ = ⌈ n ⌉ = 3 , hence, there are three clusters. Assuming the number of iterations (cycles) equals is 11 (Z = 11). Hence, , and Z Att = 11-3-3 = 5.
The initial position vectors for the 10 search agents are a s s i g n e d r a n d o m l y u s i n g t h e f o r m u l a ; x = l + rand * (u − l) , where l is the lower value in the considered interval (e.g., − 5), and u is the upper value (e.g., 5). The employed objective function is to minimize f (X) = x 2 1 − x 1 x 2 + x 2 2 + 2x 1 + 4x 2 + 3 . Consider Table 1, which summarizes the three iterations during the searching phase. For illustration, consider the first iteration for the search agent P 1 as depicted in Table 1. It can be noticed that Scout (P 1 ) is P 2 , �⃗ X P 2 (t) = +1.983 +0.562 , �⃗ +3.582 . Finally, the objective function for the new position of the search agent can be calculated, which is 47.014. It is important to mention that when calculating the new position for a search agent (piranha fish), sometimes x 1 or x 2 is outside the pre-assigned range, which is [− 5,5], for illustration, in the first iteration for the search agent P 4 , after calculating x 2 , it is found that x 2 = − 7.106, which is outside the legal range (e.g., x 2 ∉ [− 5,5]).
Hence, as seen in Table 1, it is replaced by the minimum value, which is − 5. Also, if the calculated value of x 1 or x 2 goes above 5 (the maximum legal value), it should be replaced by 5. This situation takes place when calculating x 2 for the search agent P 5 at the first iteration in which x 2 equals 5.797, hence, it is replaced by 5. After finishing the three iterations of the searching phase, there exist four different position vectors for each search agent with the corresponding objective function (three vectors produced through the three iterations of the searching phase in addition to the initial assumed random position). For illustration, consider the four position vectors associated with the search agent P 3 , which are illustrated in Table 2. On the other hand, the best position vectors for all search agents with the corresponding objective function values are illustrated in Table 3. As was mentioned before, piranha fish are greedy predators, hence, they perform what is meant by greedy selection. Hence, after finishing the searching phase, each search agent (piranha fish) scans back the positions it discovers as well as the corresponding objective function validation level, then it returns to the position that gives the best validation. By depicting Table 3, it can be concluded that the best agent after the searching phase is P 2 as it demonstrates the best validation of the considered objective function.

Encircling the prey
During searching for a prey, although the movement of individuals is guided by the scouts, the movement is random in nature (e.g., creative chaos), which allows the agents to discover new areas of the search domain. However, when some fish (called leader or alpha fish as they are the closest to the prey) discover the presence of a potential prey, they issue a certain signal to the rest of the herd members to follow them. This signal is called the "Prey Encircling Signal" (PES). As soon as this signal spreads among the herd individuals, they start surrounding the prey to stop it from moving. Then, after prey encircling has accomplished, the attacking phase begins. Logarithmic spiral has been chosen as the main position update mechanism for herd individuals during the encircling phase. However, any other type of spiral can be employed subject to the following conditions; (i) the initial point of the spiral should start from the search agent (e.g., piranha fish), (ii) the final point of the spiral should be the position of the prey, (iii) spiral fluctuation range should not exceed the search space.
Since the prey represents the optimal solution, and its location is not known, the herd members follow the proposed leaders (alpha fishes), as they are the closest and most aware of the prey's location. So, the first step is to identify the k Alpha individuals, where k is hypothetical and its value should not exceed one tenth of the herd size (e.g., 1 ≤ k ≤ n∕10 ). It is assumed that the location of the potential prey is in the middle position between the selected k alpha fishes, so the hypothetical place of the prey in u dimensional space is calculated using (5). Then, for updating the position of each individual in the herd, initially, the distance from the individual to the potential prey is calculated using (6), then, spiral equation is used to describe the movement of the search agents towards the prey as illustrated in (7).
where, �⃗ X prey (t) is the predicted location of the prey at the iteration t, �⃗ X P m (t) is the position of the mth search agent, �� ⃗ D is the distance between the mth search agent and the prey, b is a constant defines the shape of the logarithmic spiral, and l is a number in the interval [− 1,1] and calculated through the iterations using (8). This also guarantees the good exploitation performed during the encircling phase of the RPO. The sequential steps that should be followed during the encircling phase are illustrated in algorithm 2. Returning again to the illustrative example presented in Sect. 2.1, considering the search agents P 1 , P 2 , …., P 10 depicted in Table 3. There are three iterations for the encircling phase (e.g., Z Enc = 3 ). Assuming k = 3, hence, the best (alpha) search agents are identified from the herd illustrated in Table 3, which are; P 2 , P 7 , and P 6 respectively. The location vector for those alpha fishes are; �⃗  Table 4 illustrates the calculations required for the three consecutive iterations of the encircling phase considering the Eqs. (5-8). Results depicted in such table ensures the effectiveness of both the exploration and exploitation performed during the encircling phase as each search agent keeps introducing better objective function validation across the consecutive iterations. This behavior guarantees the effectiveness of RPO algorithm as it moves continuously towards the optimal solution. Again, piranha are greedy fish, hence, at the end of the encircling phase, the search agents move to their best positions. The best position for a search agent is the one that introduces the best validation of the given objective function. By depicting Table 4, the best positions of the 10 search agents at the end of encircling phase are illustrated in Table 5 at which P 6 is the closest agent to the prey as it introduces the best objective function validation.

Attacking the prey
At the end of the encircling phase, the prey has been encircled tightly and is no longer able to escape. Also, the search agents are becoming too close to the prey, and here alpha fishes issue   special signal, called Frenzy Signal (FS) to start the attack process. After FS is issued by the leader fish (alpha fishes), the rest of the herd are in a state of frenzy as a result of approaching the prey and compete for reaching it. Hence, they follow the k alpha (leader) fish as they are the closest to the prey. Updating the position of each search agent during the attacking phase is accomplished by using (9-13). The k Alpha individuals are initially identified, then the predicted location of the potential prey is calculated using (5), which is assumed to be in the middle position of the alpha fishes. Finally, the position of rest of the herd is calculated by initially calculating the distance between the individual and the potential prey using (9), then the new position of the individual is calculated using (10).
where, �⃗ X prey (t) is the predicted location of the prey at the iteration t, �⃗ X P m (t) is the position of the mth search agent, �� ⃗ D P m is the distance between the mth search agent and the prey, �� ⃗ r 1 and �� ⃗ r 2 are random vectors ∈ [0,1], � ⃗ a vector decreases linearly from 2 to 0 over the course of iterations, � ⃗ A and �� ⃗ C are coefficient vectors. During the attacking phase, � ⃗ A is set to a random value in [− 1,1], hence, the new position of the search agent will be anywhere in between the current position of the search agent and the position of the prey. Now, it is important to discuss a strange behavior of piranha during the attacking phase. As alpha fishes emit the frenzy signal that prompts the rest of the herd to follow because prey is very close. Here the fish of the flock become very close to each other and crowding occurs between them, which we can call "crowding of solutions" and may lead to "solutions collision". As a result of the spread of the frenzy signal among the herd fish, as well as the fish getting too close to each other, the fish become voracious and more aggressive, which may lead the fish to attack each other instead of attacking the prey. This may lead to the loss of some of them as a result of injury or death. And as it is known, each fish represents one of the proposed solutions, and thus, the loss of one of the fish means the loss of one of the potential solutions. Piranhas in nature overcome this problem by escaping from each other if they sense an attack from their peers in the herd, or rather, we can call this wrong attack as; "friendly fire". The escaping fish, which is often weaker than its counterpart, begins to find a safe place and then starts following the prey again by re-tracking the alpha fishes. In order to model this behavior, we first assume that each fish tries to protect itself by maintaining a safe distance between it and its peers from the herd fish, which is called safety shield. The width of the safety shield is assumed to be δ. As a result of this hypothesis, if the distance between two adjacent fish is less than 2δ, then the two fish are very close to each other. This may allow one of them to attack the other as a result of the spread of the frenzy signal among the fish, which makes the fish very voracious. Of course, when one of the fish (search agent or solution) attacks another, which is called a solutions collision, one of the solutions will be lost. The collision condition between P G and P H is dis(P G ,P H ) < 2δ, where dis(P G ,P H ) is the Cartesian distance between the two search agents P G and P H in u dimensional space, and δ is the width of the safety shield. Assuming �⃗ ..x uH > , then the Cartesian distance between agents P G and P H in u dimensional space can be calculated using (14).
Therefore, after each iteration in the attacking phase, the distance between each pair of the search agents should be calculated to test the collision condition. Hence, when a collision between two (or more) search agents is detected, the most powerful agent (which is the one that maximizes the objective function verification) is kept in its position, while the other agent (weaker one) escapes to another random position to start tracking prey again. However, the frequent detection of collision between search agents after each iteration will definitely affect the speed of execution of the algorithm. To overcome such hurdle, check pointing technique can be used. Hence, collision detection is allowed only at certain iterations not all of them. The number of checkpoints is set a priori, hence, checkpoints can be distributed uniformly, randomly, or follow a specific pattern through the attacking phase iterations. For illustration, checkpoints can be performed after the higher iterations at which the search agents are much closer to the prey and to each other, which allows a higher probability of collisions. On the other hand, if it is needed to distribute the checkpoints uniformly, a suggested technique to perform the ith checkpoint after the ⌊ Z att n CK where Z att is the number of iterations of the attacking phase, n CK is the number of the required checkpoints. For illustration if Z att = 7 and n CK = 3 . Then, the first checkpoint (i.e., i = 1) takes place after the first iteration Returning again to the illustrative example presented in Sect. 2.1, considering the search agents P 1 , P 2 , …., P 10 depicted in Table 5. There are four iterations for the Table 6 Different iterations for the attacking phase of the illustrative example Agent Initially First iteration (t = 1)  attacking phase (e.g., Z Att = 4 ). For simplicity, no checkpointing is allowed during the attacking phase. Assuming k = 3, hence, the best (alpha) search agents are identified from the herd illustrated in Table 6, which are; P 6 , P 9 , and P 10 . The location vector for those alpha fishes are; �⃗ X P 6 (t) = −1.493 −2.573 , �⃗ X P 9 (t) = −0.749 −2.441 , a n d �⃗ X P 10 (t) = −0.667 −2.511 , hence, the virtual location of the prey is �⃗ X prey (t) = 1 3 −2.909 −7.525 = −0.970 −2.508 . Table 6 illustrates the calculations required for the four consecutive iterations during the attacking phase considering the Eqs. (9-13).
Results depicted in Table 6 ensures the effectiveness of the exploitation performed during the attacking phase as each search agent keeps introducing better objective function validation across the consecutive iterations. This behavior guarantees the effectiveness of RPO algorithm as it moves continuously towards the optimal solution. Piranha are greedy fish, hence, after each iteration, each search agent compares its new position with the old position, and then it chooses the better. This behavior is different from that during the search and encircling phase at which the search agent chooses the best position at the end of the phase. The cause is that the searching phase is dedicated totally for exploration. Hence, the agent is allowed to continue randomly to discover new regions. Although encircling phase is employed for exploitation, the search agent is also allowed to move even if the new position is worse than the old one to give also some support for exploration. Then, the agent chooses the best position at the end of the encircling phase. On the other hand, the attacking phase is dedicated for exploitation, hence, when a search agent exists in a better position than the new one, it reserves the old position preparing to attack the prey. Comparing positions is done based on the objective function validation. Hence, the more the objective function validation, the more the position priority. By depicting Table 6, it can be concluded that each search agent reserves its maximum validation value of the objective function as well as the corresponding position across the successive iterations of the attacking phase. Hence, the best validation value of the objective function for all agents will be at Z th att (e.g., final) iteration. As depicted in Table 6, P2 introduces the best position as it introduces the best objective function validation at the final iteration of the attacking phase. Hence, P 2 is the optimal solution.
Thus, the efficiency of RPO algorithm has been proven in the continuous case, as after five iterations, the RPO algorithm reached a good value where convergence occurs. Additionally, to prove the efficiency of the RPO algorithm in the binary search space, it will be presented in the next subsection called a case study. To examine the efficiency of RPO in a binary search space during the next subsection, the considered problem is selecting the best set of features for Covid-19 diagnosis.

Case study: feature selection using binary red piranha optimization (BRPO)
Feature selection is the process of reducing the number of input variables by selecting a subset of consistent, non-redundant, and relevant features when developing a predictive model. Hence, feature selection can reduce the computational cost of the model as well as improving the performance of classification model. In fact, selecting the best subset of features before learning the classification model can improve its performance where it enables the classifier to perform its tasks well and fast. Thus, many of general frameworks consists of two main phases, namely; (i) Feature Selection Phase (FSP) and (ii) Classification Phase (CP). The effectiveness of the proposed RPO will be tested in FSP through selecting the most important features for diagnosing Covid-19 patients. The input of FSP is the training dataset in the form of a set of labeled laboratory tests for people infected with the Covid-19 and other tests of healthy individuals. During FSP, the most informative features for Covid-19 diagnose will be selected using the proposed RPO. Then, in CP, the classical Naïve Bayes (NB) classifier will be trained using the dataset with the most important features for the diagnostic process (Rabie et al. 2019;Saleh and Rabie 2023a). For diagnosing a new case, the selected features will be extracted from the laboratory test of that undiagnosed case. Then, the case will be diagnosed (classified) either to "Healthy" class or to "Infected" class. It is important to mention that the used version of RPO in the feature selection problem can be called Binary Red Piranha Optimization (BRPO). In BRPO, each fish (solution) is represented by a binary vector X = (x 1 , x 2 ,……, x f ), x i ∈ [0,1] in f dimensional space. Each dimension represents a feature. Hence, "0" value in the ith dimension indicates that the corresponding ith feature is not included in the selected set, while "1" value indicates that the ith feature is included in the solution. Thus, there are many sequential steps to implement the proposed BRPO to select the best subset of feature from the Covid-19 dataset. BRPO begins with a Swarm (S) which contains a set of search agents (or piranhas) denoted by X, for example, S contains n of search agents, therefore, S contains X = {X 1 ,X 2 ,….,X m ,….,X n }. Each piranha fish (X m ) in S represents a potential solution (i.e. a subset of the most efficient features in the dataset) in the f-dimensional search agent where f represents the total number of features in the Covid-19 dataset, thus, the mth piranha fish can be represented as; X m = (X 1 m , X 2 m ,…. ., X f m ). The position (bit) value of each piranha fish (X m ) is a binary value that may equal one or zero where one indicates the ith feature is selected while zero indicates the ith feature is deleted; i = {1,2,…,f}. After an S is randomly generated with n of search agents in a binary space, the evaluation process should be performed on these search agents using the NB classifier accuracy value as standard classification model to be a fitness function. The mathematical model of the fitness (evaluation) function can be represented using (15). where Fit(X m ) is the fitness value of the mth search agent and NB_Accuracy(X m ) is the NB classifier accuracy based on the subset of selected features in the mth search agent. According to the evaluation values, the best solution is the one that can achieve the maximum accuracy value. In the other words, maximizing the fitness value (classifier accuracy) is the main objective of the feature selection process. After the initial swarm is generated using n of search agents in a binary space and these search agents are then evaluated using the accuracy of the NB classifier, the scaling factor (ξ) and the number of iterations (Z) should be assigned. Based on the value of ξ, the number of scouts or clusters ( ) will be calculated using = ⌈ n ⌉ . Then, the remaining search agents in S will be randomly distributed among clusters taking the scout of each cluster as a leader to the remaining search agents within that cluster. Based on the value of Z, the number of iterations per the searching, encircling, and attacking phases should be calculated using respectively. According to Z Srch , Z Enc , and Z Att , the steps to implement the proposed BRPO are organized in a three parts, namely; (i) steps of the searching phase, (ii) steps of the encircling phase, and (iii) steps of the attacking phase. Initially, steps of the searching phase will be executed until the number of iterations ( Z Srch ) is terminated. If the Z Srch is not finished, then the position of the mth individual belonging to the cth cluster will be updated based on the scout of its cluster (e.g., st c ) using (2). The new position of the mth individual; X m = (X 1 m , X 2 m ,…. .,X f m ) includes continuous values, and therefore, a sigmoid function must be used to convert this position into binary values using (16) (Saleh and Rabie 2023b).
where X i binary_m (t + 1) is the binary value of mth individual at ith bit in the next iteration t + 1; i = 1,2,3,…,f and rand(0,1) represents a random value between [0,1]. Additionally, sigmoid(X i m ) is the sigmoid function that represents the probability of ith bit in which it takes 0 or 1 value calculated by using (17) Saleh and Rabie 2023b).
where the base of the natural logarithm is e. Each individual in S is evaluated using the fitness function in (15) based on the new position X i binary_m (t + 1) for each individual. In fact, each individual in S will store updated position and objective (fitness) values during their journey in search of prey. Steps of the searching phase will be continued until the Z Srch is completed. At the end of the searching phase for a prey, the best position of each individual in S will be the one that enables the individual to give the best fitness value during their journey in search of prey. In the second part, the steps of the encircling phase will be performed on the best positions of the search agents in S given from the searching phase until the number of iterations ( Z Enc ) is terminated. The first step in the encircling phase is to set number of leaders or alpha fishes (k). Then, the best k of the search agents will be determined based on their fitness values to use their positions to calculate the position of the potential prey �⃗ X prey (t) using (5). The position of the prey; X prey = (X 1 prey , X 2 prey ,….,X f prey ) contains continuous values, and therefore, a sigmoid function must be used to convert this position into binary values using (16). In the next step, the search agents in the swarm will update their positions according to the position of the prey. If the Z Enc is not finished, then the position of the mth search agent will be updated based on the position of the prey using (7). New position of the mth search agent will be converted from continuous to binary values using (16). Then, the new positions of search agents in the swarm will be evaluated using the fitness function in (15). Before starting the next iteration, new k of alpha fishes will be determined based on the best fitness values to calculate the current position of the prey using (5). Steps of the encircling phase will be continued until the Z Enc is completed.
In the third and final part, the steps of the attacking phase will be performed on the best positions of the search agents given from the encircling phase until the number of iterations ( Z Att ) is terminated. As in the first step of the encircling phase, the attacking phase begins with setting number of leaders or alpha fishes (k). Then, the best k of the search agents will be determined based on the best fitness values to use their positions to calculate the position of the potential prey �⃗ X prey (t) using (5). The position of the prey; X prey = (X 1 prey , X 2 prey ,….,X f prey ) contains continuous values, and therefore, a sigmoid function must be used to convert this position into binary values using (16). Next, the search agents in the swarm will update their positions according to the position of the prey. If the Z Att is not finished, then the position of the mth search agent will be updated based on the position of the prey using (10). New position of the mth search agent contains continuous values, thus, these values will be converted to binary values using (16). Then, (17) sigmoid X i m = 1 1 + e −X i m the fitness function in (15) will be used to evaluate the new positions of search agents. Before starting the next iteration, new k of alpha fishes will be determined based on the best fitness values to calculate the current position of the prey using (5). Additionally, it is assumed that the collision condition does not satisfied. Steps of the attacking phase will be continued until the Z Att is completed. Finally, the fittest piranha fish represents the best solution that includes the best subset of features. It is noted that dividing the iterations on the three phases (searching, encircling, and attacking) enables the BRPO algorithm to provide fast and accurate subset of features. The reason is that this process gives an opportunity for each phase to try several times to reach the best solution before implementing the next phase attempting to try to approach the prey, which helps the following phases to be implemented more quickly and accurately.

The used dataset and employed parameters
In this subsection, the dataset used to implement the proposed RPO algorithm compared to the most popular optimization algorithms will be described. Then, the parameters employed and their values during execution will be introduced. In fact, the used dataset for this study is called Albert Einstein dataset because it was collected from Albert Einstein Hospital in Brazil and made publicly available by Kaggle (Kaggle 2021). From March 28, 2020 to April 3, 2020, the Albert Einstein dataset consisting of 5644 cases was collected. This informative dataset includes several clinical tests such as urine, rt-PCR, blood, and SARS-CoV-2 test as it contains 110 features (attributes).
This dataset includes two main class categories in the SARS-CoV-2 attribute called "positive" and "negative". While positive class category refers to people infected with Covid-19, negative class refers to non-infected people with Covid-19. In fact, the Albert Einstein dataset includes 559 positive cases and 5085 negative cases (Kaggle 2021). Actually, the proposed BRPO algorithm will be implemented on the Albert Einstein dataset to select the features that most influence the diagnosis of Covid-19. The performance of BRPO will be evaluated against nine of recent binary optimization techniques to select the best subset of features. These optimization techniques are Binary Particle Swarm Optimization (BPSO) (Sharma and Kaur 2021;Harrison et al. 2017), Binary Genetic Algorithm (BGA) (Saleh and Rabie 2023a;Saleh et al. 2016), Binary Gray Wolf Optimization (BGWO) (Sharma and Kaur 2021;Mirjalili et al. 2014), MUDE (Sharma and Kaur 2021;Tan et al.2022), and Binary Chimpanzee Algorithm (BCA) (Khishe and Mosavi 2020). Additionally, the rest of the nine optimization techniques are Cat and Mouse-Based Optimizer (CMBO) (Dehghani et al. 2021), Tuna swarm optimization (TSO) (Xie et al. 2021), Pelican Optimization Algorithm (POA) (Trojovský and Dehghani 2022), and White Shark Optimizer (WSO) (Braik et al. 2022). The values of the employed parameters for these ten optimization techniques should be assigned during execution as presented in Table 7. There are many common parameters that have the same values for all optimization techniques.
The parameters were chosen for each algorithm, which provides the highest accuracy according to the conditions set by this author in his research. Also, there was unification of the work environment through the use of the same dataset and the same characteristics, and the implementation of all algorithms on the same device with the same capabilities. Therefore, we compare our proposed method with other methods in the best accuracy for them. Thus, Table 8 is provided to include the common parameters and their values. As presented in Table 8, the common parameters for all techniques are (i) the total number of iterations (z) that is set to 50, 100, 150, 200, 250, 300, 350, 400, 450, and 500, (ii) the number of search agents or individuals (n) that is set to 25, 50, 75, and 100, and (iii) the dimensions of each search agent (f) that equals 110. Except for BGA, the random value (rand) in the sigmoid function belonging to (0,1) used to convert the continuous positions to binary for all used optimization techniques is presented in Table 8 as a common parameter. According to these values of parameters, the performance of the used optimization techniques against the proposed BRPO should be measured to determine the best technique as a feature selection method. Hence, the evaluation metrics will be discussed in the next subsection.

Evaluation metrics
In this subsection, accuracy (fitness value), execution time, micro average precision, micro average recall, macro average precision, macro average recall, and f-measure are used as evaluation metrics for all optimization techniques. The main objective of these metrics is to determine the best optimization techniques that can quickly select the best subset of features from the Albert Einstein dataset. In fact, the best optimization technique is the one that provides the maximum accuracy value and the minimum execution time compared to other techniques. The Albert Einstein dataset should be divided into two main subsets of data called training and testing. To calculate the accuracy of each optimization technique, NB classifier as a standard classification method should be learned by using the training set of data based on the selected features from each optimization technique (Rabie et al. 2019;Saleh and Rabie 2023a). Then, NB should tested by using the testing set of data based on the selected features. Finally, confusion matrix is used to calculate the accuracy of NB according to the selected features from each optimization technique Rabie 2023a, 2023b). Accuracy is the number of times cases (testing cases) are correctly classified relative to the total number of cases (testing cases). Thus, the accuracy of qth optimization algorithm based on NB classifier can be calculated using (18).

Accuracy opt_algorithm q = Max(NB_accuracy(X m ))
where Accuracy opt_algorithm q is the accuracy of qth optimization algorithm; q = 1,2,….,10. Max(NB_accuracy(X m )) is the maximum NB accuracy value provided by the best search agent X m where m = 1,2,…,n and n is the total number of search agents. The accuracy of mth search agent in the population or swarm can be calculated using (19).
The second evaluation metric is the execution time that represents the multiplication of the number search agents by the number of iterations using (20).
w h e re Executiontime opt_algorithm q i s t h e execution time of the qth optimization algorithm, n is the number of search agents and z is the number of iterations that depends on the stop condition ( Accuracy opt_algorithm q (t) − Accuracy opt_algorithm q (t + 1) < 10 −7 ) . Where t is the current iteration number and t + 1 is the next iteration number. Thus, z may contain the number of iterations (z o ) which is less than the total iterations number; z = z o if the stop condition is matched, otherwise, it is equal to the total number of iterations. In the next subsection, the experimental results will be evaluated using both evaluation metrics called accuracy and execution time.

Experimental results
In this subsection, the experimental results for measuring the superiority of BRPO compared to the other nine algorithms given in Table 7 will be provided to quickly and accurately select the best features. In fact, the experimental results will be generated through two scenarios, which are; (i) testing the performance of BRPO according to the number of iterations, the number of search agents, and the collision detection. And (ii) providing a comparative study to test the best results of BRPO against the other nine algorithms given in Table 7. In the first scenario, the accuracy, and execution time of BRPO will be measured by using (19) and (20) respectively. These measurements will be calculated according to many numbers of iterations (z) and many numbers of search agents (n) presented in Table 8. Depending on the collision detection, BRPO will be executed based on two states called "without collision" and "with collision". In the without collision state, the performance of BRPO (accuracy and execution time) will be measured without taking the collision between fishes in the calculation and also without taking into account the number of checkpoints. On the other hand, in the with collision state, the performance of BRPO (accuracy and execution time) will be measured by taking the collision between fishes in the calculation and also by taking into account the number of checkpoints (n ck ) presented in Table 8. In the second scenario, a comparative study between BRPO and the other nine algorithms given in Table 7 will be introduced by calculating the accuracy, execution time, micro average precision,micro average recall, macro average precision, macro average recall, and f-measure of them. These calculations will be performed according to many numbers of iterations (z) at each specified number of search agents separately. In fact, the ten optimization algorithms are executed as wrapper feature selection methods to select the best features that enable A number defines the shape of the movement logarithmic spiral during the encircling phase ( The encircling coefficient (f) From 2 to 0 Random Vectors; r 1 and r 2 Random [0,1] CMBO (Dehghani et al. 2021) r is a random value Random between [0,1] TSO (Xie et al. 2021) NP: is the number of tuna populations 50 α1 and α2 are the coefficients of weight that used to control the tendency of individuals to move towards the optimal individual and the previous individual a is a constant used to measure the extent to which the tuna follow the optimal individual and the previous individual in the initial phase 0.7 b is a random number Random value between [0,1] TF is a random number 1 or − 1 Z:each individual randomly chooses one of the two foraging strategies to execute, or chooses to regenerate the position in the search space according to probability z 0.05 PSO (Trojovský and Dehghani 2022) m is the number of problem variables Random between [0,1] rand is a random number Random between [0,1] s a random number 1 OR 2 R is a constant 0.2 Cognitive and social constant (C1, C2) (2, 2) WSO (Braik et al. 2022) a: the acceleration factor which is constant From 2 to 0 0.0005 r is a random value Random [0,1] c1 and c2 are two uniformly created random numbers Random [0,1] τ denotes the coefficient of acceleration 4.125 r1, r2 and r3 are random values in the range of [0,1] the NB classifier to quickly and correctly classify Covid-19 patients. Our implementation uses Albert Einstein dataset to select the best features from 110 features which have a significant impact on Covid-19 patients (Kaggle 2021).

a. Testing the performance of Binary Red Piranha Optimization (BRPO) Algorithm
The BRPO algorithm is implemented in two states; which are, "without collision" and "with collision" according to the collision detection. In each state, two main evaluation metrics called accuracy and execution time, which are presented in (19) and (20), are measured to evaluate the performance of BRPO. In the first state called without collision, the collision between fishes is neglected and the accuracy and execution time of BRPO according to many numbers of iterations (z) and many numbers of search agents (n) are calculated as shown in Figs. 1 and 2 respectively. In the second state called with collision, the collision between fishes is taken in the account and the accuracy and speed of BRPO according to many numbers of iterations (z) and many numbers of search agents (n) are calculated. In the second state, many numbers of checkpoints (n ck ) which are 3, 7, and 9 are used. Based on these numbers of checkpoints, the BRPO is executed and the accuracy, execution time, micro average precision, micro average recall, macro average precision, macro average recall, and f-measure measurements according to each number of checkpoints are calculated as shown in Figs. 3,4,5,6,7,8. It was mentioned above that Figs. 1 and 2 represent the efficiency of BRPO algorithm in the without collision state. Accordingly, it is noted that Figs. 1 and 2 show that the accuracy and execution time of BRPO algorithm increase gradually with the increase in both the number of iterations (z) and the number of search agents (n). In fact, increasing the execution time of BRPO will be by a small percentage, and this percentage is logical, since by increasing the number of search agents or the number of iterations, the execution time of the algorithm will increase. It is noted that the maximum accuracy values are achieved at number of iterations equals 500 (z = 500), which are; 92%, 93.09%, 93.88%, and 96.99% at number of search agents equals 25, 50, 75, and 100 respectively. Additionally, the minimum execution time values are generated at number of iterations equals 50 (z = 50), which are; 880, 900, 1550, and 2800 at number of search agents equals 25, 50, 75, and 100 respectively. Hence, the maximum accuracy value (96.99%) is provided at 100 search agents (n = 100) and 500 iterations   3,4,5,6,7,8, it is noted that the accuracy and execution time of BRPO algorithm increase gradually with the increase in the number of n ck , the number of iterations, and the number of search agents. In the with collision state, the maximum accuracy of BRPO is given at each n ck at 500 iterations (z = 500) and 100 search agents (n = 100) while the minimum execution time of BRPO is given at each n ck is provided at 50 iterations (z = 50) and 25 search agents (n = 25), just like the without collision state. Based on the checkpoints values (n ck = 3, 7, and 9), it is observed that n ck = 3 provides the minimum (worst) accuracy values but the minimum (best) execution time values compared to n ck = 9 and vice versa. At n ck = 9, the maximum (best) accuracy values are generated at number of iterations equals 500 (z = 500), which are; 93%, 93.99%, 94.95%, and 98% at number of search agents equals 25, 50, 75, and 100 respectively. Also, the minimum (best) execution time values are introduced at number of iterations equals 50 (z = 50), which are; 911, 929, 1580, and 2828 at number of search agents equals 25, 50, 75, and 100 respectively. Hence, at n ck = 9, the maximum accuracy value (98%) is provided at 100 search agents (n = 100) and 500 iterations (z = 500) while the minimum execution value (911) is provided at 25 search agents (n = 25) and 50 iterations (z = 50). Based on these results, it is observed that the increase of execution time in "with collision state" is a very a slight increase, not large, in order to be noticeable and affect the performance of the BRPO algorithm. Compared to the without collision state, it is concluded that the accuracy of the BRPO algorithm is lower than "with collision state" and its execution time is slightly lower than the with collision state. Thus, the BRPO algorithm based on "with collision state" cannot be suitable for real time applications due to the increased execution time. In the next subsection, a comparative study between the BRPO algorithm in both states (without collision and with collision at n ck = 9) and the other nine algorithms provided in Table 7 will be introduced according to the number of iterations (z). This study will be performed based on each number of search agents (25, 50, 75, and 100) separately to measure the performance of BRPO algorithm against others.

b. Comparing the Performance of BRPO with Related Competitors
In this comparative study, the performance of BRPO algorithm is measured to demonstrate its effectiveness against the performance of other nine algorithms presented in Table 7. Practically, accuracy execution time, micro average precision, micro average recall, macro average precision, macro average recall, and f-measure are used as performance metrics to measure the efficiency of BRPO in both states (without collision and with collision at n ck = 9) against other algorithms according to the number of iterations (z). In fact, the execution of BRPO based on the without collision is denoted as "BRPO_state1" while its execution based on "with collision state" is denoted as "BRPO_state2". These measurements are performed according to each number of search agents (25, 50, 75, and 100) separately. Based on these numbers of search agents, the BRPO is executed and the accuracy, execution time, micro average precision, micro average recall, macro average precision, macro average recall, and f-measure measurements according to each number of search agents (n) separately are calculated as shown in Figs. 9,10,11,12,13,14,15,16,17,18,19,20,21. As presented in Figs. 9,10,11,12,13,14,15,16, the accuracy and execution time of all algorithms increase gradually with the increase in the number of iterations (z) and also with the increase in the number of search agents (n). Based on 25 search agents (n = 25), Fig. 9 shows the accuracy of all algorithms while Fig. 10 provides their execution time according to many numbers of the iterations (z) presented in Table 8. In Fig. 9, it is noted that the BRPO_state2 provides the maximum (best) accuracy value but the BGA provides the minimum (worst) accuracy value according to all numbers of iterations. The best (maximum) accuracy values of MUDE, POA, TSO, BGA, WSO, BCA, BPSO, CMBO, BGWO, BRPO_state1, and BRPO_state2 are 87.5%, 88.01%, 84.82%, 82.67%, 86.754%, 87.02%, 88.05%, 89.4.65%, 89.4.99%, 92%, and 93% respectively at the maximum iterations number (z = 500). In Fig. 10, it is noted that the BRPO_state1 provides the minimum execution time value according to all numbers of iterations. The best (minimum) execution time values of MUDE, POA, TSO, BGA, WSO, BCA, BPSO, CMBO, BGWO, BRPO_state1, and BRPO_state2 are 1130, 1160, 1070, 1088, 1055, 1021, 1065, 1065 respectively at the minimum iterations number (z = 50). It is noted that the best accuracy   BGWO, BRPO_state1, and BRPO_state2 are 3460, 4569, 2190, 4382, 4355, 4345, 4236, 4221, 4214, 2800, and 2828 respectively. Accordingly, all algorithms provide their best accuracy values at z = 500 while their best execution time values are given at z = 50. According to Figs. 9,10,11,12,13,14,15,16, it is concluded that the maximum accuracy values are given by the BRPO_state2 while the minimum execution time values are provided by the BRPO_state1 through all numbers of iterations. Thus, the BRPO has proven its effectiveness against other algorithms in terms of accuracy and execution time. Tables 9, 10 , 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) show the summary of results for the accuracy and execution time of all algorithms. The results in Figs. 17,18,19,20,21 show that the highest macro-average precision value is provided by BRPO state_2 with a value that reaches 0.83 at number of search agent equals to 100. On the other hand, the lowest macroaverage precision value is introduced by BGA with a value reaches to 0.51. Additionally, macro-average recall for BRPO_ state2 is about 0.92 which represents the highest value concerning other algorithms, while the lowest one is BGA with a value of 0.53 at number of search agents equals 100. At 100 search agents, BRPO state _2 gives the highest micro-average precision value equals 0.86 while TSO introduced 0.49 which is the lowest value of micro-average precision. BRPO state_2 provides a micro average recall value that equals 0.94. F-measure value for BRPO is about 0.92 while it is about 0.49, 0.55, 0.51, 0.52, 0.66, 0.86, 0.82, 0.86, 0.89, and 0.90 for MUDE, POA, TSO, BGA, WSO, BCA, BPSO, CMBO, BGWO, BRBO_state1 respectively.

Conclusions and future work
Online applications need to fast and accurate optimization algorithms. Thus, researchers seek to provide the fastest and the most accurate optimization algorithm. The accuracy and execution time of the conventional optimization algorithms increase gradually with the increase in the number of search agents and the number of iterations. Thus, a new optimization algorithm called Red Piranha Optimization (RPO) algorithm is introduced in this paper to provide the best accuracy and execution time compared to the other nine algorithms according to many numbers of search agents and many numbers of iterations. In fact, the RPO algorithm is evaluated according to two states called without collision and with collision states. Feature selection using Binary RPO (BRPO) algorithm is implemented in this work as a case study to evaluate the effectiveness of BRPO against the other nine algorithms in their binary form to quickly and accurately select the best subset of features from the Albert Einstein dataset that contains 110 features. The experimental work is performed for many numbers of iterations (50,100,150,200,250,300,350,400,450,500) and also for many numbers of search agents (25,50,75,100) for all optimization algorithms. The maximum accuracy values for all optimization algorithms are provided at the number of iterations equals 500 and the number of search agent equals 100. On the other hand, the minimum execution time values for all optimization algorithms are provided at the number of iterations equals 50 and the number of search agents