## 4 Algorithm Implementation
### Initialization  
As illustrated in Figure 2, the first step of the algorithm is to initialize the relevant system parameters. This includes randomly generating an initial population and computing the values of the three objective functions as well as the constraints. Additionally, the weight vectors are initialized according to the requirements of the MOEA/D algorithm. Most of the initialization tasks and the calculations of the objective functions and constraints can be directly performed using the functions defined in the model. However, two critical  
Figure 2: Algorithm flowchart (“Number of iterations” refers to the maximum number of iterations allowed in our simulation process). aspects warrant emphasis: the first is initial population generation, and the second is the calculation of the third objective function. The generation of the initial population must adhere to the constraint conditions, specifically ensuring that for each time step \(t\), there are exactly \(n\) elements with a value of \(1\), while the remaining elements are set to \(0\), as stipulated by Constraint 1. To achieve the goal of minimizing the transfer time (i.e., Objective 3), two techniques are employed. The diagonal elements of the original distance matrix \(D\) are set to positive infinity (inf). This ensures that during the transfer process, the patrol unit does not select the current street for the next time step, thereby preventing stationary patrols and promoting the continuous movement of police forces. This design aligns with the requirements of Constraint 2. The second technique employs the Munkres algorithm (also known as the Hungarian algorithm [40]), a classical method for solving assignment problems. Its primary objective is to identify the optimal task allocation scheme within a given cost matrix, minimizing the total cost. The core principle of the algorithm involves row reduction, column reduction, and matrix adjustment to iteratively determine the optimal matching. Renowned for its efficiency and precision, the Munkres algorithm is particularly well-suited for scenarios requiring a globally optimal solution. In the context of the transfer process, multiple patrol units need to select the nearest streets to patrol based on their current locations. To illustrate this, consider Figure 3: assuming initialization has resulted in the selection of four streets out of ten for patrol over three time steps, the assignment of different units to distinct routes between adjacent time steps to achieve the shortest global distance constitutes a classic matching problem. The Munkres algorithm is instrumental in resolving this issue, ensuring an optimal assignment of patrol routes across time steps. The process begins by extracting submatrices from the initial distance matrix based on the streets selected in adjacent time steps. For instance, using the streets selected at \(t=1\) and \(t=2\), the corresponding distance submatrix is derived, as presented in Table 1.  
Next, the submatrix undergoes a row reduction step according to the Munkres algorithm, where each row is subtracted by its minimum value, resulting in the transformed matrix shown in Table 2. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(t=1\backslash t=2\) & \(s_{4}\) & \(s_{5}\) & \(s_{6}\) & \(s_{7}\) \\ \hline \(s_{1}\) & 3000 & 4000 & 3000 & 6000 \\ \(s_{2}\) & 4000 & 3000 & 4000 & 5000 \\ \(s_{3}\) & 5000 & 4000 & 3000 & 4000 \\ \(s_{4}\) & Inf & 3000 & 2000 & 4000 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distance submatrix of the first two steps (data in the table are simulated). Figure 3: Schematic diagram of patrol street assignment. (At \(t=1\), streets \(s_{1}-s_{4}\) are selected for patrol; at \(t=2\), streets \(s_{4}-s_{7}\) are selected for patrol; at \(t=3\), streets \(s_{6}-s_{9}\) are selected for patrol).