Method for Processing TSP Problem Based on Improved Particle Swarm Optimization Algorithm and Dynamic Step Size Neural Network

By improving the combination of particle swarm algorithm and dynamic step neural network, the problem of low solution efficiency and accuracy in large-scale TSP problems is solved, and more efficient global optimal solution is achieved.

CN114386593BActive Publication Date: 2025-06-03SHANGHAI UNIV OF ENG SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111552384.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-06-03
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively solve the larger-scale travel dealer problem (TSP). Since the hardware core technology has reached a bottleneck, it is difficult to improve performance through single core manufacturing.

Method used

Using a method of combining improved particle swarm algorithm and dynamic step neural network, the network energy function and dynamic equation of the Hopfield network are constructed, and the inertial weight update strategy of the particle swarm algorithm is optimized to solve the TSP problem.

Benefits of technology

It improves the efficiency and accuracy of solving large-scale TSP problems, can have a greater chance of jumping out of the local optimal solution, obtaining the global optimal solution, and enhancing the performance of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114386593B_ABST
    Figure CN114386593B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for processing the TSP problem based on an improved particle swarm optimization algorithm and a dynamic step neural network, including: for the TSP problem, obtaining urban location parameters; constructing a network energy function of a Hopfield network according to the constraints of the TSP problem, and initializing the Hopfield network; constructing a network dynamic equation and solving it; determining whether the constructed Hopfield network reaches stability, if so, performing parameter optimization and update based on the improved particle swarm optimization algorithm, otherwise reconstructing the network dynamic equation; determining whether the improved particle swarm optimization algorithm reaches the termination condition, if so, taking the optimal solution obtained based on the improved particle swarm optimization algorithm as the optimal solution of the solved TSP problem. Compared with the prior art, the present invention has the advantages of solving the current NP-hard problem where the solution space grows exponentially with the increase of the problem scale, and effectively improving the convergence speed and convergence accuracy, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of communication and computer technologies, and in particular, to a method for processing the Traveling Salesman Problem (TSP) based on an improved particle swarm optimization algorithm and a dynamic step-size neural network. Background Art

[0002] The Hopfield neural network was proposed by John Hopfield in 1982. It is a recursive neural network. The characteristic of this network is that all neurons work simultaneously and process in parallel. The continuous Hopfield neural network is similar to an electric circuit. The network introduces the concept of an energy function. When the network reaches stability, the energy function reaches the minimum. The change of the network state can be represented by a difference equation derived from Kirchhoff's law. If the parameters are set appropriately, the Hopfield network is applicable to the solution of various combinatorial optimization problems. The network has a fast solution speed, but the disadvantage is that it is easy to obtain a sub-optimal solution rather than a global optimal solution.

[0003] As an application of the Hopfield neural network, consider the Traveling Salesman Problem (TSP). There are n cities, represented by the numbers (1,..., n). The distance between city i and city j is d(i, j), where i, j = 1,..., n. The goal of the TSP is to visit each city exactly once, and finally return to the starting city, forming a circuit with the shortest total path length. Solution space: The solution space S is all circuits that visit each city exactly once.

[0004] At the present stage, many algorithms only support serial operations. For some algorithms with a large amount of calculation, the efficiency is often relatively low. In addition, for NP-hard problems where the solution space grows exponentially with the increase of the problem scale, when the problem scale is small, through some algorithms, such as heuristic algorithms and exact algorithms, the problem can be solved well to a certain extent. However, when the problem scale continues to increase, due to the fact that the manufacturing process of hardware cores has reached a bottleneck at the present stage (for example, on a CPU, limited by the number of computing units on the chip), it leads to the technical problem that it is difficult to improve the performance by manufacturing a single core. Summary of the Invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned existing technologies and provide a method for processing the TSP problem based on an improved particle swarm optimization algorithm and a dynamic step-size neural network.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] A method for processing the TSP problem based on an improved particle swarm optimization algorithm and a dynamic step-size neural network, the method comprising:

[0008] For the TSP problem, obtain the city location parameters;

[0009] According to the TSP problem constraints, construct the network energy function of the Hopfield network and initialize the Hopfield network;

[0010] Construct the network dynamic equation and solve it;

[0011] Judge whether the constructed Hopfield network reaches stability. If it does, perform parameter optimization and update based on the improved particle swarm algorithm. Otherwise, reconstruct the network dynamic equation;

[0012] Judge whether the improved particle swarm algorithm reaches the termination condition. If it does, take the optimal solution obtained based on the improved particle swarm algorithm as the optimal solution to the solved TSP problem.

[0013] Furthermore, the city location parameters include city coordinates and the distances between cities.

[0014] Furthermore, the expression of the network energy function of the constructed Hopfield network is:

[0015]

[0016] In the formula, E is the network energy, A and D are respectively the parameters for measuring network constraints and the target optimal solution, V xi is the state of the neuron at the x-th row and the i-th column in the transposition matrix, V y,i+1 is the state of the neuron at the y-th row and the (i + 1)-th column, x is the city number, y is the city number, and n is the number of cities.

[0017] Furthermore, the expression of the constructed network dynamic equation is:

[0018]

[0019] In the formula, U xi is the initialized Hopfield network, d xy is the distance from city x to city y, V yi is the state of the neuron at the y-th row and the i-th column in the transposition matrix.

[0020] Furthermore, the specific content of performing parameter optimization and update based on the improved particle swarm algorithm is:

[0021] Take the solution obtained from the operation of the neural network as the initial position of the particle swarm algorithm, take the path length as the fitness function, calculate the chaotic random inertia weight, and update the particle velocity and position.

[0022] The expression of the chaotic random inertia weight w is:

[0023] z = z * μ * (1 - z)

[0024] w = 0.5 * rand + 0.5 * z

[0025] Wherein, μ = 0.4, z is a number between (0, 1) and not equal to 0, 0.25, 0.5, and 1, and rand is a random number between (0, 1).

[0026] Furthermore, the update expressions for the particle velocity v i and the position x i are as follows:

[0027] v i = v i w i + c 1 × r1(p besti - x i ) + c 2 × r2(g besti - x i )

[0028] x i = x i + v i

[0029] Wherein, w i is the inertia weight, c 1 , c 2 are the learning factors, p besti is the optimal position found by the current particle, g besti is the optimal position found by the current population, and r1 and r2 are random numbers in the interval (0, 1).

[0030] Furthermore, to determine whether the improved particle swarm optimization algorithm reaches the termination condition, it is to judge the fitness function value of each particle. If the current position fitness value of a certain particle is less than the individual extreme value p besti , then update the individual extreme value p besti of the particle to the current position of the particle; if the individual extreme value p besti of the particle is less than the global extreme value g besti after the update, then assign the position of the particle to the global extreme value g besti .

[0031] The method for processing the TSP problem based on the improved particle swarm optimization algorithm and the dynamic step-size neural network provided by the present invention has at least the following beneficial effects compared with the prior art:

[0032] 1) The method of the present invention obtains urban location parameters, constructs a network energy function according to the constraints of the TSP problem, then initializes the Hopfield network, constructs a network dynamic equation, takes the solution obtained by running the neural network as the initial position of the particle swarm algorithm, takes the path length as the fitness function, and combines the improved particle swarm algorithm and the dynamic step neural network to solve the TSP problem, solving the current NP-hard problem where the solution space grows exponentially with the increase of the problem scale. When the problem scale is small, some algorithms can solve the problem well to a certain extent. However, when the problem scale continues to increase, due to the fact that the manufacturing process of the hardware core has reached a bottleneck at the present stage, it is difficult to improve the performance by manufacturing a single core.

[0033] 2) By using the method of combining the Hopfield neural network and the particle swarm algorithm, taking the path sequence obtained after running the Hopfield network as the initial position of the particle swarm algorithm, taking the sequence path length as the particle swarm fitness function, and then performing the iteration of the particle swarm. Compared with using only the Hopfield neural network to solve the TSP problem, this method is conducive to jumping out of the local optimum and obtaining the global optimum solution with a greater probability.

[0034] 3) The present invention improves the Hopfield neural network by replacing the fixed step with a dynamic step, performing large-step optimization in the early stage and precise convergence in the later stage.

[0035] 4) The present invention improves the particle swarm algorithm by using a chaotic random inertia weight, effectively improving the convergence speed and convergence accuracy compared with the ordinary particle swarm algorithm, thereby enhancing the algorithm performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic flow chart of the method for processing the TSP problem based on the improved particle swarm algorithm and the dynamic step neural network in the embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0037] The particle swarm optimization algorithm (PSO) is a stochastic optimization algorithm. The PSO algorithm regards each solution as a particle. Through iteration, each particle updates the search speed according to the individual extreme value and the currently searched global extreme value to adjust the particle position. This algorithm evaluates the quality of the solution through the fitness function. This algorithm has the characteristics of simple structure, fast convergence, high efficiency, etc., but there is also the problem of falling into the local optimum.

[0038] The method for processing the TSP problem based on the improved particle swarm algorithm and the dynamic step-size neural network provided by the embodiments of the present invention solves the current NP-hard problem where the solution space grows exponentially with the increase of the problem scale. When the problem scale is small, some algorithms can solve the problem well to a certain extent. However, when the problem scale continues to increase, due to the fact that the manufacturing process of the hardware core has reached a bottleneck at the present stage, it is difficult to improve the performance by manufacturing a single core.

[0039] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work shall fall within the scope of protection of the present invention.

[0040] In the method for processing the TSP problem based on the improved particle swarm algorithm and the dynamic step-size neural network provided by the present invention, the specific improvement process of the improved particle swarm algorithm includes:

[0041] 1) Take the solution obtained by running the Hopfield network to the stable state as the initial position of the particle swarm algorithm, calculate the fitness function, and obtain the individual extreme value p of the particle besti , and the current global extreme value g besti .

[0042] 2) To improve the algorithm performance, find a suitable inertia weight. Since the chaos mapping has strong randomness and high ergodicity, the inertia weight of the particle swarm algorithm is changed from linear decrease to chaotic random inertia weight w:

[0043] z = z * μ * (1 - z)

[0044] w = 0.5 * rand + 0.5 * z

[0045] where the value of z is between (0, 1) and not equal to 0, 0.25, 0.5, 1. Compared with the linear decrease strategy, it can avoid the problems of lack of local search ability in the early stage of iteration and lack of global search ability in the later stage of iteration, because this improvement combines the random strategy and the decrease strategy, improving the performance of these two strategies. Compared with the ordinary particle swarm optimization algorithm, the chaotic random inertia weight particle swarm optimization algorithm has a significant improvement in the convergence speed and global convergence.

[0046] 3) Update the velocity v i and position x i of the particle according to the following formula:

[0047] v i = v i w i + c1 ×r1(p besti -x i )+c 2 ×r2(g besti -x i )

[0048] x i =x i +v i

[0049] Evaluate the fitness function value of each particle. If the current position fitness value of a certain particle is less than the individual extreme value p besti , then update the individual extreme value p besti of the particle to the current position of the particle; if the individual extreme value p besti of the particle is less than the global extreme value g besti after the update, then assign the position of the particle to the global extreme value g besti .

[0050] As Figure 1 shown, a specific application scenario is described below. The method for processing the TSP problem based on the improved particle swarm algorithm and the dynamic step-size neural network provided by the embodiments of the present invention includes:

[0051] Step 1: For the TSP problem, obtain the city position parameters, including: city coordinates and distances between cities.

[0052] Step 2: According to the TSP problem constraints, construct a network energy function:

[0053]

[0054] In the formula, E is the network energy, A and D are important parameters for measuring network constraints and the target optimal solution. The larger the value of A, the more the network focuses on the effectiveness of the solution and tries to avoid invalid solutions; the larger the value of D, the more it can be explained that the network focuses on solving the objective function, that is, the shortest path. If the value of D is greater than A, the network will often produce invalid solutions. The order of traversing cities is represented by a transposition matrix, so V xi is the state of the neuron in the x-th row and the i-th column of the transposition matrix, V y,i+1 is the state of the neuron in the y-th row and the (i + 1)-th column, x is the city number, y is the city number, and n is the number of cities.

[0055] Step 3: Initialize the Hopfield network U xi :

[0056]

[0057] In the formula, initialize the neuron output U 0 to take the value of 0.1, δuxi is a random number in the interval (-1, +1).

[0058] Step 4: Construct the network dynamic equation:

[0059]

[0060] In the formula, A and D are important parameters for measuring network constraints and the optimal solution of the objective, and d xy is the distance from city x to city y. V yi is the state of the neuron in the y-th row and i-th column in the transposition matrix.

[0061] Step 5: Calculate U(t + 1) according to the first-order Euler formula and convert it to V(t): Since Hopfield is a recursive neural network, the net input U(t + 1) of the network depends on U(t) in the previous time period; V(t) is the output state of the neuron obtained by the transfer function from the net input U(t).

[0062]

[0063]

[0064]

[0065] In the formula, step0 is a constant, r and a are parameters, L is the total number of iterations, and t is the current number of iterations.

[0066] Step 6: Determine whether the network has reached stability (reached the specified number of iterations or the energy function remains unchanged). If so, proceed to the next step; otherwise, return to Step 4.

[0067] Step 7: Take the solution obtained from the operation of the neural network as the initial position of the particle swarm algorithm, and take the path length as the fitness function.

[0068] Step 8: Calculate the chaotic random inertia weight w, and update the particle velocity v and position x.

[0069] In this step, the chaotic random inertia weight is:

[0070] z = z * μ * (1 - z)

[0071] w = 0.5 * rand + 0.5 * z

[0072] In the formula, it is specified that μ = 0.4, z takes a number between (0, 1) and not equal to 0, 0.25, 0.5, 1. rand is a random number between (0, 1).

[0073] The update of the particle velocity v and position x is as follows:

[0074] vi = v i w i + c 1 × r1(p besti - x i ) + c 2 × r2(g besti - x i )

[0075] x i = x i + v i

[0076] Wherein, w i is the inertia weight, c 1 , c 2 are learning factors. When c 1 is larger, the particles will stay in the local search range too much. When c 2 is larger, it will cause the particles to converge prematurely. p besti is the optimal position found by the current particle, g besti is the optimal position found by the current population. r1 and r2 are random numbers in the interval (0, 1).

[0077] Step Nine: Update the individual extreme value p besti and the global extreme value g besti , and calculate the fitness function. Determine whether the termination condition is reached. If it is reached, output the optimal solution, and the current optimal solution is the optimal solution of the TSP problem to be solved; otherwise, return to Step Eight.

[0078] The termination condition is: Evaluate the fitness function value of each particle. If the current position fitness value of a certain particle is less than the individual extreme value p besti , then update the individual extreme value p besti of the particle to the current position of the particle; if the individual extreme value p besti of the particle is less than the global extreme value g besti after the update, then assign the position of the particle to the global extreme value g besti .

[0079] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. Method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network, characterized in that, comprising: For the TSP problem, obtain the city location parameters; According to the TSP problem constraints, construct the network energy function of the Hopfield network and initialize the Hopfield network; Construct the network dynamic equation and solve it; Judge whether the constructed Hopfield network reaches stability. If it does, perform parameter optimization update based on the improved particle swarm optimization algorithm. Otherwise, reconstruct the network dynamic equation; Judge whether the improved particle swarm optimization algorithm reaches the termination condition. If it does, take the optimal solution obtained by the improved particle swarm optimization algorithm as the optimal solution of the solved TSP problem; Among them, the specific content of parameter optimization update based on the improved particle swarm optimization algorithm is: Take the solution obtained by the neural network operation as the initial position of the particle swarm algorithm, take the path length as the fitness function, calculate the chaotic random inertia weight, and update the particle velocity and position; The expression of the chaotic random inertia weight w is: z = z * μ * (1 - z) w = 0.5 * rand + 0.5 * z In the formula, μ = 0.4, z is a number between (0, 1) and not 0, 0.25, 0.5, and 1, and rand is a random number between (0, 1).

2. The method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network according to claim 1, characterized in that, The city location parameters include city coordinates and distances between cities.

3. The method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network according to claim 1, characterized in that, The expression of the network energy function of the constructed Hopfield network is: where E is the network energy, A and D are parameters for measuring network constraints and the target optimal solution, respectively, V xi is the state of the neuron in the x-th row and i-th column of the transposition matrix, V y,i+1 is the state of the neuron in the y-th row and (i + 1)-th column, x is the city number, y is the city number, and n is the number of cities.

4. The method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network according to claim 3, characterized in that, The expression of the constructed network dynamic equation is: Where U xi is the Hopfield network after initialization, d xy is the distance from city x to city y, and V yi is the neuron state of the i-th column in the y-th row of the transposition matrix.

5. The method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network according to claim 1, characterized in that, Particle velocity v i and position x i The update expressions are as follows: v i = v i w i + c 1 × r1(p besti - x i ) + c 2 × r2(g besti - x i ) x i = x i + v i where w i is the inertia weight, c 1 , c 2 are the learning factors, p besti is the optimal position found by the current particle, g besti is the optimal position found by the current population, and r1 and r2 are random numbers in the range (0, 1).

6. The method for processing TSP problem based on improved particle swarm optimization algorithm and dynamic step neural network according to claim 1, characterized in that, To determine whether the improved particle swarm optimization algorithm reaches the termination condition, it is necessary to judge the fitness function value of each particle. If the fitness value of the current position of a certain particle is less than the individual extreme value p besti , then update the individual extreme value p besti of the particle to the current position of the particle; if the individual extreme value p besti of the particle after the update is less than the global extreme value g besti , then assign the position of the particle to the global extreme value g besti .