# Bilateral Matching Decision Model and Calculation of High-Speed Railway Train Crew Members
## 2 Problem Description and Modeling
### Construction of the Train Crew Matching Model
#### 2.2.3 Model Establishment
The one-to-many preference orders \(r_{ij}\) and \(s_{ij}\) are transformed into one-to-one preference orders \(\widetilde{r}_{ij}^{d}\) and \(\widetilde{s}_{ij}^{d}\), resulting in the following matrices:  
\[\widetilde{S}=\left[\widetilde{s}_{ij}^{d}\right]=\left[ \begin{array}{c}9\; 5\;8\;11\;2\;10\;4\;3\;12\;7\;1\;6\\ 9\;5\;8\;11\;2\;10\;4\;3\;12\;7\;1\;6\\ 9\;5\;8\;11\;2\;10\;4\;3\;12\;7\;1\;6\\ 8\;1\;2\;12\;9\;5\;6\;11\;3\;4\;10\;7\\ 8\;1\;2\;12\;9\;5\;6\;11\;3\;4\;10\;7\\ 8\;1\;2\;12\;9\;5\;6\;11\;3\;4\;10\;7\\ 12\;6\;7\;5\;1\;8\;11\;10\;4\;2\;9\;3\\ 12\;6\;7\;5\;1\;8\;11\;10\;4\;2\;9\;3\\ 12\;6\;7\;5\;1\;8\;11\;10\;4\;2\;9\;3\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ 12\;6\;3\;5\;9\;8\;1\;2\;4\;10\;7\;11\\ \end{array} \right]\qquad\qquad\qquad\qquad\qquad\widetilde{R}=\left[ \widetilde{r}_{ij}^{d}\right]=\left[ \begin{array}{c}4\;4\;4\;2\;2\;2\;1\;1\; 1\;3\;3\;3\\ 3\;3\;3\;4\;4\;4\;1\;1\;1\;2\;2\;2\\ 3\;3\;3\;3\;1\;1\;1\;2\;2\;2\;4\;4\;4\\ 4\;4\;4\;2\;2\;2\;3\;3\;3\;1\;1\;1\\ 4\;4\;4\;4\;1\;1\;1\;3\;3\;3\\ 4\;4\;4\;4\;1\;1\;1\;3\;3\;3\;2\;2\;2\\ 4\;4\;4\;4\;1\;1\;1\;3\;3\;3\;2\;2\;2\\ 4\;4\;4\;4\;1\;1\;1\;3\;3\;3\;2\;2\;2\;2\\ 4\;4\;4\;4\;3\;3\;3\;2\;2\;2\;1\;1\;1\\ 3\;3\;3\;4\;4\;4\;1\;1\;1\;2\;2\;2\\ 3\;3\;3\;4\;4\;4\;1\;1\;1\;2\;2\;2\\ 4\;4\;4\;2\;2\;2\;3\;3\;3\;1\;1\;1\\ \end{array} \right]\]  
The obtained results are shown in Table 4.  
That is, chief steward \(B_{1}\) is matched with stewards \(A_{2}\), \(A_{5}\), and \(A_{12}\); chief steward \(B_{2}\) is matched with stewards \(A_{3}\), \(A_{6}\), and \(A_{8}\); chief steward \(B_{3}\) is matched with stewards \(A_{4}\), \(A_{10}\), and \(A_{11}\); chief steward \(B_{4}\) is matched with stewards \(A_{1}\), \(A_{7}\), and \(A_{9}\). Simulations were conducted 10 times for each of the scenarios where the number of chief attendants is 20, 40, 60, and 80. In each simulation, the preference orders of stewards for chief attendants and of chief attendants for stewards were randomly generated by the computer. The average values of the computation results are shown in Table 5. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(\widetilde{u}=\{(B_{1},\{A_{5},A_{12},A_{2}\}),(B_{2},\{A_{3},A_{6},A_{8}\}), (B_{3},\{A_{4},A_{10},A_{11}\}),(B_{4},\{A_{1},A_{7},A_{9}\})\}\) & 0.20944 & 31.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: One-to-many matching between stewards and chief stewards. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \(B_{1}\) & \(B_{2}\) & \(B_{3}\) & \(B_{4}\) \\ \hline \(A_{1}\) & 4 & 2 & 1 & 3 \\ \(A_{2}\) & 3 & 4 & 1 & 2 \\ \(A_{3}\) & 3 & 1 & 2 & 4 \\ \(A_{4}\) & 4 & 2 & 3 & 1 \\ \(A_{5}\) & 4 & 2 & 3 & 1 \\ \(Based on the analysis of the above data, it can be concluded that the greater the number of chief stewards, the longer the average runtime. As the number of chief stewards increases from 20 to 80, the average runtime increases significantly. The larger the problem size, the higher the difficulty to solve it, and the growth of runtime is nonlinear. When the number of chief stewards increases from 20 to 40, the runtime increases from 1.5 to 15. When the number of chief stewards increases from 40 to 80, the runtime increases from 15 to 335.4, showing exponential growth. When the number of chief stewards reaches 90, using Gurobi to solve this problem results in a memory overflow. This indicates that while optimization solvers can be used to solve such problems when the computational scale is small, their limitations become apparent with larger computational scales. In existing research, heuristic algorithms are also widely applied in solving bilateral matching problems. For example, genetic algorithms [17; 19] have been repeatedly used to solve bilateral matching problems. Therefore, this paper designs a genetic algorithm to solve this problem to meet the needs of solving large-scale instances in practical work.