## 2 Generation of Frequency Distribution Schemes  
In order to make the space gravitational wave detectors operate stably, our lab conducted orbit simulations to predict the Doppler shift for five years and included it as one of the inputs. Here, the genetic algorithm is combined with the beat frequency constraint and the corresponding phase-locking sequence [13]. Then individual adaptive evolution and elite domination are achieved through the corresponding fitness function. Eventually, we can obtain a frequency distribution scheme that conforms to the current conditions. We are aware of the fact that other algorithms exist that may be more efficient [16]. However, compared to other traditional heuristic algorithms, the global search space, robustness and fast convergence characteristics of genetic algorithm are exactly what we need. Most genetic algorithms utilize a random method for generating initial populations. However, for space gravitational wave detection, it is essential to confine the initial population within a predetermined reasonable frequency domain to achieve rapid convergence to the optimal solution. Therefore, this paper constrains the generation of the initial population, mainly involving steps such as random generation, constraint assessment, elimination, and fitness sorting. Based on the initial population, an iterative process is established through selection, crossover, and mutation to obtain the next generation with better quality than the previous until completion. The calculation flow is shown in Figure 1.  
(1) Set the algorithm parameters, including population, generation, percentage of births allowed, mutation probability, mutation effective position and reorganization probability;  
(2) Define the fitness function. To better distinguish high-quality individuals with similar results, we define the fitness function as the deviation between beat frequencies (\(f_{n}\)) and the midpoint of the set frequency domain(\(f_{m}\)) as in example 1:  
Figure 1: Genetic Algorithm Flow Chart for Distribution Scheme. \[F=C_{last}-C_{start}-\sum_{n=1}^{C_{last}-C_{start}}\frac{\sum_{n=1}^{N}(f_{n}-f_{m} )^{3}}{9\times(f_{m})^{3}}, \tag{1}\]  
where \(C_{last}\) is the number of days that the group of offset frequency individuals can reach, \(C_{start}\) denotes the starting day for this group of offset frequencies. (3) Randomly generated initial population. There are five offset frequencies in each individual. Then calculate the frequencies of beat notes and sort individuals by fitness;  
(4) Code Mapping Decimal Offset Data to 16-bit Binary Numbers;  
(5) Selection, crossover and mutation of primordial populations according to setting probability;  
(6) Decode. The decimal real-valued solution corresponding to the binary number \(T\) is \(X\), the conversion formula is shown in example 2 of equation:  
\[X=a+T\times(b-a)/(2^{n}-1), \tag{2}\]  
where \([a,b]\) is the reasonable frequency domain and \(n\) is the binary length;  
(7) Calculate and rank the fitness;  
(8) If complete the scheduled number of iterations, go to step (9). Otherwise, go to step (4);  
(9) If complete the number of days in the set year, end. Otherwise, go to step (3). When locking the entire system according to the phase-locked scheme 1 and frequency domain range [6 MHz, 22 MHz], we can obtain a specific distribution scheme as shown in Table 1. Each group of this scheme generates an optimal set of offset frequencies after 20 generations of inheritance so that it lasts as long as possible under setting conditions. In the next five years, only 10 frequency switches will be necessary. The shortest duration without a switch is 16 days, the longest undisturbed measurement run would be 966 days if no other events cause a short-time failure of the phase-locking. After several tests with the same parameters, although the offset frequency varies individually, the overall number of transitions and duration of days remains consistent, which guarantees the feasibility of the algorithm.