## 4 Proposed Algorithm
### PSO for Choosing Routing Paths
This layer-based initialization method can control the routing path's direction towards the sink node as well as avoid trapping into a dead cycle and accelerate iterative process. The priorities of the nodes in the farthest layer are initialized by randomly generating numbers between 0 to 1. In our layered model, the fourth layer is the farthest layer, so the priorities of the nodes in the fourth layer are set from 0 to 1, while the priorities of the nodes in the third layer are from 1 to 2. In one word, when the number of the layer decreases by 1, the initial priorities of the nodes increase by 1. Hence the priority is not initialized completely randomly but related to the layer the node belongs to. Figure 6 shows an example of our initialization. In this example, for the CH, there are altogether 12 candidate nodes dispersed in 4 different layers. It can be easily observed that the nodes in the higher layers have lower initialized priorities. That is how we achieve hierarchical initialization and obtain initialized multi-hop routing path from the CH to the sink node. Figure 5: The demo for mapping part \(a\) of sub-particle \(i\) into \(\mathbf{\Phi}\), where \(c_{j}\) denotes random measurement coefficient. **iii. Iteration**  
After initializing the particles, in each iteration, we are going to calculate particles' fitness values in terms of measurements matrices and select local best and global best ones. Then the particle positions are updated. We have already introduced how to map part \(a\) of the sub-particle \(i\) to the corresponding row. Here we introduce how we map part \(b\) of sub-particle \(i\) to the \(i\)-th row of the measurement matrix. Firstly we set the corresponding position of the \(i\)-th CH in the \(i\)-th row of \(\mathbf{\Phi}\) to a random Gaussian distributed coefficient. Then we find the next relay node by two steps iteratively until the complete routing path is found. Step 1: If the previous node's distance to the sink node is smaller than its transmission range \(R_{c}\), stop searching since we already obtain a single rout from the \(i\)-th CH to the sink node. Otherwise, we go to step 2. Step 2: Find all nodes that are not only in the candidate group but also within the previous node's transmission range, compare their priorities and find the largest one as the next relay node. Meanwhile, we set the corresponding position of chosen relay node in the \(i\)-th row of \(\mathbf{\Phi}\) to a random Gaussian distributed coefficient. After mapping \(M\) sub-particles to \(M\) rows, the measurement matrix \(\mathbf{\Phi}\) is determined. The generated \(\mathbf{\Phi}\) is then used to compute the fitness value of corresponding particle. The fitness function includes two main items, the measurement of reconstruction quality, \(B_{r}\), which is related to BCRB and the measurement of energy consumed, \(E_{s}\). As we calculated before, the formula of the BCRB is given by  
\[\text{BCRB}=\mathcal{T}\{(\frac{1}{\sigma^{2}}\mathbf{\Psi}^{T}\mathbf{\Phi}^{ T}\mathbf{\Phi}\mathbf{\Psi}+\hat{\mathbf{\Gamma}}^{-1})\}. \tag{23}\]  
As BCRB implies a theoretical lower bound of reconstruction's mean square error, we wish it to be as small as possible. So \(B_{r}=1/Tr\{(\frac{1}{\sigma^{2}}\mathbf{\Psi}^{T}\mathbf{\Phi}^{T}\mathbf{ \Phi}\mathbf{\Psi}+\mathbf{\Gamma}^{-1})\}\). The energy consumption of the routings we chose is measured by \(E_{s}\). It consists of three factors like  
\[E_{s}=1/E_{r}+E_{l}+E_{b}. \tag{24}\]  
The first item \(E_{r}=\sum_{k=1}^{N}\frac{E_{k}}{E_{res_{k}}}\), where \(E_{c_{k}}\) is the energy consumed at this round by node \(k\) and \(E_{res_{k}}\) is the rest energy of this node. It measures the energy cost ratio of nodes and should be small considering the durability of a network. Besides \(E_{r}\), \(E_{l}=\sum_{k=1}^{N}\frac{E_{res_{k}}}{E_{init_{k}}}\), where \(E_{init_{k}}\) is the initial energy of the \(k\)-th node. On top of that, the balance of this network also needs to be considered.