Immuno-flower pollination method based on ternary optical computer
By combining linear selection, uniform crossover, G&C mutation, and flower pollination operator optimization on a ternary optical computer, the computational speed and efficiency bottlenecks of the logistics center location problem were solved, achieving efficient and stable solution results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUYANG NORMAL UNIVERSITY
- Filing Date
- 2023-06-08
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies suffer from bottlenecks in computational speed and efficiency when solving logistics center location problems, especially in large-scale optimization problems where it is difficult to effectively escape local optima.
An immune-flower pollination algorithm based on a ternary optical computer is adopted, which combines linear selection, uniform crossover, G&C mutation and flower pollination operator to optimize the antibody search strategy and achieve algorithm improvement on TOC.
It improves the accuracy and stability of solving the logistics center location problem, significantly reduces computation time, and shows better performance, especially in large-scale problems.
Smart Images

Figure CN116861947B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer algorithm technology, and in particular to an immune-flower pollination algorithm based on a ternary optical computer. Background Technology
[0002] TOC is a novel type of computer proposed by Professor Jin Yi. This computer is a hybrid optoelectronic system, its principle being to express information using different states of light. The most common states of light are illuminated and dark; however, in the illuminated state, light has different directions. TOC further utilizes horizontally polarized and vertically polarized light states to express information, thus forming the "three-valued" nature of TOC together with the dark state. TOC uses liquid crystal devices to control the direction of light, thereby enabling three-valued logic operations. In 2007, Yan Junyong and others discovered the degradation design theory and, together with their research group, summarized and refined this theory. The three-valued logic optical operator designed using degradation theory provided an important theoretical foundation for the structural design of TOC.
[0003] The TOC differs from traditional electronic computers in many ways in its working principle. Its adder is an MSD parallel carry-free adder, eliminating carry latency issues; any multi-digit data can be processed in three instructions. Furthermore, the TOC can process millions of bits, and its optical processor can be divided into countless smaller optical processors, each capable of independently serving a single application. This gives the TOC powerful parallelism. The TOC is programmed using operation data files (also known as SZG files), a programming technique similar to traditional programming that retains popular programming conventions.
[0004] To overcome the bottlenecks in computing speed, bandwidth, and power consumption of electronic computers, the Tri-Valued Optical Computer (TOC), as an emerging computer, has attracted much attention in recent years due to its ultra-high parallelism. With the continuous development and enrichment of optical computing technology theory and practice, the exploration of TOC-based applications is also constantly advancing. The algorithm maintains population diversity by introducing a linear selection strategy. Gaussian and Cauchy (G&C) mutations enable the algorithm to escape local optima, and a flower pollination operator is added to the core of the immune algorithm to enhance its local search capability. Experimental results show that the algorithm has high solution quality and good robustness, effectively solving the logistics center location problem under given constraints, and that TOC has higher solution efficiency compared to electronic computers.
[0005] The Artificial Immune Algorithm (AIA) is a novel intelligent optimization algorithm designed by researchers, simulating the immune principles of biological systems and incorporating the evolutionary process of biological genes. The Flower Pollination Algorithm (FPA) is a simulation algorithm based on the behavior of pollinating insects or bees in nature. Developed by incorporating natural pollination behavior, the FPA is an emerging algorithm for solving optimization problems. Summary of the Invention
[0006] The purpose of this invention is to solve the LDC problem and improve the algorithm on TOC.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] An immune-flower pollination algorithm based on a ternary optical computer, characterized by the following steps:
[0009] Input: n, pm, pc, ps, G, m, k
[0010] Output: Optimal solution and optimal antibody
[0011] Step 1: Initialize parameters and randomly generate n+m antibodies;
[0012] Step 2: The objective function and conditions are called the antigen;
[0013] Step 3: TOC processor refactoring;
[0014] Step 4: Calculate fitness;
[0015] Step 5: Calculate the similarity between antibodies;
[0016] Step 6: Calculate the degree of motivation using the diversity parameter ps;
[0017] Step 7: Calculate the probability of each antibody being selected;
[0018] Step 8: Select antibodies to enter the next generation, and select the best m antibodies to enter the memory bank;
[0019] Step 9: Perform uniform crossover with probability pc;
[0020] Step 10: Perform G&C mutations with probability pm;
[0021] Step 11: Calculate the optimal antibody position (best);
[0022] Step 12: Evaluate each antibody if rand > Pi If the search is local, then a search is performed locally; otherwise, a global search is performed.
[0023] Step 13: Ifflowr new flower old That is, if the value after the search is greater than the value before the search, then update the optimal antibody position.
[0024] Step 14: Repeat Step 11 to Step 13 until the maximum number of iterations equals k;
[0025] Step 15: Repeat Step 4 and Step 14 until the maximum number of iterations equals G.
[0026] Logistics center site selection issues:
[0027] The selection of logistics centers is considered an optimization problem. The following assumptions are made in the logistics distribution center location model:
[0028] (1) The size and capacity of the distribution center can always meet the demand of the demand points and is determined by the demand within its distribution coverage area;
[0029] (2) A demand point is supplied by only one distribution center;
[0030] (3) Transportation costs from the factory to the distribution center are not considered;
[0031] Based on the above assumptions, the following model is established. This model is a location selection / allocation model, which requires finding distribution centers from n demand points and distributing goods to each demand point while satisfying the distance upper limit. The objective function is to minimize the sum of the products of the demand quantity and distance from each distribution center to the demand center. The objective function is:
[0032]
[0033] The constraints are:
[0034]
[0035] Z ij ≤h i ,i∈N,j∈M i #(3)
[0036]
[0037] Z ij ,h j ∈{1,0},i∈N,j∈M#(5)
[0038] d ij ≤s#(6)
[0039] Where N = {1, 2, ..., n} is the set of indices for all demand points; M i Let be the set of alternative distribution centers whose distance to demand point i is less than s. ∈ i Indicates the demand at the demand point; d ij Z represents the distance from demand point i to the nearest distribution center j; Z is a 0-1 variable representing the service demand allocation relationship between users and logistics centers. When it is 1, it means that the demand of demand point j is supplied by distribution center j; otherwise, Z... ij =0; h j It is a 0-1 variable; when it is 1, it means that point j is selected as a distribution center; s is the upper limit of the distance between the newly built distribution center and the demand points it serves. Equation (2) ensures that each demand point can only be served by one distribution center; Equation (3) ensures that the demand of a demand point can only be supplied by the point set as a distribution center, that is, there will be no customers at locations without distribution centers; Equation (4) specifies that the number of points selected as distribution centers is p; Equation (5) represents the variable Z. ij and h j It is a 0-1 variable; Equation (6) ensures that the demand point is within the range that the distribution center can deliver to.
[0040] The following design is proposed for the artificial immune algorithm based on the logistics center location problem.
[0041] 1) Calculate the affinity between the antibody and the antigen: (where F) v Objective function);
[0042]
[0043] 2) Calculate the affinity between antibodies: C v (Using the R-bit continuous method);
[0044]
[0045] Where k is the number of identical values in antibody v and antibody s; L is the length of the antibody; in the logistics location problem, two antibodies are [59152629303335,40,45] and [5101520262830354050]. After comparison, they have 6 identical values. At this time, their similarity S can be calculated. v,s It is 0.6;
[0046]
[0047] Where N is the total number of antibodies; Where F is the similarity threshold;
[0048] 3) Calculate the expected proliferation rate P of each antibody:
[0049]
[0050] Where μ is the diversity evaluation parameter;
[0051] The steps of the artificial immune algorithm are as follows:
[0052] Input: n,s,pm,pc,ps,G,m
[0053] Output: Optimal solution and optimal antibody
[0054] Step 1. Initialize parameters and randomly generate n+m antibodies;
[0055] Step 2. The objective function and conditions are called the antigen;
[0056] Step 3. Calculate fitness according to formula (7);
[0057] Step 4. Calculate the similarity between antibodies according to formula (8);
[0058] Step 5. Calculate the incentive degree according to formula (9);
[0059] Step 6. Calculate the probability of each antibody being selected according to formula (10);
[0060] Step 7. Select antibodies to enter the next generation, and select the best m antibodies to enter the memory bank;
[0061] Step 8. Cross;
[0062] Step 9. Mutation;
[0063] Step 10. Repeat steps 3 and 9 until the maximum number of iterations equals G.
[0064] Design of an immune-flower pollination algorithm based on TOC:
[0065] (1) Adjustable linear selection
[0066] In linear selection, the population size is n, and individuals are sorted in ascending order according to their fitness values. The best individual is σ(1)=n*P(1); the worst individual is σ(i)=n*P(n); and the other individuals are sorted according to the following formula.
[0067]
[0068] according to We can obtain σ(1) + σ(n) = 2; σ(n) ≥ 0, σ(1) - σ(n) ≥ 0; the selection pressure can be dynamically adjusted in [1, 2] through σ(1); based on this, the linear sorting selection formula is as follows,
[0069]
[0070] σ(n)=2-σ(1)#(13)where, fitness avg It is the average fitness value in the population;
[0071] In the early stages of evolution, because populations were generated randomly, If the σ(1) is relatively small and the selection pressure is also relatively small, then the algorithm has a strong optimization ability to expand the search space; in the early stages of evolution, if a super individual appears. (ie, fitness) min <<fitness avg The selection probability of σ(1)→1 is close to random; in the middle stage, σ(1) will be dynamically adjusted according to the characteristics of population evolution; in the later stage, the average fitness and optimal fitness of the population tend to be balanced (i.e., fitness). min ≈fitness avg ), σ(1)→2, during this stage the selection pressure is high, the local optimization ability is strengthened, which is conducive to convergence;
[0072] (2) Uniform cross
[0073] Uniform crossover is a crossover method commonly used in optimization problems. It involves randomly selecting a gene from each gene position of two parent antibodies with a certain probability and crossing it with the gene selected from the two parent antibodies to generate a new antibody.
[0074] (3) G&C mutation
[0075] Given the need for antibody population diversity and uniform antibody distribution, and based on this deficiency, global mutation of the antibody was performed after cross-operation.
[0076] The form of Gaussian mutation is shown in (14):
[0077] x * =x + x*N(0,1)#(14)
[0078] Where N(0,1) represents a standard Gaussian distribution, the essence of Gaussian mutation is to make full use of the information of the current antibody population to perturb, which is conducive to escaping local optima, thereby performing global search and achieving convergence;
[0079] The form of Cauchy variation is shown in (15):
[0080] x * =x + x*C(0,1)#(15)
[0081] Where C(0,1) represents the standard Cauchy distribution; after Cauchy mutation, the antibody produces larger mutations, which can escape local optima and increase search speed; G&C mutations are as follows.
[0082]
[0083] (4) Flower pollination operator
[0084] The Flower Pollination Algorithm (FPA) simulates the natural process of flower pollination and is based on the following four fundamental rules:
[0085] 1) Biological pollination and cross-pollination can be viewed as a global pollination process, in which pollinators carrying pollen move in a manner that follows levy flight.
[0086] 2) Abiotic self-pollination is a localized pollination process;
[0087] 3) Flower constancy is considered a probabilistic probability, which is proportional to the similarity between the two flowers involved;
[0088] 4) The transition probability P∈[0,1] controls local pollination and global pollination;
[0089] The iterative formula for the flower pollination algorithm is:
[0090]
[0091] in, Let represent the value of the i-th pollen in iteration t; L(λ) represents the random search path of Levy's flight; r represents the step size; best is the best solution in iteration t;
[0092] The formula for calculating L(λ) is as follows:
[0093]
[0094] In the formula, λ = 3 / 2, and Γ(λ) is the standard gamma function;
[0095]
[0096] In the formula, μ is a random number uniformly distributed between [0,1]. and This indicates two distinct pollen grains in the population at the same iteration number;
[0097] For the selection probability P i Adaptive adjustment
[0098]
[0099] Where t represents the current iteration number; T represents the maximum iteration; in the t-th iteration, This represents the fitness value of the i-th flower; Represents the minimum fitness value; It is the maximum fitness value;
[0100] The steps of the TOC-based immune-flower pollination algorithm are as follows:
[0101] Input: n,s,pm,pc,ps,G,m,k
[0102] Output: Optimal solution and optimal antibody
[0103] Step 1: Initialize parameters and randomly generate n+m antibodies;
[0104] Step 2: The objective function and conditions serve as the antigen;
[0105] Step 3: TOC processor refactoring;
[0106] Step 4: Calculate fitness according to formula (7);
[0107] Step 5: Calculate the similarity between antibodies according to formula (8);
[0108] Step 6: Calculate the incentive degree according to formula (9);
[0109] Step 7: Calculate the probability of each antibody being selected according to formula (11);
[0110] Step 8: Select antibodies to enter the next generation, and select the best m antibodies to enter the memory bank;
[0111] Step 9: Perform uniform crossover with probability pc;
[0112] Step 10: Perform G&C mutations with probability pm;
[0113] Step 11: Calculate the optimal antibody position (best);
[0114] Step 12: Evaluate each antibody if rand > P i If the search is successful, then use formula (17) to search; otherwise, use formula (19) to search.
[0115] Step 13: Ifflower new flower old That is, if the value after the search is greater than the value before the search, then update the optimal antibody position;
[0116] Step 14: Repeat Step 11 to Step 13 until the number of iterations equals k;
[0117] Step 15: Repeat Step 4 and Step 14 until the maximum number of iterations equals G.
[0118] The technical contributions of this invention can be summarized as follows:
[0119] AIA was first implemented and improved on TOC;
[0120] An AIA with an adjusted linear selection method was proposed.
[0121] A G&C mutation strategy was proposed;
[0122] A TOC-based fusion method of Artificial Immune Flower Pollination Algorithm (AIFPA) is proposed.
[0123] The two algorithms were tested and compared in experiments of varying scales. The improved algorithm showed increasingly significant advantages as the problem size increased. Experiments demonstrate that the algorithm proposed in this invention not only possesses high solution accuracy but is also relatively stable, greatly reducing the computation time for the time to solve (TOC). Attached Figure Description
[0124] Figure 1 This is a flowchart of the artificial immune algorithm;
[0125] Figure 2 The flowchart shows the TOC-based immune-flower pollination algorithm (AIFPA).
[0126] Figure 3 The convergence curve of experiment IAIA at coordinate point 31;
[0127] Figure 4 The convergence curve of the AIA experiment at coordinate points 31;
[0128] Figure 5 The result of selecting IAIA for the 31 coordinate points experiment;
[0129] Figure 6 The convergence curve of AIFPA experiment at 50 coordinate points;
[0130] Figure 7 The convergence curve of the AIA experiment at 50 coordinate points;
[0131] Figure 8 The result of selecting AIFPA for the 50 coordinate point experiment is shown in the figure. Detailed Implementation
[0132] The technical solution of the present invention will be clearly and completely described below with reference to specific embodiments. The described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0133] like Figure 1 As shown, the Artificial Immune Algorithm (AIA algorithm)
[0134] Algorithm steps:
[0135]
[0136] like Figure 2 As shown, the steps of the TOC-based immune-flower pollination algorithm (AI FPA) are as follows:
[0137]
[0138]
[0139] Logistics center site selection issues
[0140] The logistics industry is the lifeblood of the national economy, one of its fundamental industries, and is gradually developing towards informatization, networking, automation, and globalization. To adapt to these economic development trends, it is necessary to improve the performance and structure of logistics. Therefore, in-depth research into logistics systems, especially logistics supply chain networks, is particularly important. Logistics has seven main functions: transportation, packaging, warehousing, distribution, processing, handling, and information processing. Almost all of these functions are related to Logistics Distribution Centers (LDCs). An LDC is a virtual node in the logistics process; furthermore, the location of the LDC plays a crucial role in its functionality. The LDC problem refers to finding the minimum cost, shortest total transportation time, and shortest total transportation distance under certain constraints. Achieving the optimal goal is an NP-hard problem.
[0141] The selection of logistics centers can be considered an optimization problem. The following assumptions are made in the logistics distribution center location model:
[0142] (1) The size and capacity of the distribution center can always meet the demand of the demand points and is determined by the demand within its distribution coverage area;
[0143] (2) A demand point is supplied by only one distribution center;
[0144] (3) Transportation costs from the factory to the distribution center are not considered.
[0145] Based on the above assumptions, the following model is established. This model is a location selection / allocation model, which requires finding distribution centers from n demand points and distributing goods to each demand point while satisfying the distance upper limit. The objective function is to minimize the sum of the products of the demand quantity and distance from each distribution center to the demand center. The objective function is:
[0146]
[0147] The constraints are:
[0148]
[0149] Z ij ≤h i ,i∈N,j∈M i #(3)
[0150]
[0151] Z ij ,h j ∈{1,0},i∈N,j∈M#(5)
[0152] d ij ≤s#(6)
[0153] Where N = {1, 2, ..., n} is the set of indices for all demand points; M i Let be the set of alternative distribution centers whose distance to demand point i is less than s. ∈ i Indicates the demand at the demand point; d ij Z represents the distance from demand point i to the nearest distribution center j; Z is a 0-1 variable representing the service demand allocation relationship between users and logistics centers. When it is 1, it means that the demand of demand point j is supplied by distribution center j; otherwise, Z... ij =0; h j It is a 0-1 variable; when it is 1, it means that point j is selected as a distribution center; s is the upper limit of the distance between the newly built distribution center and the demand points it serves. Equation (2) ensures that each demand point can only be served by one distribution center; Equation (3) ensures that the demand of a demand point can only be supplied by the point set as a distribution center, that is, there will be no customers at locations without distribution centers; Equation (4) specifies that the number of points selected as distribution centers is p; Equation (5) represents the variable Z. ij and h j It is a 0-1 variable; Equation (6) ensures that the demand point is within the range that the distribution center can deliver to.
[0154] Artificial Immune Algorithm Design
[0155] The following design is proposed for the artificial immune algorithm based on the logistics center location problem.
[0156] 4) Calculate the affinity between the antibody and the antigen: (where F) v Objective function);
[0157]
[0158] 5) Calculate the affinity between antibodies: C v (Using the R-bit continuous method);
[0159]
[0160] Where k is the number of identical values in antibody v and antibody s; L is the length of the antibody. For example, in the logistics location problem, two antibodies are [5 9 15 26 29 30 33 35 40 45] and [5 10 15 20 26 28 30 35 40 50]. After comparison, 6 values are identical. Their similarity S can then be calculated. v,s It is 0.6.
[0161]
[0162] Where N is the total number of antibodies; Where F is the similarity threshold.
[0163] 6) Calculate the expected proliferation rate P for each antibody:
[0164]
[0165] (where μ is the diversity evaluation parameter);
[0166] Algorithm steps:
[0167]
[0168] TOC-based immune-flower pollination algorithm design
[0169] (1) Adjustable linear selection
[0170] In linear selection, the population size is n, and individuals are sorted in ascending order according to their fitness values. The best individual is σ(1)=n*P(1); the worst individual is σ(i)=n*P(n); and the other individuals are sorted according to the following formula.
[0171]
[0172] according to We can obtain σ(1) + σ(n) = 2. σ(n) ≥ 0, σ(1) - σ(n) ≥ 0. The selection pressure can be dynamically adjusted within [1, 2] using σ(1). Based on this, the linear sorting selection formula is as follows:
[0173]
[0174] σ(n)=2-σ(1)#(13)where, fitness avg It is the average fitness value in the population.
[0175] In the early stages of evolution, because populations were generated randomly, The σ(1) is relatively small, and the selection pressure is also relatively small, so the algorithm has a strong optimization ability to expand the search space. In the early stages of evolution, if a super individual appears... (i.e., fitness) min <<fitness avg The selection probability of σ(1)→1 is close to random. In the middle stage, σ(1) will be dynamically adjusted according to the characteristics of population evolution. In the later stage, the average fitness and optimal fitness of the population tend to be in equilibrium (i.e., fitness). min ≈fitness avg ), σ(1)→2, at this stage the selection pressure is large, the local optimization ability is strengthened, which is conducive to convergence.
[0176] (2) Uniform cross
[0177] Uniform crossover is a common crossover method used in optimization problems. Its basic idea is to randomly select a gene from each gene position of two parent antibodies with a certain probability (usually 0.5) and crossover it with the gene selected from the two parent antibodies to generate a new antibody.
[0178] The main advantage of uniform crossover is that it can effectively avoid getting trapped in local optima, increase the breadth and depth of the search, and maintain the diversity of the population.
[0179] In summary, uniform crossover is a highly effective crossover method in genetic algorithms and is widely used in solving practical problems. By randomly selecting genes from two parents for crossover, the performance and efficiency of the algorithm can be effectively improved, enabling efficient solutions to optimization problems.
[0180] (3) G&C mutation
[0181] To address the need for antibody population diversity and uniform antibody distribution, and based on this deficiency, global mutations were performed on the antibodies after cross-operation.
[0182] Gaussian mutations are popular because they offer excellent search capabilities within a small range and can generate small mutation values with a high probability within an antibody population. The form of Gaussian mutations is shown in (14):
[0183] x * =x + x*N(0,1)#(14)
[0184] Here, N(0,1) represents a standard Gaussian distribution. The essence of Gaussian mutation is to fully utilize the information of the current antibody population to perturb it, which helps to escape local optima and thus perform a global search to achieve convergence.
[0185] The difference between Cauchy mutation and Gaussian mutation is that Cauchy mutation can generate a random number far from the origin, so the search range is larger than that of Gaussian mutation. The form of Cauchy mutation is shown in (15):
[0186] x * =x + x*C(0,10#(15)
[0187] Where C(0,1) represents the standard Cauchy distribution. After Cauchy mutation, the antibody produces larger mutations, which can escape local optima and increase search speed. The G&C mutations are as follows.
[0188]
[0189] (4) Flower pollination operator
[0190] The Flower Pollination Algorithm (FPA) simulates the natural process of flower pollination and is based on the following four fundamental rules:
[0191] 1) Biological pollination and cross-pollination can be viewed as a global pollination process, in which pollinators carrying pollen move in a manner that follows levy flight.
[0192] 2) Abiotic self-pollination is a localized pollination process.
[0193] 3) Flower constancy is considered to be a probabilistic probability, which is proportional to the similarity between the two flowers involved.
[0194] 4) The transition probability P∈[0,1] controls local pollination and global pollination.
[0195] The iterative formula for the flower pollination algorithm is:
[0196]
[0197] in, Let represent the value of the i-th pollen in iteration t; L(λ) represents the random search path of Levy's flight; r represents the step size; best is the best solution in iteration t.
[0198] The formula for calculating L(λ) is as follows:
[0199]
[0200] In the formula, λ = 3 / 2, and Γ(λ) is the standard gamma function.
[0201]
[0202] In the formula, μ is a random number uniformly distributed between [0,1]. and This indicates two distinct pollen grains in the population at the same iteration number.
[0203] For the selection probability P i Adaptive adjustment
[0204]
[0205] Where t represents the current iteration number; T represents the maximum iteration; in the t-th iteration, This represents the fitness value of the i-th flower; Represents the minimum fitness value; It is the maximum fitness value.
[0206]
[0207] Simulation Experiment
[0208] This experiment was conducted under the Windows 10 operating system environment, using MATLAB simulation software, version 2022b.
[0209] The AIA population size is 50, the memory bank capacity is 5, the diversity evaluation coefficient is 0.95, the crossover probability is 0.5, and the mutation probability is 0.3.
[0210] The AI FPA population size is 50, the memory bank capacity is 5, the diversity evaluation coefficient is 0.95, the crossover probability pc is 0.5, the mutation probability is 0.6, the number of flower pollination searches is 5, and the Cauchy and Gaussian mutation probabilities are r2=r3=0.4.
[0211] The experimental results of 31 coordinate points are as follows Figure 3-5 As shown.
[0212]
[0213] Table 1 shows the comparison chart of experiments using 31 coordinate points.
[0214] As shown in Table 1, AI FPA not only finds the optimal value, but also minimizes the average value and the number of iterations required, demonstrating its outstanding solution capability. To increase the complexity, experiments were conducted using coordinate points 50 and 20, with the population size remaining constant and other parameters unchanged.
[0215] Experimental results at 50 coordinate points are as follows Figure 6-8 As shown.
[0216]
[0217] Table 2 shows a comparison of the experimental results at 50 coordinate points.
[0218] Table 2 shows that AIFPA yields the best results and exhibits the best stability. Combining the results of the two experiments reveals that AIFPA's solution capability and robustness gradually become more prominent, indicating that the improved strategy is better and more stable.
[0219] The fitness calculation phase of this problem requires two nested loops, with a total of M*Y calculations, where M is the population size and Y is the number of cities. This part of the computation requires M*Y calculations on a computer. However, when performing carry-free MSD addition on a ternary optical computer, if the processor has a sufficiently large number of bits, enough adders can be reconstructed. This part of the operation, p, only requires 3 clock cycles. Compared to a computer, this method has a significant advantage in computation time.
Claims
1. A method for solving the logistics center location problem based on an immune-flower pollination algorithm using a ternary optical computer, characterized in that, The selection of logistics centers is treated as an optimization problem. The following assumptions are made in the logistics distribution center location model: (1) The size and capacity of the distribution center can always meet the demand of the demand points and is determined by the demand within its distribution coverage area; (2) A demand point is supplied by only one distribution center; (3) Transportation costs from the factory to the distribution center are not considered; Based on the above assumptions, the following model is established. This model is a location selection / allocation model. Under the condition of satisfying the distance limit, it is necessary to find the distribution center from n demand points and distribute the goods to each demand point. The objective function is to minimize the sum of the products of demand and distance from each distribution center to the demand center. The constraints are: WITH ij ≤h i ,i∈N,j∈M i #(3) Z ij ,h j ∈{1,0},i∈N,j∈M#(5) d ij ≤s#(6) Where N = {1, 2, ..., n} is the set of indices for all demand points; M i Let N be the set of alternative distribution centers whose distance to demand point i is less than s. ω i The ratio represents the demand at the demand point; d ij Z represents the distance from demand point i to the nearest distribution center j; ij Z is a 0-1 variable representing the service demand allocation relationship between users and logistics centers. When it is 1, it means that the demand at demand point j is supplied by distribution center j; otherwise, Z is a 0-1 variable. ij =0; h j It is a 0-1 variable. When it is 1, it means that point j is selected as a distribution center; s is the upper limit of the distance between the newly built distribution center and the demand points it serves; Equation (2) ensures that each demand point can only be served by one distribution center; Equation (3) ensures that the demand of the demand point can only be supplied by the point set as the distribution center, that is, there will be no customers in the location without a distribution center; Equation (4) specifies that the number of selected distribution centers is p; Equation (5) represents the variable Z. ij and h j It is a 0-1 variable; Equation (6) ensures that the demand point is within the range that the distribution center can deliver to; The following design is proposed for the artificial immune algorithm based on the logistics center location problem. 1) Calculate the affinity between the antibody and the antigen: (where F) v Objective function); 2) Calculate the affinity between antibodies: C v (Using the R-bit continuous method); Where k is the number of identical values in antibody v and antibody s; L is the length of the antibody; in the logistics location problem, two antibodies are [59152629303335, 40, 45] and [5101520262830354050]. After comparison, they have 6 identical values. At this time, their similarity S can be calculated. v,s It is 0.6; Where N1 represents the total number of antibodies; Where F is the similarity threshold; 3) Calculate the expected proliferation rate P for each antibody: Where μ is the diversity evaluation parameter; Design of an immune-flower pollination algorithm based on TOC: (1) Adjustable linear selection In linear selection, the population size is n, and individuals are sorted in ascending order according to their fitness values. The best individual is σ(1) = n*P(1); the worst individual is σ(n) = n*P(n); and the other individuals are sorted according to the following formula. according to We can obtain σ(1) + σ(n) = 2; σ(n) ≥ 0, σ(1) - σ(n) ≥ 0; the selection pressure can be dynamically adjusted in [1, 2] through σ(1); based on this, the linear sorting selection formula is as follows, σ(n)=2-σ(1)#(13)where, fitness avg It is the average fitness value in the population; In the early stages of evolution, because populations were generated randomly, If the σ(1) is relatively small and the selection pressure is also relatively small, then the algorithm has a strong optimization ability to expand the search space; in the early stages of evolution, if a super individual appears. (i.e., fitness) min <<fitness avg The selection probability of σ(1)→1 is close to random; in the middle stage, σ(1) will be dynamically adjusted according to the characteristics of population evolution; in the later stage, the average fitness and optimal fitness of the population tend to be balanced (i.e., fitness). min ≈fitness avg ), σ(1)→2, during this stage the selection pressure is high, the local optimization ability is strengthened, which is conducive to convergence; (2) Uniform cross Uniform crossover is a crossover method commonly used in optimization problems. It involves randomly selecting a gene from each gene position of two parent antibodies with a certain probability and crossing it with the gene selected from the two parent antibodies to generate a new antibody. (3) G&C mutation Given the need for antibody population diversity and uniform antibody distribution, and based on this deficiency, global mutation of the antibody was performed after cross-operation. The form of Gaussian mutation is shown in (14): x * =x+x*N(0,1)#(14) Where N(0,1) represents a standard Gaussian distribution, the essence of Gaussian mutation is to make full use of the information of the current antibody population to perturb, which is conducive to escaping local optima, thereby performing global search and achieving convergence; The form of Cauchy variation is shown in (15): x * =x+x*C(0,1)#(15) Where C(0,1) represents the standard Cauchy distribution; after Cauchy mutation, the antibody produces larger mutations, which can escape local optima and increase search speed; G&C mutations are as follows. (4) Flower pollination operator The Flower Pollination Algorithm (FPA) simulates the natural process of flower pollination and is based on the following four fundamental rules: 1) Biological pollination and cross-pollination can be viewed as a global pollination process, in which pollinators carrying pollen move in a manner that follows levy flight. 2) Abiotic self-pollination is a localized pollination process; 3) Flower constancy is considered a probabilistic probability, which is proportional to the similarity between the two flowers involved; 4) The transition probability P∈[0,1] controls local pollination and global pollination; The iterative formula for the flower pollination algorithm is: in, Let represent the value of the i-th pollen in iteration t; L(λ) represents the random search path of Levy's flight; r represents the step size; best is the best solution in iteration t; The formula for calculating L(λ) is as follows: In the formula, λ = 3 / 2, and Γ(λ) is the standard gamma function; In the formula, μ is a random number uniformly distributed between [0, 1]. and This indicates two distinct pollen grains in the population at the same iteration number; For the selection probability P i Adaptive adjustment Where t represents the current iteration number; T represents the maximum iteration; in the t-th iteration, This represents the fitness value of the i-th flower; Represents the minimum fitness value; It is the maximum fitness value; The steps of the TOC-based immune-flower pollination algorithm for solving the logistics center location problem are as follows: Input: n, s, pm, pc, ps, G, m, k Output: Optimal solution and optimal antibody Step 1: Initialize parameters and randomly generate n+m antibodies; Step 2: The objective function and conditions serve as antigens; Step 3: TOC processor refactoring; Step 4: Calculate fitness according to formula (7); Step 5: Calculate the similarity between antibodies according to formula (8); Step 6: Calculate the incentive degree according to formula (9); Step 7: Calculate the probability of each antibody being selected according to formula (11); Step 8: Select antibodies to enter the next generation, and select the best m antibodies to enter the memory bank; Step 9: Perform uniform crossover with probability pc; Step 10: Perform G&C mutations with probability pm; Step 11: Calculate the optimal antibody position (best); Step 12: Evaluate each antibody if rand > P i If the search is successful, then use formula (17) to search; otherwise, use formula (19) to search. Step 13: If flower new >flower old That is, if the value after the search is greater than the value before the search, then update the optimal antibody position; Step 14: Repeat Step 11 to Step 13 until the number of iterations equals k; Step 15: Repeat Step 4 and Step 14 until the maximum number of iterations equals G.