# Bayesian Compressive Sensing Based Optimized Node Selection Scheme in Underwater Sensor Networks
## 3 Optimized Node Selection Scheme
### Scheme for Prolonging the Network Lifetime  
The network collects the information by putting the sensor nodes under the water. According to the feature of underwater environment, the channel differences of the sensor nodes are large. For example, the node with weak channel condition needs to take more power to transmit the signal so that the sink node can obtain the complete signal. However, the energy of each node is fixed. If there is a node with no energy prematurely, the sensor nodes' network will be invalid. This leads to a serious waste of resources. Therefore, it is significant to provide a new node selection scheme for prolonging the lifetime of the sensor network. Assume that the initial energy of each sensor node is \(E_{0}\). Let \(E_{ij}\) denote the \(i\)th sensor node's energy in \(j\)th selection. Then, let \(P_{ij}=\frac{E_{ij}}{\sum_{i=1}^{N}E_{ij}}\) denote the proportion of the \(i\)th sensor node's energy with the total energy in \(j\)th selection. The scheme aims at selecting the sensor nodes that hold more energy. Therefore, the optimization problem with the energy constraint condition in \(j\)th selection can be rewritten as follows:\[\begin{split}\min_{\tilde{\mathbf{\Phi}},\mathbf{\Omega}}& \text{\emph{Trace}}(\mathbf{\Omega}),\\ \text{s.t.}&\left(\begin{array}{cc}\sigma^{-2}\mathbf{ \Psi}^{T}\tilde{\mathbf{\Phi}}\mathbf{\Psi}+\mathbf{\Lambda}&\mathbf{\mathrm{I}}_{N}\\ \mathbf{\mathrm{I}}_{N}&\mathbf{\mathrm{Q}}\end{array}\right)\succeq 0,\\ &\text{\emph{Trace}}(\tilde{\mathbf{\Phi}}\mathbf{\mathrm{P}}_{j})\succeq C,\\ &0\leq\tilde{\Phi}_{ii}\leq 1,i=1,2,\cdots,N,\\ &\text{\emph{Trace}}(\tilde{\mathbf{\Phi}})=M,\end{split} \tag{22}\]  
where \(\mathbf{\mathrm{P}}_{j}=diag(P_{1j},P_{2j},\ldots,P_{Nj})^{T}\) and \(C\) is a constant threshold. From the energy constraint condition, it can be seen that the sensor nodes with less energy are selected by a small probability. If the sensor nodes with less energy are selected, it is possible that the energy constraint condition is not satisfied because the proportion values are small. For the final solution matrix, the \(M\) sensor nodes corresponding to the largest values of diagonal element in the solution matrix are chosen. The detail can be found in Algorithm 2.  
```
1:Initialize the number of selected nodes \(M\), threshold \(C\), the number of selection as \(j=0\), and \(\mathbf{\mathrm{P}}_{0}\).
2:while The residual energy of each node is non-negative. do
3:\(j=j+1\).
4: Solve the optimization problem (22) by using CVX tool cabinet in matlab.
5: The \(M\) sensor nodes corresponding to the largest values of diagonal element in the solution matrix \(\mathbf{\Phi}\) are chosen for data transmission.
6: The signal is reconstructed by using Algorithm 1 or orthogonal matching pursuit (OMP) algorithm.
7: Calculate \(\mathbf{\mathrm{P}}_{j}\) according to the optimized solution matrix \(\mathbf{\Phi}\).
8:endwhile
9:Output the number of selection \(j\) and \(\mathbf{\mathrm{P}}_{j}\).
```  
**Algorithm 2** Optimized node selection algorithm based on convex relaxation.