A new Multi Sine-Cosine algorithm for unconstrained optimization problems

The Sine-Cosine algorithm (SCA) is a population-based metaheuristic algorithm utilizing sine and cosine functions to perform search. To enable the search process, SCA incorporates several search parameters. But sometimes, these parameters make the search in SCA vulnerable to local minima/maxima. To overcome this problem, a new Multi Sine-Cosine algorithm (MSCA) is proposed in this paper. MSCA utilizes multiple swarm clusters to diversify & intensify the search in-order to avoid the local minima/maxima problem. Secondly, during update MSCA also checks for better search clusters that offer convergence to global minima effectively. To assess its performance, we tested the MSCA on unimodal, multimodal and composite benchmark functions taken from the literature. Experimental results reveal that the MSCA is statistically superior with regards to convergence as compared to recent state-of-the-art metaheuristic algorithms, including the original SCA.


Introduction
In modern times, optimization has become pertinent to the development of reliable and robust solutions in the field of science and engineering. Optimization involves certain searching mechanisms that can find the best solutions against an objective function [1]. Mostly, optimization search techniques are categorized into deterministic and stochastic search algorithms. The deterministic algorithms mostly use gradient descent trajectories and extremas to find the most feasible solution. Meanwhile, stochastic search uses multiple points in search space and finds multiple optimal solutions in the search space with more efficacy than the deterministic algorithms [2]. Metaheuristic search mostly employs the stochastic search mechanisms that result in the provision of efficient solutions to non-linear problems [3]. A metaheuristic improvement is grounded in the belief that a stochastic estimate of an optimum will be better than a deterministic solution [2]. Due to their prowess at finding optimal solutions with less computing power, several metaheuristics inspired by nature and physical phenomena have been developed. Some classical examples are differential evolution (DE) [4], genetic algorithm (GA) [5], particle swarm optimization (PSO) [6], ant colony optimization (ACO) [7], cuckoo search (CS) [8], wolf search (WS) [9], artificial bee colony (ABC) [10], bat algorithm (BA) [ harmony search (HS) [12], and simulated annealing (SA) [13] etc. More recently, a new set of nature-inspired metaheuristics or simply swarm intelligent metaheuristics are developed to solve large-scale optimization problems. These algorithms are grey wolf optimizer (GWO) [14], crow search algorithm (CSA) [15], African buffalo optimization (ABO) [16,17], whale optimization (WOA) [18], and Sooty-Tern (STOA) [19] etc. The goal of all metaheuristic algorithms is to keep a fine balance between exploration & exploitation of the search space [20]. Although a significant number of algorithms are proposed in this field successfully, but no free lunch (NFL) theorem still welcomes more newbies by suggesting that all algorithms perform optimally in the right environment [3,21]. Satisfied with NFL theory, Mirjalili et al. proposed a Sine-Cosine algorithm (SCA) in 2015 that uses Sine and Cosine functions for improved metaheuristic search [22]. Despite showing its prowess at solving several optimization problems, it still has problems like low learning curves. Also, its magnitude changes progressively during each iteration that ensues in Sine-Cosine's early commitment to exploitation which can be counter-productive. Also, in case of many local optimum, Sine-Cosine can converge to a sub-optimal solution [3]. To address the issues faced by the Sine-Cosine algorithm (SCA), this paper proposes an improved Multi Sine Cosine Algorithm (MSCA) that will avoid local optima convergence and improves exploitation. This characteristic makes MSCA suitable for solving optimization problems with multiple local minimums because it maintains a balance between exploration and exploitation with clustered population of solutions. To assess its performance, we adopt the proposed MSCA for the optimization benchmark functions suite in [22]. MSCA's performance was evaluated against eight popular metaheuristic algorithms, including artificial bee colony (ABC) [23], butterfly optimization algorithm (BOA) [24], crow search algorithm (CSA) [15], differential evolution (DE) [4], grasshopper optimization algorithm (GOA) [25], harmony search (HS) [26], salp swarm optimization (SSA) [27], and the SCA. Experimental results reveal that the MSCA exhibits competitive performance as compared to the SCA and other eight meta-heuristic algorithms. Our contributions are summarized as follows: • A new Multi sine-cosine algorithm (MSCA) that permits the selection of local and global search operations. In the first stage, MSCA offers clustered population to diversify & intensify the search in order to avoid the local minima. Secondly, during the update, MSCA also checks for better search clusters that offer convergence to global minima effectively. Then, these clusters are merged to form a single cluster X that offers a better solution during the search.
• MSCA is tested on 19 complex functions used by Mirjalili in [22]. The optimization problems in these experiments include unimodal, multimodal and composite functions of both low/high dimensions.
• MSCA performed efficiently on hard optimization problems when compared with the stateof-the-art metaheuristic algorithms. Moreover, the efficiency of multiple population division concept of MSCA inspires us to investigate its effect on other metaheuristic algorithms in future studies.
The structure of the paper is organized as follows: Section 2 shed some light on the literature review in which it shed some light on the previous improvements on SCA algorithm; then the original SCA algorithm is discussed in the Sections 3. Section 4 describes the proposed MSCA algorithm. Result and discussions are presented in Section 5. Finally, the paper is concluded in the Section 6.

Literature review
Owing to the theory of "No free lunch theorem" [28] that makes it impossible for a single algorithm to be a remedy for all optimization problems, Sine-Cosine algorithm (SCA) was proposed in 2016 [22]. SCA works by utilizing the sine and cosine functions to generate a set of interdependent candidate solutions. The new position of the solutions is highly dependent on the previous candidate solution. Since its inception, SCA has been widely utilized on single objective benchmark functions testing [22] and multi-objective functions [29]. Besides benchmark functions, SCA has been applied for solving unit commitment problem in energy production [30] and in feedforward neural networks to predict the liver enzymes of carp fish with high accuracy [31]. Hafez et al. [32] applied SCA for binary feature selection and minimization and to enhance the classification performance. Not satisfied with the convergence in SCA, Elaziz et al. stated that it gets stuck in local minima because the operators used for exploration do not work well [21]. He successfully augmented the performance of SCA with an oppositionbased learning platform to generate better solutions. Meshkat et al. came up with an idea of a new weighted update position mechanism (WUPM) instead of the original update method of search agents in SCA. In this method, each search agent was assigned a weight based on its fitness and the position of each agent is updated based on the previous weighted position of the search agent [33]. In 2017, SCA was applied for clustering binarized images of handwritten Arabic text with less noise [34] and for optimization of space shuttle trajectory [35]. A new trend of hybridization was seen at the end of 2017 with the introduction of different high-level heuristics (HLL) and low-level heuristics (LLH) algorithms in SCA. The examples are SCA with Differential Evolution (DE) for structural damage assessment of a truss [36], SCA with Grey Wolf Optimizer (GWO) [37] & SCA with Crow Search for optimization functions [38], Adaptive SCA with Particle swarm optimization (ASCA-PSO) for pairwise local sequence alignment [39], SCA with whale optimization for parameter optimization in a milling process [40], hybrid self-adaptive sine cosine algorithm with opposition based learning [41], and improved sine-cosine algorithm based on orthogonal parallel information for global optimization [42] etc. To find a fine balance between exploration and exploitation, levy flight [43] and chaotic maps [44] were integrated with SCA. Zamli et al. [3] used reinforcement Q-learning table to maintain the states of Sine-Cosine in 2018. They used a reward and punishment mechanism to switch between levy flight and the crossover operator to enhance the solution's diversity. End of 2018 saw a considerable rise of SCA getting integrated with machine learning techniques such as; parameter enhancement of support vector machines [45], a binary variant of SCA [46], context-based image segmentation [47], breast cancer classification [48], secure data placement in the Internet of Things [49], image thresholding [50], load frequency control of autonomous power system using adaptive fuzzy based PID controller optimized with improved sine cosine algorithm [51] etc.
Later years brought several noteworthy contributions towards the existing SCA algorithm to improve its convergence properties. Most of the proposed improvements were on the modification of exploration and exploitation strategies in SCA. Guo et al., adopted optimal neighborhood and quadratic interpolation strategy to overcome the problem of population update that is guided by the global optimal state in the SCA algorithm. The proposed QISCA used a stochastic optimal neighbor for neighborhood updates, and a quadratic interpolation curve for individual updates. Also, the population's exploration was enhanced with quasi-opposition learning strategies thus improving the convergence speed and accuracy [52].
In order to improve the exploitation ability of the SCA, a symmetric SCA with adaptive probability selection (SSCA-APS) was introduced. The proposed SSCA searched normally in the early stages using the default parameters. In the later stages, it dynamically adjusted step-sizes of the search with adaptive probability selection (i.e., to integrate original and symmetric sine-cosine operators). Gaussian distribution was used to avoid the local minima by mutating the global optimal individuals in the current generation. A new individual in population is achieved through quasi-interpolation of two randomly selected individuals with a global optimal individual. SSCA-APS was considered a better improvement when tested on benchmark test functions against other SCA variants [53]. Same year, a multi-strategy enhanced SCA algorithm was proposed by Chen et al. to overcome the problem of local optima in SCA for large dimensional problems. The proposed SCA variant employed five strategies (i.e., Cauchy mutation operator, chaotic local search mechanism, opposition-based learning strategy and two operators based on differential evolution) to converge to global optima while maintaining a fine balance between exploration and exploitation. The performance of the proposed SCA variant was verified against other variants on several CEC2014 benchmark and real functions. The simulation results showed that the proposed SCA is better in terms of quality of solutions and convergence speed [54].
Optimal design of off-grid and on-grid hybrid energy management and supply is quite challenging when the energy production is mostly relying on changing climatic conditions. Renewable energy generated from wind turbines are one of the effective carbon emission control strategy of this age. But wind energy's availability is stochastic in nature. To overcome this problem, Guesmi et al. proposed the integration of chaotic Sine-Cosine algorithm to improve the exploration and exploitation problem of SCA. The improved CSCA algorithm was able to minimize the economic emission dispatch efficiently when applied on the 69-bus ten-unit and 40-unit test systems [55]. Similarly, in another study an improved Sine-cosine with inertial weight algorithm (ISCA) is proposed to design optimal energy management systems for hybrid photovoltaic/wind/fuel cell (PV/WT/FC) system. The target was to minimize the cost of hybrid system life span (CHSLS) for a remote in Iran. Simulation results showed that the ISCA finds easily the optimal combination as PV/WT/FC system with minimal CHSLS than PSO and SCA algorithms [56].
Hydropower systems are another source of clean energy and optimizing operations in hydropower reservoirs can not only help in increased power utilization but also maintain optimal water distribution in arid agricultural zones. Feng et al., tried to answer the reservoir problem with adaptive SCA algorithm. ASCA algorithm used elite mutation strategy to overcome population diversity problem in SCA and the simplex dynamic search strategy to improve solution's quality in real-time hydropower operations in China [57]. In a similar study by Feng et al., three stage optimization strategy is employed to improve SCA. Quasi-opposition learning strategy is used to find a fine balance between exploration and exploitation. The adaptive mutation is employed in the same manner as in ASCA algorithm. And finally, a random weighting agent generated by multiple leader solutions is integrated into the agent's evolution equation to improve the overall convergence rate of SCA. The proposed SCA algorithm was tested on several benchmark composite functions. Also, this method showed its mettle in terms of quality of solution and convergence rate when tested on long-term reservoir operations in China [58].
Modern power transmission networks are becoming quite complex due to the integration of several distributed generators (DG). Directional overcurrent relays (DOCR) protect such networks in a highly constrained environment. Sarwagya et al., employed SCA to solve the optimal coordination problems of DOCR on faults generated by 3-bus, 8-bus, 15-bus and 30-bus test systems. SCA was found to effectively reduce the coordination interval time between primary and backup relays [59]. In another similar study, Raut and Mishra proposed multi-objective sine-cosine algorithm for optimal DG allocation. The objectives were to optimally allocate DG in radial distribution systems while minimizing total active power loss, annual energy loss cost, pollutant gas emissions, and maximizing voltage stability index. Their proposed approach was found to be effective; when, it was tested on slightly larger 33-bus and 69-bus distribution systems under four practical load conditions against strength Pareto evolutionary algorithm 2, non-dominated sorting genetic algorithm II, and multi-objective particle swarm optimization [60]. In another study on DG, SCA was successfully used to reduce the effect of global warming and environmental pollution due to the fossil fuel thermal energy generation by integrating wind energy in hydrothermal scheduling (HTS) [61].
With ever growing size of datasets, feature selection offers an efficient way to reduce a dataset's dimensions and extracting useful information. For this purpose, a multi-objective sine cosine algorithm (SCA) for feature selection (MOSCA_FS) is proposed for hyperspectral imagery. MOSCA_FS is modeled to minimize the redundancy and maximize the relevance of the selected features. MOSCA_FS is found to an effective framework when tested on several benchmark hyperspectral image datasets [62]. To enhance the response of accuracy and response time in machine learning, a new variant called Improved Followers of Salp swarm Algorithm using Sine Cosine algorithm and Disrupt Operator (ISSAFD) is proposed. The ISSAFD works by updating the position of the followers in SSA using sine-cosine algorithm which helps in avoiding local optima altogether [63]. In another high-level hybridization, ABC was effectively integrated with SCA to optimize the threshold values during image segmentation for reduced search region [64]. In the late 2020, SCA was also successfully utilized for reducing features in text categorization in bag of words model [65], and for optimizing local optima problem in Volleyball premier league (VPL) algorithm with high level hybridization [66].
Earlier in 2021, Lawal et al. proposed sine cosine algorithm with artificial neural network (SCA-ANN) models for predicting blast-initiated ground vibrations in five granite mines. The goal was to maximize the safety of human lives and properties near the mining zones by minimizing the impact of vibrations emanating from the blasting of rocks. The proposed SCA-ANN was tested against the Gene expression programming (GEP), adaptive neuro-fuzzy inference system (ANFIS) for predicting the peak particle velocity (PPV). SCA-ANN model trained on 100 datasets and was found to be better than other models with an accuracy of 99 percent with almost zero error [67]. Seeing the intrinsic noise and outlier problems occurring during data clustering in the real world due to initial centroid selection, Kuo et al., proposed a robust SCA-FPCOM algorithm. The proposed SCA-FPCOM originated from the combination of probability c-means, fuzzy c-ordered means, and the sine-Cosine algorithm to improve clustering. The SCA-FPCOM was tested on several datasets and was found to be better than conventional approaches in-terms of adjusted rand index and the Silhouette coefficient [68].
Solar power on-grid generation is becoming a norm these days to avoid generating large electricity bills by selling excess electricity to the grid. Therefore, it is necessary to forecast solar power generation accurately in different weathers. Dash et al., proposed a hybrid forecasting approach consisting of empirical wavelet transform (EWT), Robust minimum variance Random Vector Functional Link Network (RRVFLN) optimized with Sine-Cosine algorithm. The proposed EWT-RRVFLN-SCA was found to be better than the original RRVFLN methods when tested on the historical solar power data [69]. In the mid of 2021, Hussain et al. proposed a hybrid Sine-Cosine Harris Hawk optimization (SCHHO) for minimum feature selection and maximum model generation. Their proposed SCHHO algorithm integrated since-cosine with Harris Hawk optimization to eliminate ineffective exploration in HHO. The SCHHO algorithm was able to adjust exploitation in HHO with dynamic adjustment of candidate solutions thus avoiding stagnancy in local solutions. The SCHHO was tested against state-of-the-art hybrid algorithms on sixteen datasets with high-dimensions exceeding 15000 attributes for numerical optimization. The proposed SCHHO was able to increase convergence speed and reduced features to 87 percent and achieved an accuracy of up to 92 percent [70]. Timeline of some of the most significant contributions to SCA are given in the Fig 1.

Sine-Cosine algorithm
The Sine-Cosine algorithm (SCA) is a metaheuristic search algorithm proposed by Mirjalili et al. [22]. SCA works by searching solutions in the search based on the sine or cosine function given in Eqs (1) or (2) respectively: In general, Both Eqs (1) and (2) are combined into one function as given in the Eq (3): ( Where P i is the destination solution, X i is the current solution, || indicates the absolute value. r 1 , r 2 , r 3 and r 4 are the random variables. The parameter r 1 is a random variable responsible for determining the area of the next solution, this area may be either outside space between X i and P i or inside them. Mirjalili et al. [22] update the parameter r 1 using the following Equation to balance exploration and exploitation. The effect of r 1 can be seen in the Where, a is a constant, T is the maximum number of iterations and t is the current iteration. The r 2 is a random variable which used to find the direction of the movement of the next solution (i.e., if it is towards or outwards P i ). Also, the r 3 is a random variable which gives random weights for P i to stochastically emphasize (r 3 >1) or de-emphasize (r 3 <1) the effect of destination in defining the distance. The r 4 is used to switch between the sine and cosine functions as in Eq (3). The steps of the Sine-Cosine algorithm are given in the Algorithm 1 (Fig 3).

Improved Multi Sine-Cosine Algorithm (MSCA)
The proposed MSCA algorithm enhances the SCA algorithm in two stages; the first stage offers a clustered population to diversify & intensify the search to avoid the local minima. Secondly, during the update, MSCA also checks for better clusters that offer convergence to global minima effectively. The proposed MSCA algorithm starts by generating random clusters of search agent's i.e., X 1 , X 2 , X 3 ,. . .,X n of equal sized population N, in which each cluster X i = [x i1 , x i2 , x i3 ,. . .,x in ] represents a complete solution to the specified problem. Then, these clusters are merged together to form a single group X that offers a better solution. The steps of the algorithm are as follows; 1. Initialize the random population clusters, X 1 , X 2 , X 3 ,. . .,X n .
2. The value of r 1 in Eq (3) plays a pivot role in MSCA to decide whether to switch from explore or exploit. It gradually decreases from 2 to 0. 3. If, the value of r 1 >1, then, MSCA tries to offer better diversity in the new single solution. It merges all the clusters using maximum Euclidean distance (maxED) in Eq (5); 4. If, the value of r 1 <1, then, MSCA tries to offer better intensity in the newly merged single solution by using minimum Euclidean distance (minED) in Eq (6);

Results and discussions
In this section, MSCA is tested on benchmark functions and its performance is compared with eight algorithms. The detailed implementation, parameter settings, and results are discussed in the sub-sections.

Implementation of MSCA and the benchmark algorithms
The proposed MSCA algorithm's performance is evaluated on the benchmark functions commonly used by Mirjalili et al. [71]. The system used for simulations was an Intel Core i5 processor with 8GB of RAM. The proposed MSCA was implemented on MATLAB R2018b with Windows 10 and compared with the latest and most popular algorithms given in Table 1. Three types of benchmark functions were used to evaluate the efficiency of the proposed MSCA algorithm, i.e., unimodal, multimodal, and composite. The detailed descriptions of the function and their properties are given in the sub-sections.

Parameter settings
During all the experiments, default parameters were used for all the parallel algorithms. Meanwhile, the proposed MSCA algorithm used a population size of 30 that was equally divided  among all six clusters. For a fair comparison, the maximum iterations for all the algorithms were set to 1000 with 30 trials on each function. The parameter setting of all the algorithms used in this paper is given in Table 1.

Statistical analysis
For statistical analysis, Standard deviation (SD) is used to find any variations in the average trial values and Mean formula is used to calculate the average of all trials. The equations of SD and Mean are expressed as [2]; SD ¼ ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi P n i¼1 ðx i À x0Þ Mean ¼ Where n is the total number of inputs, N is the total number of values or elements, x i is the number of input patterns, and x 0 is the mean of x i . Sometimes, it is not fair to say that the proposed algorithm is better because it performed statistically better in terms of mean and SD over 30 independent trials as SD and mean does not compare each run. Therefore, to decide on the significance of each result, the Wilcoxon rank-sum is used to find whether the proposed algorithm is statistically better in performance than the rest of the algorithms [72]. The null hypothesis H 0 shows that there is no significant difference as far as the sample size is concerned for MSCA and each comparison algorithm. Alternative hypothesis, H 1 means that MSCA's sample size is less than that of each comparison algorithm [13].

Description of the benchmark functions
The proposed MSCA algorithm is evaluated based on the 19 mathematical functions used by Mirjalili et al. [71]. For testing the algorithms, the benchmark functions are divided into three complex types; i.e., Unimodal, multimodal, and composite functions etc. The two-dimensional (2-D) view of the functions is illustrated in the Fig 5. The detailed descriptions of the function and their properties are given in Tables 2 and 3. Dimension, Range, and f min columns in the Tables 2 and 3 denote the dimensions of the function, boundary of the search space, and the cost of the function.

Parametric test analysis
Depending on the complexity of the benchmark functions, they are divided into three types; i.e., Unimodal (F01-F06), multimodal (F07-F13), and composite (F14-F19). Unimodal functions have no local optima, a single global optimum and used to evaluate the exploitation capability of the algorithm. Multimodal functions have multiple local optima, a single global optimum and used to measure the exploration capability of the algorithm. Meanwhile, the composite functions are used to find the fine balance between exploration and exploitation capability of an algorithm. The statistical mean, SD and CPU time are given in the Tables 4-6 respectively.

Function (s)
Mathematical Formula ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ðy i À 1Þ 2 ½1 þ 10sin 2 ðpy iþ1 Þ� þ ðy n À 1Þ 2 g þ X n i¼1 uðx i ; 10; 100; 4Þ   F06, F11-F12, F14-F16, and HS on F08, F14, F16. Although, most of the algorithms showed stable SD on majority of the functions but ABC was the most stable among them. Again, worst deviation in results were shown by CSA. All SD values can be seen in the Table 6.
In recent age, CPU time is becoming negligible because of the ever-increasing speed of CPU's but still it was recorded for all algorithm and results are illustrated in the Table 6. Here,

Non-parametric test analysis
In this paper, the Wilcoxon rank-sum test is used to determine the significance of the results obtained by MSCA with five other algorithms. Table 7 shows the p-values obtained by MSCA and SCA. The superior significance of the proposed MSCA can be seen in Table 7, where it outperforms SCA, SSA, HS, GOA, and DE algorithms.

Conclusions
A new Multi Sine Cosine algorithm (MSCA) is introduced in this paper. The original Sine Cosine algorithm had a problem of early commitment to exploitation that leads it towards sub-optimal solutions. The proposed MSCA adopts the method of population clusters to diversify & intensify the search in order to avoid the local minima. Secondly, during the update, MSCA also checks for better search clusters that offer convergence to global minima effectively. The proposed MSCA avoids the premature convergence to local optima and avoids variance during convergence. MSCA's performance is evaluated against eight popular metaheuristic algorithms, including ABC, BOA, CSA, DE, GOA, HS, SSA, and the SCA on 19 complex benchmark functions. Experimental results reveal that the MSCA exhibits competitive performance as compared to the SCA and other eight meta-heuristic algorithms. MSCA performed efficiently on hard optimization problems when compared with the state-of-the-art metaheuristic algorithms. Moreover, the efficiency of multiple population division concept of MSCA inspires us to investigate its effect on other metaheuristic algorithms in the future studies.  Project administration: Rozaida Ghazali, Nazri Mohd Nawi.