A novel crossover operator for genetic algorithm: Stas crossover

The genetic algorithm (GA) is a natural selection-inspired optimization algorithm. It is a population-based search algorithm that utilizes the concept of survival of the fittest. This study creates a new crossover operator called “Stas Crossover” that is a combination of four crossover operators, including Single point crossover, Two points crossover, Arithmetic crossover, and Scattered crossover, and then presents the performance of this crossover operator. The area size and probability of Stas crossover can be adjusted.GA is used to find the optimal solution for this multi-product and multi-period aggregate production planning (APP) problem, which was used to test the algorithm, which provides optimal levels of inventory, backorders, overtime and regular production rates, and other controllable variables. According to the findings of this study, the benefit of stable crossover is that it allows for more variety in the way offspring are created and increases the opportunity for offspring to obtain good genetic information directly.


Introduction
The genetic algorithm (GA) is a natural selection-inspired optimization algorithm. Natural selection, according to Darwin's theory, favors the fittest individuals who reproduce. This concept was developed by Goldberg (1989). It is a populationbased search algorithm that utilizes the concept of the survival of the fittest. The new populations are created by iterative use of genetic operators on individuals present in the population. GA, according to this idea, is made up of three basic phases: selection, reproduction, and mutation, all of which try to copy the working mechanisms of nature (Burke & Kendall, 2005). GA is mostly used to heuristically locate the global optimal solution. Katoch et al. (2020) discussed genetic algorithms: past, present, and future. This structured review will be helpful for future research.
Aggregate production planning (APP) is a method for developing an overall manufacturing plan that ensures uninterrupted production at a facility. APP is associated with the determination of production, inventory, and labor levels to fulfill varying demand over a planning perspective that ranges from a period of six months to one year (Krajewski & Ritzman, 1999) with limited capacity and resources (Wang & Yeh, 2014). The goal of aggregate planning is to minimize operating costs by matching production demand with production capacity (Pradenas et al., 2004). APP helps manufacturers maximize a facility's productivity and achieve their financial goals. It helps to get the maximum benefit from the available production capabilities while meeting customer demand and reducing the cost of excess inventory.
In the literature reviewed, the theory and the case study for guidelines of research found that they use the GA to solve the proposed aggregate product model. This algorithm is a heuristic search algorithm based on the idea of natural selection that occurs in the process of evolution and genetic operations, which has become very popular in solving APP. Ioannis (2009) described a novel genetic algorithm for the problem of constrained optimization. Lambora et al. (2019) discussed a genetic algorithm work and the process is included.
APP is related to determining the optimum production and workforce levels for each period over the medium-term planning horizon. Cheraghalikhania et al. (2019) reviewed the literature on APP models and groups two main purposes. First, a structured classification scheme for APP models is proposed. Second, gaps that exist in the literature have been shown to extract future directions of their research area. Moghaddam and Safaei (2006) have presented a genetic algorithm for solving a generalized model of single-item resource constrained APP with linear cost functions.
Many researchers have developed an integrated approach to solve APP problems and present many models that combine different algorithms and techniques to solve the problem. In this study, the authors used GA to solve the APP problem. Savsani et al. (2016) described a GA approach for solving APP with different selection methods and various crossover phenomena. The principles of natural selection and genetics are the foundation of GA, which are search algorithms. Mahmud and Hossain (2018) developed an interactive possibilistic environment-based GA for multi-product and multiperiod APP and it has been solved by the multi-objective genetic algorithm to minimize the production cost and the rate of changing imprecise parameters. Ahmed et al. (2019) proposed a model that attempts to incorporate all the relevant cost factors into the optimization model that are directly or indirectly affected by the APP.
However, researchers have formulated a multi-product and multi period aggregate planning problem model considering various decision variables and using different solution techniques. Many studies point to a future research direction for the aggregate planning large-size problem. The limitation of the existing research is the size of the problem and the diversity of ways to select the way to create offspring in crossover. Chakrabortty and Hasin (2013) studied two products, a twomonth period with different population sizes, and a maximum population size of 360. Savsani (2016) presented two products, a two-month period, and a maximum of 100 different experimental runs. Dakka et al. (2017) have formulated a model for five products, 10 months, and a maximum of 50 different experimental runs obtained for 10 runs.
The main goal of this paper is to introduce a new crossover operator called Stas Crossover, that is a combination of four crossover operators and present the performance of this crossover operator. Stas crossover can adjust the size of the area probability. The rest of this paper is organized as follows: In section 2, definitions and concepts for the various crossover operators are introduced and a proposed crossover operator, Stas Crossover is proposed. Subsequently, Section 3 presents some numerical results and discussion to show the application of the proposed cost optimization model. The final section provides a conclusion.

Problem Description & Notation
In this paper, A linear programming model is used to describe the multi-product and multi-period APP problem. Here, the assumption is made for the planning horizon t, in which the source manufactures a product to meet people's market demand. GA is used to find the optimal solution for this APP, which provides optimum levels of inventory, backorders, overtime and regular production rates, and other controllable variables.
Let t = 1, 2, …, T be the production planning period set, where T is the number of periods in the planning horizon. Let i = 1, 2, ..., I represents the product category set, where I represents the number of product categories, and j represents the source category set, where J represents the number of source categories.

Rijt
Regular time production cost for product i manufactured from source j in period t ($/units) Oijt Overtime production cost for product i manufactured from source j in period t ($/units) Vijt Inventory carrying cost for product i from source j in period t ($/units) Bijt Backorder cost for product i m from source j in period t ($/units)

D it Forecasted demand of product i in period t (units) Xijt
Production Quantity of product i manufactured from source j at regular time in period t (units) Yijt Production Quantity of product i manufactured from source j at overtime in period t (units) W ijt Inventory of product i in source j at the end of period t (units) M ijt Backorder of product i in source j at the end of period t (units)

Single Objective APP Model
The aim of this study is to find an optimal APP with minimal total cost. The total cost is the sum of the production costs. Accordingly, the objective function of the purpose model is as follows: The total production cost is mainly considered in this paper, where the total production cost includes four components: regular time production, overtime production, carrying inventory, and backordering cost.

Constraints
The objective functions formulated in the previous section are restricted by two sets of constraints. They are the carrying inventory constraint and the non-negative constraint.

Constraint on Carrying Inventory
where, Dit denotes the imprecise forecast demand of ith product in period t. APP problem in the real world, The forecast demand Dit cannot be accurately obtained in a dynamic market. In the first constraint equation, the sum of regular and overtime production, inventory levels, and backorder levels essentially should equal the market demand. Demand over a specific period can be either met or backordered, but a backorder must be completed in the next period.

Genetic Algorithm
The term "Genetic Algorithm" describes a set of methods that can be used to optimize complex problems (Mirjalili, 2019). As the name suggests, the processes employed by GA are inspired by natural selection and genetic variation. To achieve this, a GA uses a population of possible solutions to a problem and applies a series of processes to them (Alam et al., 2020) In keeping with the evolutionary theme, each individual in a GA population is represented by a chromosome. As in nature, this chromosome contains genetic information relating to each individual's characteristics (Mitchell, 1996). The steps of GA are discussed one by one (Kramer, 2017).
Step 1: Begin by randomly generating a population of n chromosomes.
Step 2: To determine the population's fitness for each chromosome.
Step 3: Repeat the following step: • From the current population, choose a pair of parent chromosomes.
• At a random point, crossover the pair to produce two offspring.
• Perform a mutation test on new offspring at each locus.
Step 4: Replace the current population with the new population.
Step 5: If the end condition is not satisfied, go back to step 3. If the end condition is satisfied, pause and select the best solution within the current population.
In this study, the production quantity of product for each period PPit and the cost of production Ct, the decision variables, both are positive integers, which are conducive to the implementation of chromosome encoding. For sub-chromosome P, an integer I × T matrix is adopted to represent the chromosome of production quantity of product, where I represents the number of product types and T is the number of periods. Fig. 1. shows a chromosome with T periods and I product types, in which gene PPit represents the production quantity of product and gene Ct represents the cost of production in each period P Period (t) Fig. 1. A simple example of chromosome

Crossover operators
Crossover operators specify how the GA form a new individual or offspring by combining two individuals, or parents for the next generation (Chakrabortty & Hasin, 2013;Mathew, 2012). For the purpose of this work, only crossover operators that operate on two parents and combination of four crossover operators including Single point crossover, Two points crossover, Arithmetic crossover, and Scattered crossover. Single point crossover chooses a random position in the entire chromosomal length of the individual. This point is called a cross-site or crossover point. For the first individual the values of the bits for the head of the chromosomes are taken from the first parent and the tail section is taken from the second parent. For example, if p1 and p2 are the parents such as p1 = [s t u v w x y z] and p2 = [1 2 3 4 5 6 7 8] and the random integer is 3. Then, the offspring would have [s t u 4 5 6 7 8] (Kramer, 2017). Two points crossover is chosen and these points are exchanged between two mated parents. For the first individual the values of the bits for head and tail of the chromosomes are taken from the first parent and the middle section is taken from the second parent. For example, if p1 and p2 are the parents such as p1 = [s t u v w x y z] and p2 = [1 2 3 4 5 6 7 8] and the random values are 2 and 4. Then, the offspring would have [s t u 4 5 6 y z] (Sivanandam & Deepa, 2008;Shukla et al., 2010). Arithmetic crossover is a crossover operator that linearly combines chromosome vectors of both the parents to produce two new offspring according to the following equations (Eiben & Smith, 2003).
Scattered crossover is to select the parent bits from randomly made at the time of the crossover. Some bit positions are randomly selected, these bits from the first parent and the other from the second parent another individual is to select the converse bit.

A proposed crossover operator: Stas Crossover
The new crossover operator in this study is a combination of four crossover operators, including Single point crossover, Two points crossover, Arithmetic crossover, and Scattered crossover. The crossover operator is used to combine the genetic information of two parents to generate new offspring. The probability of each operator being the same to generate new offspring is equal to 25%. The new crossover operator is called Stas Crossover. The following Fig. 2. illustrates Stas crossover process, which shows that the new offspring would have an equal probability of occurrence. Stas crossover can be adjusted to the size of the area probability in each operator. The probability of generating new offspring for each operator is unequal. That results in greater variety than traditional crossover. To adjust the size of the area probability, Single point crossover and Two points crossover don't have an area probability because it is assumed that both of these operators have too few improvements and more improvements are needed. It is divided into two parts with a 50% area probability for Arithmetic crossover and Scattered crossover. It is called the Stas0055 crossover. The numbers after Stas represent the probability of each operator. There is also an adjusted probability of Single point crossover of 10%, Two points crossover of 10%, Arithmetic crossover of 10%, and Scattered crossover of 70%. It is called Stas1117 crossover. Fig. 3. Illustrates Stas1117 crossover process, which shows that the offspring would not have an equal probability of occurrence. Its random chance of occurrence depends on the size of the area probability.
Stas Crossover operator selects two parents, such as p1 and p2, for the crossover process to place all the crossover operators on a roulette wheel with an equal area probability. The roulette is turned and the crossover operators are selected at random crossover operators, which chooses single point crossover, two points crossover, arithmetic crossover, and scattered crossover to determine the direction of the way to create offspring. The corresponding crossover options are selected to create the new offspring according to the following conditions: Each experimental run is random, which means that if an experimental run is obtained for 10 runs, it selects different crossover operators in each run. For example, if the first experimental run is selected as a Scattered crossover, that means the second experimental run may be to choose Scattered crossover again or choose the other crossover operators.

Model Implementation
In this study, an APP problem with multi-product and multi-period was used to test the algorithm. Problems are generated with various condition parameters by defining the size of the problem. This study focuses on the size of the problem and optimal solution by changing production costs, inventory costs, backorder costs, production capacity, and forecast demand. Therefore, the actual value of the answer is ignored.

Results and Discussion
The aim Stas crossover for the GA approach can solve multi-product and multi-period APP problems with an interactive decision variable. In this research, problems are defined depending on the size of the problem, and 40 different crossover options are tested for 12 types of problems, and 10 runs are reported for each combination. These four scenarios have been shown in Fig. 4.    . shows the number of times to find the best performance for each option. Stas1117 crossover is able to find the best performance 28 out of 72 times. It can be found that by changing the area probability, it's better than other operators.  Table 4 shows the cost value obtained by using different combinations of crossover procedures. From the results, it can be seen that Stas0055 crossover and Stas1117 crossover perform better than Single point crossover, Two points crossover, and Arithmetic crossover. In addition, it can be seen that the population size and number of generations of the best possible answer are 150 chromosomes and 200 generations, respectively. It can be obtained 8 times out of 12 times the problem size.

Conclusion
In this study, the new crossover operator is called Stas Crossover. It is tested by multi-product and multi-period APP problems with an interactive decision variable. Stas crossover operator performs better than Single point crossover, Two points crossover, and Arithmetic crossover, but in APP problems, Scattered crossover is shown to have the best performance. Then adjust the size of the area probability Stas crossovers, on the other hand, include Stas0055 crossover and Stas1117 crossover. These options could be able to show better performance than every other operator. That means in the beginning it was assumed that a reduction in the percentage of Single point crossover and Two points crossover resulted in an improvement in the answer. The most important advantage of Stas crossover is that it allows more diversity to select the way to create offspring and increase opportunity for offspring that can obtain good genetic information directly.