## 4 Proposed Protocol
### Multi-Hop Routing Approaches
#### 4.3.3 Route Generation  
The basic process of the QA algorithm  
The limitation of the uncertain convergence time is overcome by optimizing the QA algorithm. The route generation process using the QA algorithm is described clearly in this section. 1. The BS collects the location information and the residual energy information of each CH. 2. We constructed a two-dimensional routing matrix \(L\) and a two-dimensional weight matrix \(\omega\) according to the number of CHs and energy consumption model. 3. In order to minimize the energy consumption in the communication process, the objective function is constructed by using two matrices. 4. We constructed constraint terms and combined them with the objective function to obtain the potential energy. 5. The kinetic energy of the construction is combined with the potential energy to obtain the Hamiltonian. 6. The routing planning scheme is obtained by solving the resulting Hamiltonian with the QA algorithm and repeating N times. Then, the scheme with the minimum energy consumption is taken as the current round scheme. 7. The energy consumption difference between the current and last rounds was compared. If the relative difference was within 5%, the scheme with more minor energy consumption was selected as the optimal scheme; otherwise, the next round of comparison was performed. 8. Construction of objective function and potential energy term  
The matrix \(L\) which represents the routing connection relationships of all CHs in the network is expressed in Equation (12):  
Figure 6: Two-dimensional stochastic Ising model. \[L= \begin{bmatrix}L_{1,1}&L_{1,2}&\cdots&L_{1,b}&\cdots&L_{1,C}&L_{1,BS}\\ L_{2,1}&L_{2,2}&\cdots&L_{2,b}&\cdots&L_{2,C}&L_{2,BS}\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots&\vdots\\ L_{a,1}&L_{a,2}&\cdots&L_{a,b}&\cdots&L_{u,C}&L_{a,BS}\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots&\vdots\\ L_{C,1}&L_{C,2}&\cdots&L_{C,b}&\cdots&L_{C,C}&L_{C,BS}\\ \end{bmatrix}  \tag{12}\]  
where \(C\) is the number of CHs. The CHs collect data and transmit them to the BS through multi-hop or single-hop routing, and the BS is the end of the data transmission. \(L_{u,b}=0\) means that there is no routing connection between nodes \(a\) and \(b\); \(L_{a,b}=1\) means that there is a routing connection between nodes \(a\) and \(b\). At the same time, we use the energy consumption of single-bit data transmission as the connection weight and only consider the energy consumption of sending data from CHs to the BS when constructing the energy consumption weight matrix in this paper. The two-dimensional weight matrix \(\omega\) representing the routing energy consumption is as follows:  
\[\omega= \begin{bmatrix}\omega_{1,1}&\omega_{1,2}&\cdots&\omega_{1,b}&\cdots& \omega_{1,C}&\omega_{1,BS}\\ \omega_{2,1}&\omega_{2,2}&\cdots&\omega_{2,b}&\cdots&\omega_{2,C}&\omega_{2,BS }\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots&\vdots\\ \omega_{a,1}&\omega_{a,2}&\cdots&\omega_{a,b}&\cdots&\omega_{a,C}&\omega_{a,BS }\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots&\vdots\\ \omega_{C,1}&\omega_{C,2}&\cdots&\omega_{C,b}&\cdots&\omega_{C,C}&\omega_{C,BS }\\ \end{bmatrix}  \tag{13}\]  
So we obtain the objective function \(f_{route}\) in Equation (14), and our optimization objective is to obtain the minimum value of \(f_{route}\),  
\[f_{route}=\sum_{(a,b)}L_{a,b}*\omega_{a,b} \tag{14}\]  
\(L_{a,b}\) represents the routing connection state, corresponding to \(a_{i}\in\{+1,-1\}\) in the Ising model. In order to prevent the possible matrix \(L\) from being in an arrangement that is not in line with the actual situation, we set the constraint term \(P\). Since the communication between nodes is bidirectional, it is an equal-probability event that node \(a\) transmits data to node \(b\) and node \(b\) transmits data to the node \(a\), and the randomly generated routing connection easily causes loop breakage. Therefore, the concept of parent node and child node is used to eliminate the error situation.