## 4 The QACMOR Routing Method
### The QACMOR Algorithm  
The flowchart of the proposed approach is shown in Figure 4. The basic algorithm of QACMOR can be described as follows:  
**Step 1:** The initialization step. Add every node and its neighbor nodes into the routing table. A forward ant is generated from source nodes which carry the information of source nodes, sink nodes, and passing nodes. The population is represented as \(Q(t)=(q_{1}^{t},q_{2}^{t},\cdots,q_{j}^{t},\cdots,q_{m}^{t})\) with the size of \(m\) individuals, where \(q_{j}^{t}(j=1,2,\cdots,m)\) is the \(j^{th}\) individual in the \(t^{th}\) iteration. The representation is shown as:  
\[q_{j}^{t}=\left( \begin{array}{c|c}\alpha_{j1}^{t}\\ \beta_{j1}^{t}\end{array} \right|\cdots\left. \begin{array}{c|c}\alpha_{ji}^{t} \\ \beta_{ji}^{t}\end{array} \right|\cdots\left| \begin{array}{c}\alpha_{jn}^{t} \\ \alpha_{jn}^{t}\end{array} \right) \tag{19}\]  
where \(n\) is the number of qubits. Initialize \(\alpha_{ji}\), \(\beta_{ji}(i=1,2,\cdots,n)\) with \(1/\sqrt{2}\). The maximum iterations are represented as \(t_{max}\), and the initial value of the current iterations \(t\) is 0. **Step 2:** Compute the binary solution \(P(t)\). \(P(t)=(p_{1}^{t},p_{2}^{t},\cdots,p_{j}^{t},\cdots,p_{m}^{t})\), \(p_{j}^{t}(j=1,2,\cdots,m)\) is a binary individual with n-length. The probable solution is obtained by measurement of \(Q(t)\). The value of element \(p_{ji}\) in \(p_{j}\) is determined by comparing \(\alpha_{ji}\) of \(q_{j}\) with \(w\), 0 \(<w<1\). **Step 3:** Generate the routing path. Assign \(m\) individuals into the source nodes at random. We used the state transition rule to generate the routing path of these individuals. In each step of the decision, an individual positioned on node \(r\) moves to the node \(s\) in line with Equations (4)-(6). **Step 4:** Evaluate the solution and store the best solutions in \(B(t)\). The evaluation function of the routing tree is shown as follows:  
\[f(t)=\frac{1}{\left[Z_{1}(t)\right]^{C_{1}}\left[Z_{2}(t)\right]^{C_{2}}\left[ E_{r}(t)\right]^{C_{3}}\left[\sigma_{r}(t)\right]^{C_{4}}} \tag{20}\]  
\[Z_{1}(t)=\sum_{i=1}^{N}Kd_{ns^{\prime}}^{\lambda}(r,s)\in Tree(t) \tag{21}\]  
Figure 4: The process of the Quantum Ant Colony Multi-Objective Routing (QACMOR) approach. \[Z_{2}(t)=\text{max}Fd_{k}(t) \tag{22}\]  
\[F(t)=\text{max}f(n),(n=0,1,\ldots,t) \tag{23}\]  
where \(C_{1}\), \(C_{2}\), \(C_{3}\), and \(C_{4}\) are weight parameters, and \(E_{r}(t)\) and \(\sigma_{r}(t)\) are factors which describe the network load balance, and respectively represent the average value and standard deviation of the load for node \(r\). \(Z_{1}(t)\) is the energy consumption factor, \(K\) is an array which indicates the total number of leaf nodes extended from each node in the routing tree, \(\lambda\) is a parameter with a value from 2 to 4 which generally approaches 4, \(d_{rs}\) is the distance of link (\(r\),\(s\)), \(\textit{Tree}(t)\) denotes the routing tree, \(Z_{2}(t)\) is the time-delay factor, and \(Fd_{k}\) is the distance traveled by the forward ant \(k\). After the sink node receives forward ant packages, evaluate the solution by Equations (20)-(23), and then save in \(B(t)\). **Step 5:** Update the pheromone according to the rules of the quantum rotation gate, after receiving back the ant. **Step 6:** If the current iterations are less than the maximum iterations, return to Step 3. It should be noted that QACMOR is an evolutionary algorithm rather than a quantum algorithm, in spite of the fact that the proposed approach is based on quantum computing mechanisms. In QACMOR, some problems in basic ACO can be tackled. The representation of qubit introduces the probability research method, making the balance between exploration and exploitation easier than the conventional ACO algorithm, and adjustment of the magnitude of the rotation angle can make convergence speeds faster.