3.2 Genetic Operators

(1) Crossover Operator

The crossover operator randomly pairs individuals from the parent population for crossover operations, generating ( m ) offspring individuals to form the next generation. Two types of crossover are employed: single-point crossover and two-point crossover. Given two individuals for crossover ( P = {p_1, p_2, p_3, \dots, p_n} ) and ( Q = {q_1, q_2, q_3, \dots, q_n} ), a random crossover point ( b_1 ) is chosen from the range [1, n] for single-point crossover. The elements before ( b_1 ) in ( P ) are copied to offspring individual ( \text{new Individual1} ), while the remaining elements are copied from ( Q ). Similarly, a second offspring ( \text{new Individual2} ) is generated by swapping the roles of ( P ) and ( Q ). In two-point crossover, two random crossover points ( b_1 ) and ( b_2 ) are chosen, and the elements between ( b_1 ) and ( b_2 ) in ( P ) are copied to the offspring, with the remaining elements taken from ( Q ).

(2) Mutation Operator

After the crossover operation, two mutation operators are applied to the offspring individuals. The first is rotation mutation, where a random position ( \text{bit} ) is chosen, and with probability ( p_m1 ), the portion of the individual after ( \text{bit} ) is rotated. The second is position mutation, with a smaller probability ( p_m2 ), two integers ( \text{bit1} ) and ( \text{bit2} ) are randomly chosen from the range [1, n], and the corresponding parts of the individual are swapped.

(3) Selection Operator

The fitness of the mutated offspring individuals is evaluated using the lowest level line method. The parent and offspring individuals are ranked by their fitness in descending order, and the top ( m ) individuals are selected as the next generation's parents.

3.3 Termination Criteria

The steps in sections 3.2(1), 3.2(2), and 3.2(3) are repeated until the fitness of the best solution meets the required threshold or the pre-defined number of generations is reached. At this point, the optimal solution is output.

4. Case Study

To test the performance of the algorithm, two cases from literature [3] are solved. In Case 1, a large rectangle of size ( 15 \times 40 ) is divided into 25 smaller rectangles. Based on the lowest level line method, the corresponding coding sequence is ( \text{Opt} = {1, -9, 11, -15, 17, -24, -25, -10, -14, -22, -23, -2, -3, -5, 18, 7, -8, -12, 19, -20, 21, 6, 13, 4} ). The width is set at 40, and height considerations follow suit for the genetic algorithm implementation.