## 2 Good and Bad Groups-Based Optimizer  
In this section, firstly the GBGBO is described, and then the mathematical modeling of the proposed algorithm is presented in order to implement in solving optimization problems. The GBGBO is a population-based optimization algorithm, which is based on random scanning of the problem search space. The member of the population that has a better objective function as the best member of the population can direct the population of the algorithm to the optimal regions. However, the best member of the population may not provide the suitable amount for some problem variables. Thus, instead of just the best member of the population, GBGBO proposes a group of the best members to guide the population in the search space. This is also debatable for the worst member of the population. Instead of moving away from just the worst member of the population, GBGBO suggests moving away from a group of worst members. Thus, in GBGBO, population members update under the influence of two groups named the good group and the bad group. A good group consists of a certain number of the population members with better fitness function than other members and a bad group consists of a number of the population members with a worse fitness function than other members of the population. The population of the GBGBO was defined using a matrix in which each row represented a member that proposed a solution to the optimization problem. The population matrix was first generated randomly and then updated according to the algorithm steps. This population matrix was specified in Equation (1). \[X=\left[\begin{array}{ccccc}X_{1}&\left| \begin{array}{ccccc}x_{1,1}&\cdots&x _{1,d}&\cdots&x_{1,m}\\ \vdots&\ddots&\vdots&&\vdots\\ X_{i}&x_{i,1}&\cdots&x_{i,d}&\cdots&x_{i,m}\\ \vdots&\vdots&&\vdots&\ddots&\vdots\\ X_{N}&x_{N,1}&\cdots&x_{N,d}&\cdots&x_{N,m}\\ \end{array} \right.\right]_{N\times m} \tag{1}\]  
Here, \(X\) is the population matrix, \(X_{i}\) is the \(i\)-th population member, \(x_{i,d}\) is the \(d\)-th dimension of the \(i\)-th population member, \(N\) is the number of population members, and \(m\) is the number of variables of the optimization problem. After determining the population matrix, the objective function of the optimization problem was evaluated based on each member of the population that represents a solution. The vector values of the fitness function are specified in Equation (2). \[F=\left[\begin{array}{c|c}F_{1}&\left| \begin{array}{c}F(X_{1})\\ \vdots\\ F_{i}&F(X_{i})\\ \vdots&\vdots\\ F_{N}&F(X_{N})\\ \end{array} \right.\right]_{N\times 1} \tag{2}\]  
Here, \(F\) is the fitness function value vector and \(F_{i}\) is the fitness function value of the \(i\)-th population member. Each optimization problem has a definite number of \(m\) variables that must be specified to optimize the objective function. In fact, the search space consists of \(m\) axes, each of which determines the value of a problem variable. In most optimization algorithms, a population member leads the population in the search space. That is, a good member leads the population in all axes. However, one or more other members may be more appropriate to guide the population in some axes. In addition, in some optimization algorithms, moving away from the worst population member is effective in updating and improving the population. The main idea of the GBGBO is to use the information of population members more effectively. Accordingly, instead of a good member leading the entire population in all axes, a group of good members was selected to lead the population. In addition, instead of just one bad member moving the algorithm away from the bad areas, a bad group was selected. In the GBGBO, the population members were updated based on two good and bad groups. Good group updating:  
The criterion for selecting good members was the value of the objective function. The number of \(NG\) members of the population that provide the best values of the objective function was selected as a good matrix.