## 3 The PSOTSC Algorithm
### NARJ Particle Update Strategy  
In PSO, particle updating is driven by whether the quality of the current particle is close to the quality of the optimal particle. For a particle used to represent a compressed trajectory, the quality of the particle is its profile fitting degree with the original trajectory. The higher the fit, the better the quality of the particle. Therefore, the first problem to be solved is how to evolve a high-quality particle into a better one. A high-quality particle means that the selection of trajectory segmentation feature points is basically reasonable. It only needs to adjust the position of segmentation feature points a little to try to obtain a better solution on the original basis, while excessive or random adjustment of a reasonable segmentation solution may destroy the original balance. Will this fall into the dilemma of local search? What about low-quality particles? These are the next two problems to be solved. The segmentation solution represented by a low-quality particle is not reasonable and needs to be greatly adjusted to try new possibilities. Some segmentation feature points can be selected randomly in the solution and can jump to other positions randomly. Such changes can not only solve the problem of rapid disintegration and the updating of low-quality particles, but also ensure that the PSOTSC algorithm will not fall into local optimization. Thus, the basic consideration of NARJ particle update strategy is that the segment feature points of high-quality particles are adjusted in their neighborhood, and the probability of evolving into better particles will be larger than that of feature points randomly adjusted. Meanwhile, low-quality particles need to adjust the feature points randomly in a large range to get rid of the current state and try a new segmentation solution to improve the search efficiency. Algorithm 3 gives the \(NARJParUpdate\) of particle update strategy. ```
Input: A particle \(p\in ps\) and its fitness \(fp\)  A neighborhood adjustment span \(Sp\)  A number of adjusted feature points \(N_{a}\) Output: An evolved particle \(pe\)
01: Select \(N_{a}\) feature points;
02: Evaluate the quality of particle \(p\) with its fitness \(fp\);
03: if \(p\) is high-quality then /* Neighborhood Adjustment*/
04: Change the feature points in \(\pm Sp\) range;
05: else /* Random Jump */
06: Change the feature points randomly;
07: end if
08: Set the value of the new points to 1 and the old points to 0;
09: Replace the old particle \(p\) with the evolved one \(pe\);
```  
**Algorithm 3**\(NARJParUpdate\)  
The input of the algorithm is particle \(p\) and its fitness \(fp\), the neighborhood adjustment span \(Sp\) and the number of adjusted feature points \(N_{a}\). In the evolution process, whether it is neighborhood adjustment or random jump, the segment feature points that change the position are randomly selected (line 1), generally 1-2, so that the search efficiency will not be affected because of the strong randomness. High-quality particles adjust the neighborhood of segment feature points, while low-quality particles adjust the position of segment feature points randomly (line 2-7). The direction of feature point adjustment is random, which can be adjusted forward or backward. In neighborhood adjustment, each feature point is taken as the center, and the feature point position is changed within the range \(\pm Sp\) (line 4). The span \(Sp\) depends on the total length of the trajectory and the interval of the trajectory points. If the trajectory is long, the interval of the trajectory points is small or the number of points is large, it is necessary to increase the span appropriately to improve the search speed. However, if the interval of trajectory points is larger, and thenumber of trajectory points is less, the span should be reduced. The algorithm outputs the evolved particle \(pe\) and replaces the original particle \(p\).