Photonic crystal fiber structure optimization method based on improved non-dominated sorting grey wolf algorithm
By optimizing the photonic crystal fiber structure using an improved non-dominated sorting gray wolf algorithm, and combining a hierarchy-driven and odor contribution strategy, the problems of time-consuming optimization and inflexible optical property changes in traditional methods are solved. This results in lower dispersion and loss, making it suitable for long-distance communication and fiber optic sensing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional methods for optimizing photonic crystal fiber structures are time-consuming and lack flexibility in changing optical properties, making it difficult to achieve efficient and accurate structural design.
Combining the gray wolf optimization algorithm and the non-dominated sorting genetic algorithm, an improved non-dominated sorting gray wolf algorithm is adopted. Through a level-driven multi-dominant wolf update strategy, an odor contribution strategy, and a KMEANS clustering mechanism, the air hole radius of photonic crystal fiber is optimized to achieve the best dispersion and loss characteristics.
It significantly improves the convergence speed and solution accuracy of photonic crystal fiber structure optimization, achieves lower dispersion and loss, and is suitable for long-distance communication and fiber optic sensing applications.
Smart Images

Figure CN121835337A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of optical fiber communication and relates to a method for optimizing photonic crystal fiber structure based on an improved non-dominated sorting gray wolf algorithm. Background Technology
[0002] The structure of photonic crystal fibers (CFFBs) is a crucial factor affecting their performance. Therefore, finding a suitable structure using the most economical and accurate methods is essential for improving CFFB performance and enabling practical applications. Traditional methods for optimizing fiber structures involve manual adjustments; however, this approach is often time-consuming, and optical properties typically do not change easily with fiber geometry. Therefore, designing and optimizing CFFB structures presents significant challenges. Exploring efficient and precise structural optimization methods is imperative.
[0003] Swarm intelligence algorithms are biomimetic algorithms inspired by the collective behavior of various organisms in nature. They are often composed of individuals that interact and communicate to solve complex problems together. Swarm intelligence algorithms have broad application prospects in combinatorial optimization, signal processing, machine learning, and other fields, and have been widely used to solve various optimization problems. Currently, some researchers have used swarm intelligence algorithms to study the optimization of photonic crystal fiber structures, achieving objectives such as dispersion control by adjusting the structure.
[0004] Non-dominated sorting genetic algorithms demonstrate excellent global search capabilities in solving large-scale problems. However, in high-dimensional problems with multiple local optima, they are prone to local optima, leading to lower convergence rates and accuracy. The Grey Wolf Optimization Algorithm, on the other hand, utilizes the cooperative mechanism of wolf packs, simulating their predation behavior. By adaptively adjusting the convergence coefficient and introducing a feedback mechanism, it achieves a balance between local and global optimization, thus ensuring the accuracy and speed of the optimization results. Considering the advantages of both algorithms, a hybrid optimization algorithm combining the Grey Wolf Optimization Algorithm and the Non-dominated Sorting Genetic Algorithm can be developed. This hybrid algorithm leverages the global exploration capability of the Grey Wolf Optimization Algorithm and the multi-objective optimization advantages of the Non-dominated Sorting Genetic Algorithm to effectively balance global search and local optimization in high-dimensional complex problems, improving the convergence rate and solution accuracy while overcoming the weakness of traditional algorithms that are prone to local optima.
[0005] Therefore, this invention proposes a photonic crystal fiber structure optimization method based on an improved non-dominated sorting gray wolf algorithm. This method utilizes the global exploration capability of the gray wolf optimization algorithm and the multi-objective optimization advantage of the non-dominated sorting genetic algorithm, and proposes a hierarchy-driven multi-dominant wolf update strategy to replace the genetic algorithm update mechanism of the original algorithm. It also proposes an odor contribution strategy, which is used to search for the vicinity of the selected dominant wolf. In the elite strategy retention stage, Pareto distance is proposed, and the Pareto distance is clustered using the KMEANS clustering mechanism and then adaptively eliminated to solve for the air hole radius values of each layer that achieve the best dispersion and loss characteristics of the photonic crystal fiber.
[0006] The method proposed in this invention can effectively balance global search and local optimization when solving high-dimensional complex problems, significantly improving the convergence speed and solution accuracy, and overcoming the shortcomings of traditional algorithms that are prone to getting trapped in local maxima. This algorithm demonstrates significant application value in the optimization of photonic crystal fiber structures. Summary of the Invention
[0007] The problem to be solved by this invention is to propose a photonic crystal fiber structure optimization method based on an improved non-dominated sorting gray wolf algorithm, which solves for the air hole radius values of each layer that achieve the best dispersion and loss characteristics of the photonic crystal fiber.
[0008] A method for optimizing photonic crystal fiber structures based on an improved non-dominated sorting gray wolf algorithm includes the following steps:
[0009] Step 1: First, perform a two-dimensional structural model of the photonic crystal fiber, using the radius of the air holes in each layer of the fiber as the optimization variable, and randomly generate the initial solution Ω. I ,Right now in, Let Ω be the radius of each air hole in a photonic crystal fiber with l layers of air holes, and then, within a pre-defined range of hole radii, Ω is arbitrarily perturbed. I Generate the initial population, i.e. Where t is the current iteration number and Q is the population size. For P t The i-th individual;
[0010] Step 2: For each individual in the population Mode analysis was performed on the corresponding photonic crystal fiber structure to calculate the effective mode refractive index n. eff And calculate the dispersion D(λ) and loss L(λ) based on the effective mode refractive index, where the dispersion is: Where c is the speed of light, τ represents the group delay, λ is the wavelength, and Re(n eff ) is the real part of the complex effective refractive index of the propagation mode, the unit of dispersion is (ps / (nm·km)), and the loss is: Where λ is the wavelength, I m (n eff () represents the imaginary part of the complex effective refractive index of the propagation mode;
[0011] Step 3: Construct a fitness function based on dispersion and loss characteristics and And calculate each based on the fitness function The fitness value, where h is the number of wavelengths selected, and λ1 and λ2 are the start and end wavelengths;
[0012] Step 4: Divide the population into multiple Pareto levels based on fitness values, and update the population using a KMEANS clustering strategy based on Pareto distance. A Pareto distance elimination strategy is proposed, which obtains a series of non-dominated Pareto solutions through dominance relationships, calculates the Pareto distance of each solution relative to an individual in the solution set, and then performs KMEANS clustering on the Pareto distances within the same level. Individuals in the group with the largest Pareto distance are adaptively eliminated, thus achieving dynamic adaptive elimination based on the Pareto distance between individuals, resulting in a new population sorted by Pareto level. The Pareto distance elimination strategy is as follows: Given a population P containing N solutions... t By using the dominance relation, we obtain a series of non-dominated Pareto solution sets, denoted as F. i (i = 1, 2, ..., k), in F i Each individual in the array is represented as X. a (a = 1, 2, ..., s), where s represents the current F i The number of individuals in a set F i For each individual in (i≥2), calculate its relative to F. i-1 Pareto distance of an individual f c = f(i) - f(i-1), where f(i) is F i The fitness value, f(i-1) is F i-1 The fitness value, s is F i-1 Number of individuals, d g Let D be the Euclidean distance from a point on the current frontier to every point on the previous frontier in the target space. After calculating the Pareto distance, perform KMEANS clustering on individuals with the same Pareto distance. Adaptively eliminate individuals from the cluster with the largest Pareto distance. For ease of description of the KMEANS clustering steps, define the sample point as D. t (t = 1, 2, ..., i), where i is the number of sample points, are divided into m clusters. The specific steps are as follows: First, initialize the center points: randomly select initial center points (μ1, μ2, ..., μ). m), m is the current number of center points. Center points can be selected based on experience or arbitrarily. Next, calculate the distance d: calculate the sample point D. t With the initial center point μ i The distance is expressed as: d(t, i) = |D t -μ i Then, clustering: the distances between each individual and the m centroids have been calculated, and each individual is assigned to the cluster corresponding to its nearest centroid. Next, centroids are calculated: based on the samples in the clustering, the centroid of each cluster is calculated, assuming a distance of μ... i There are z individuals centered at point Z, and the value of each individual is D1, D2, ..., D... z The new center point μ i The calculation method is as follows: Finally, iterate until convergence: Iterate through the steps of calculating distance d, clustering groups, and calculating centroids until the clustering algorithm converges, that is, the centroids and groups no longer change after a certain number of iterations.
[0013] Step 5: Update the positions of individuals with a Pareto level of 0 in the new population using an odor contribution strategy. Select the top Q individuals from the non-dominated population and update their positions using the odor contribution strategy. Specifically, the odor contribution strategy searches for the optimal solution in two directions, left and right, centered on some dominant individuals. A random search is used to explore unknown areas. To simulate this behavior, a random direction is generated using the following formula: The formula normalizes the randomly generated position vector, where v is the dimension of the variable, ||rands()|| represents the spatial dimension, and the spatial coordinates in the left and right directions are: dt = γ × dt + d0, where x t dt represents the position of the particle at time t, dt is the search step size at time t, the initial value is 1, and γ and d0 are user-defined parameters;
[0014] Step 6: Select a subset of individuals with Pareto levels of 0, 1, and 2 respectively to perform a level-driven multi-dominance wolf update, defining a population P = [X1, X2, ..., X...]. Q ], where Q is the number of individuals in population P, and F is defined as i Let i represent the set of individuals with Pareto rank i after crowding distance comparison. (i = 1, 2, ..., n) where, This represents the j-th dominant wolf in the i-th Pareto level. We define α candidate wolves as individuals in the first Pareto level F1, β candidate wolves as individuals in the second Pareto level F2, and δ candidate wolves as individuals in the third Pareto level F3. We further define the parameter j... i For Fi The number of dominant wolves selected from the group, ∏ α 、∏ β 、∏ δ These represent the candidate dominant wolves selected from F1, F2, and F3, respectively:
[0015] Where p and q are the possible positions of particles in population P, T is the current iteration number, and gen is the total number of iterations. During the position update process, they are respectively in ∏ α 、∏ β 、∏ δ Randomly select an individual and define the individual's position as pos. α pos β and pos δ Individual update formula:
[0016] Step 7: After updating the population, update the effective mode refractive index corresponding to each individual in the population, calculate the loss and dispersion, and then calculate the fitness value. Repeat steps 4, 5 and 6 above until the number of iterations reaches the preset value.
[0017] Step 8: Output the optimal solution, use the value of the optimal solution as the air hole radius value of the photonic crystal fiber, and apply it to the photonic crystal fiber mode simulation to evaluate the performance of the algorithm in terms of dispersion and loss. Attached Figure Description
[0018] Figure 1 This is a flowchart of the present invention.
[0019] Figure 2 Photonic crystal fiber structure diagram
[0020] Figure 3 Comparison of dispersion curves obtained from simulations of optimization results using different algorithms
[0021] Figure 4 Comparison of loss curves obtained from simulations of optimization results for different algorithms Detailed Implementation
[0022] The main objective of this invention is to propose a photonic crystal fiber structure optimization method based on an improved non-dominated sorting gray wolf algorithm. This method combines the gray wolf optimization algorithm with a non-dominated sorting genetic algorithm and proposes a hierarchy-driven multi-dominant wolf update strategy to replace the original genetic algorithm update mechanism. It also proposes an odor contribution strategy to search for the vicinity of selected dominant wolves. In the elite strategy retention phase, it proposes Pareto distance and uses the KMEANS clustering mechanism to cluster the Pareto distances and then adaptively eliminates them, thus solving for the optimal air hole radius values for each layer that achieve the best dispersion and loss characteristics in the photonic crystal fiber.
[0023] First, a two-dimensional structural model of the photonic crystal fiber is performed. Using the radius of the air holes in each layer of the fiber as the optimization variable, an initial solution Ω is randomly generated. I ,Right now in, Let Ω be the radius of each air hole in a photonic crystal fiber with l layers of air holes, and then, within a pre-defined range of hole radii, Ω is arbitrarily perturbed. I Generate the initial population, i.e. Where t is the current iteration number and Q is the population size. For P t The i-th individual; then, for each individual in the population Mode analysis was performed on the corresponding photonic crystal fiber structure to calculate the effective mode refractive index n. eff And calculate the dispersion D(λ) and loss L(λ) based on the effective mode refractive index, where the dispersion is: Where c is the speed of light, τ represents the group delay, λ is the wavelength, and Re(n eff ) is the real part of the complex effective refractive index of the propagation mode, the unit of dispersion is (ps / (nm·km)), and the loss is: Where λ is the wavelength, I m (n eff The imaginary part of the complex effective refractive index of the propagation mode is represented by ); then, a fitness function is constructed around the dispersion and loss characteristics. and And calculate each based on the fitness function The fitness value is given by h, where h is the number of wavelengths selected, and λ1 and λ2 are the start and end wavelengths.
[0024] Secondly, the population is divided into multiple Pareto levels based on fitness values, and a KMEANS clustering update strategy based on Pareto distance is used for population update. Specifically, a Pareto distance elimination strategy is proposed. A series of non-dominated Pareto solutions are obtained through dominance relationships. The Pareto distances of these solutions relative to individuals in the solution set are calculated. After calculating the Pareto distances, KMEANS clustering is performed on the Pareto distances within the same level. Individuals in the group with the largest Pareto distance are adaptively eliminated, thus achieving adaptive elimination based on Pareto distances between individuals in a dynamic manner, resulting in a new population sorted by Pareto level. The specific details of the Pareto distance elimination strategy are as follows: Given a population P containing N solutions... t By using the dominance relation, we obtain a series of non-dominated Pareto solution sets, denoted as F. i (i = 1, 2, ..., k), in F i Each individual in the array is represented as X. a (a = 1, 2, ..., s), where s represents the current F i The number of individuals in a set F i For each individual in (i≥2), calculate its relative to F. i-1 Pareto distance of an individual f c = f(i) - f(i-1), where f(i) is F i The fitness value, f(i-1) is F i-1 The fitness value, s is F i-1 Number of individuals, d g Let D be the Euclidean distance from a point on the current frontier to every point on the previous frontier in the target space. After calculating the Pareto distance, perform KMEANS clustering on individuals with the same Pareto distance. Adaptively eliminate individuals from the cluster with the largest Pareto distance. For ease of description of the KMEANS clustering steps, define the sample point as D. t (t = 1, 2, ..., i), where i is the number of sample points, are divided into m clusters. The specific steps are as follows: First, initialize the center points: randomly select initial center points (μ1, μ2, ..., μ). m ), m is the current number of center points. Center points can be selected based on experience or arbitrarily. Next, calculate the distance d: calculate the sample point D. t With the initial center point μ i The distance is expressed as: d(t, i) = |D t -μ i Then, clustering: the distances between each individual and the m centroids have been calculated, and each individual is assigned to the cluster corresponding to its nearest centroid. Next, centroids are calculated: based on the samples in the clustering, the centroid of each cluster is calculated, assuming a distance of μ... iThere are z individuals centered at point Z, and the value of each individual is D1, D2, ..., D... z The new center point μ i The calculation method is as follows: Finally, iterate until convergence: Iterate through the steps of calculating distance d, clustering groups, and calculating centroids until the clustering algorithm converges, that is, the centroids and groups no longer change after a certain number of iterations.
[0025] For individuals in the new population with a Pareto level of 0, the position is updated using an odor contribution strategy. The top Q individuals in the non-dominated population are selected and their positions are updated using the odor contribution strategy. Specifically, the odor contribution strategy searches for the optimal solution in two directions, left and right, centered on some dominant individuals. A random search is used to explore unknown areas. To simulate this behavior, a random direction is generated using the following formula: The formula normalizes the randomly generated position vector, where v is the dimension of the variable, ||rands()|| represents the spatial dimension, and the spatial coordinates in the left and right directions are: Where, x t dt represents the position of the particle at time t, dt is the search step size at time t, the initial value is 1, and γ and d0 are user-defined parameters;
[0026] Individuals with Pareto ranks of 0, 1, and 2 are selected for hierarchical-driven multi-dominance wolf update. A population P = [X1, X2, ..., X...] is defined. Q ], where Q is the number of individuals in population P, and F is defined as i Let i represent the set of individuals with Pareto rank i after crowding distance comparison. (i = 1, 2, ..., n) where, This represents the j-th dominant wolf in the i-th Pareto level. We define α candidate wolves as individuals in the first Pareto level F1, β candidate wolves as individuals in the second Pareto level F2, and δ candidate wolves as individuals in the third Pareto level F3. We further define the parameter j... i For F i The number of dominant wolves selected from the group, ∏ α 、∏ β 、∏ δ These represent the candidate dominant wolves selected from F1, F2, and F3, respectively:
[0027] Where p and q are the possible positions of particles in population P, T is the current iteration number, and gen is the total number of iterations. During the position update process, they are respectively in ∏ α 、∏ β 、∏ δRandomly select an individual and define the individual's position as pos. α pos β and pos δ Individual update formula:
[0028] After updating the population, update the effective mode refractive index corresponding to each individual in the population, calculate the loss and dispersion, and then calculate the fitness value. Repeat steps 4, 5 and 6 above until the number of iterations reaches the preset value.
[0029] Finally, the optimal solution is output, and its value is used as the air hole radius value of the photonic crystal fiber. This value is then applied to the photonic crystal fiber mode simulation to evaluate the algorithm's performance in terms of dispersion and loss.
[0030] This invention proposes a photonic crystal fiber structure optimization method based on an improved non-dominated sorting gray wolf algorithm. The obtained air hole radius values of each layer enable the photonic crystal fiber to have lower dispersion and loss values. The following is an illustration with examples. Figure 2 The structure of the photonic crystal fiber has five layers of air holes, each with sizes r1, r2, r3, r4, and r5. Using the method of this invention, the optimal value obtained through iterative optimization is used as the air hole radius value, as shown in Table 1.
[0031]
[0032] An optical fiber model was constructed using an optimization algorithm to iterate the aperture radius corresponding to the optimal value, and mode analysis was performed to obtain the effective mode refractive index. Further calculations were then made of dispersion and loss in the 1.3–2 μm wavelength range. The results are as follows: Figure 3 , Figure 4 Wherein, NSGWO represents the algorithm of this invention, and NSGA2 represents the non-dominated sorting genetic algorithm. Figure 3 It can be seen that the dispersion values obtained by simulation using the aperture obtained by the algorithm of this invention are between 0.027 and -0.76 (ps / (nm·km)), and have flat zero dispersion in the wavelength range of 1.4μm to 1.6μm. The dispersion values obtained by simulation using the aperture obtained by the non-dominated sorting genetic algorithm are between 0.048 and -0.738 (ps / (nm·km)). Figure 4 It can be seen that the loss value obtained by simulation using the aperture obtained by the algorithm of this invention is 4.9 × 10⁻⁶. -14 ~5.49×10 -11 dB / m, the loss value obtained by simulation using the aperture obtained by the non-dominated sorting genetic algorithm is 1.54×10. -13 ~6.07×10 -11Therefore, the photonic crystal fiber structure obtained in this invention has lower zero dispersion and loss in the wavelength range of 1.3 to 2 μm.
[0033] Examples demonstrate that the photonic crystal fiber structure optimization method based on the improved non-dominated sorting gray wolf algorithm proposed in this invention can optimize the structure of photonic crystal fibers, resulting in fibers with lower dispersion and loss. Therefore, the method proposed in this invention has great practical significance in applications such as long-distance communication and fiber optic sensing.
Claims
1. A method for optimizing photonic crystal fiber structures based on an improved non-dominated sorting gray wolf algorithm, comprising the following steps: Step 1: First, perform a two-dimensional structural model of the photonic crystal fiber, using the radius of the air holes in each layer of the fiber as the optimization variable, and randomly generate the initial solution Ω. I ,Right now in, The radius of each air hole in a photonic crystal fiber with multiple layers of air holes is defined, and then Ω is arbitrarily perturbed within a pre-defined range of hole radii. I Generate the initial population, i.e. Where t is the current iteration number and Q is the population size. For P t The i-th individual; Step 2: For each individual in the population Mode analysis was performed on the corresponding photonic crystal fiber structure to calculate the effective mode refractive index n. eff And calculate the dispersion D(λ) and loss L(λ) based on the effective mode refractive index, where the dispersion is: Where c is the speed of light, τ represents the group delay, λ is the wavelength, and Re(n eff ) is the real part of the complex effective refractive index of the propagation mode, the unit of dispersion is (ps / (nm·km)), and the loss is: Where λ is the wavelength, I m (n eff () represents the imaginary part of the complex effective refractive index of the propagation mode; Step 3: Construct a fitness function based on dispersion and loss characteristics and And calculate each based on the fitness function The fitness value, where h is the number of wavelengths selected, and λ1 and λ2 are the start and end wavelengths; Step 4: Divide the population into multiple Pareto levels based on fitness values, and update the population based on a KMEANS clustering strategy using Pareto distance. A Pareto distance elimination strategy is proposed, which obtains a series of non-dominated Pareto solutions through dominance relationships, calculates the Pareto distance of each solution relative to an individual in the solution set, and then performs KMEANS clustering on the Pareto distances within the same level. Individuals in the group with the largest Pareto distance are adaptively eliminated, thus achieving adaptive elimination in a dynamic manner based on the Pareto distance between individuals, resulting in a new population sorted by Pareto level. Step 5: Update the positions of individuals with a Pareto level of 0 in the new population using an odor contribution strategy. Select the top Q individuals from the non-dominated population and update their positions using the odor contribution strategy. Specifically, the odor contribution strategy searches for the optimal solution in two directions, left and right, centered on some dominant individuals. A random search is used to explore unknown areas. To simulate this behavior, a random direction is generated using the following formula: The formula normalizes the randomly generated position vector, where v is the dimension of the variable, ||rands()|| represents the spatial dimension, and the spatial coordinates in the left and right directions are: Where, x t dt represents the position of the particle at time t, dt is the search step size at time t, the initial value is 1, and γ and d0 are user-defined parameters; Step 6: Select a subset of individuals with Pareto levels of 0, 1, and 2 respectively to perform a level-driven multi-dominance wolf update, defining a population P = [X1, X2, ..., X...]. Q ], where Q is the number of individuals in population P, and F is defined as i Let i represent the set of individuals with Pareto rank i after crowding distance comparison. in, This represents the j-th dominant wolf in the i-th Pareto level. We define α candidate wolves as individuals in the first Pareto level F1, β candidate wolves as individuals in the second Pareto level F2, and δ candidate wolves as individuals in the third Pareto level F3. We further define the parameter j... i For F i The number of dominant wolves selected from the group, ∏ α 、∏ β 、∏ δ These represent the candidate dominant wolves selected from F1, F2, and F3, respectively: Where p and q are the possible positions of particles in population P, T is the current iteration number, and gen is the total number of iterations. During the position update process, they are respectively in ∏ α 、∏ β 、∏ δ Randomly select an individual and define the individual's position as pos. α pos β and pos δ Individual update formula: Step 7: After updating the population, update the effective mode refractive index corresponding to each individual in the population, calculate the loss and dispersion, and then calculate the fitness value. Repeat steps 4, 5 and 6 above until the number of iterations reaches the preset value. Step 8: Output the optimal solution, use the value of the optimal solution as the air hole radius value of the photonic crystal fiber, and apply it to the photonic crystal fiber mode simulation to evaluate the performance of the algorithm in terms of dispersion and loss.
2. The photonic crystal fiber structure optimization method based on the improved non-dominated sorting gray wolf algorithm according to claim 1, characterized in that, In step 4, a Pareto distance elimination strategy is implemented as follows: Given a population P containing N solutions... t By using the dominance relation, we obtain a series of non-dominated Pareto solution sets, denoted as F. i (i = 1, 2, ..., k), in F i Each individual in the array is represented as X. a (a = 1, 2, ..., s), where s represents the current F i The number of individuals in a set F i For each individual in (i≥2), calculate its relative to F. i-1 Pareto distance of an individual f c = f(i) - f(i-1), where f(i) is F i The fitness value, f(i-1) is F i-1 The fitness value, s is F i-1 Number of individuals, d g Let D be the Euclidean distance from a point on the current frontier to every point on the previous frontier in the target space. After calculating the Pareto distance, perform KMEANS clustering on individuals with the same Pareto distance. Adaptively eliminate individuals from the cluster with the largest Pareto distance. For ease of description of the KMEANS clustering steps, define the sample point as D. t (t = 1, 2, ..., i), where i is the number of sample points, are divided into m clusters. The specific steps are as follows: First, initialize the center points: randomly select initial center points (μ1, μ2, ..., μ). m ), m is the current number of center points. Center points can be selected based on experience or arbitrarily. Next, calculate the distance d: calculate the sample point D. t With the initial center point μ i The distance is expressed as: d(t, i) = |D t -μ i Then, clustering: the distances between each individual and the m centroids have been calculated, and each individual is assigned to the cluster corresponding to its nearest centroid. Next, centroids are calculated: based on the samples in the clustering, the centroid of each cluster is calculated, assuming a distance of μ... i There are z individuals centered at point Z, and the value of each individual is D1, D2, ..., D... z The new center point μ i The calculation method is as follows: Finally, iterate until convergence: Iterate through the steps of calculating distance d, clustering groups, and calculating centroids until the clustering algorithm converges, that is, the centroids and groups no longer change after a certain number of iterations.