# Multi-Source Cooperative Data Collection with a Mobile Sink for the Wireless Sensor Network
## 3 Directed Graphs and Distributed Low-Density Parity-Check Codes for Data Collection
### Cooperative Data Collection with Distributed LDPC Codes
#### 3.2.1 Distributed LDPC Codes for One-Round Collection  
For the cooperative data collection with the one-round model, each source node in the cooperative link acts sequentially when the sink node \(d\) approaches it. Generally, each source node only receives the information data from its prior node according to the cooperation graph \(D\) and combines the data with its own data to generate the parity check data. For the line-like cooperative data collection, the processing at source nodes consists of two phases. In the first phase, each source node \(s_{i}\) broadcasts its own information data frame \(m_{i}\) of \(K\) bits to its selected partner \(s_{j}\in R(s_{i})\) according to the directed graph \(D\) and the mobile sink node \(d\), when the sink approaches and awakes \(s_{i}\). The information data \(m_{i}\) may be encoded using a block code or directly transmitted without protection according to the inter-source channel quality. Without loss of generality, it is assumed that no channel coding is used during this phase in this paper. In the second phase, the selected partner \(s_{j}\in R(s_{i})\) combines its own data \(m_{j}\) with the correctly decoded data \(m_{i}\) from the node \(s_{i}\) to generate the parity-check data vector \(p_{j}\). Specifically, the vector \(p_{j}\) is calculated by  
\[p_{j}^{T}=A^{-1}(\Pi_{j,i}m_{i}^{T}+\Pi_{j,j}m_{j}^{T}), \tag{2}\]  
where \(\Pi_{j,i}\) denotes a \(K\times K\) randomly-permuted identity matrix and \(A\) is a \(K\times K\) bidiagonal matrix given by  
\[A=\left[ \begin{array}{ccccc}1&&&&\\ 1&1&&&\\ &1&1&&\\ &&&\ddots&\\ &&&1&1\end{array} \right]. \tag{3}\]  
The linear time encoding can be implemented at each source node in a distributed manner. The parity-check data vector \(p_{j},1\leq j\leq N\) is transmitted by the parter \(s_{j}\in R(s_{i})\) to the mobile sink node \(d\). Thus, the parity-check data vectors \(p_{1},p_{2},\ldots,p_{N}\) can be generated and forwarded sequentially  
Figure 5: Directed graph and cooperation matrices for the two-round cooperation model (**a**) directed graph; (**b**) cooperation matrices for two rounds. by all the cooperative source nodes \(s_{1},s_{2},\ldots,s_{N}\) in a distributed and sequential manner according to the cooperation graph \(D\). In this way, the mobile sink node \(d\) collects the data transmitted from all the sources in the set \(S=\{s_{1},s_{2},\ldots,s_{N}\}\) to form a whole codeword denoted as \(\mathbf{c}=[m,p]\), where \(m=[m_{1},m_{2},\ldots,m_{N}]\) and \(p=[p_{1},p_{2},\ldots,p_{N}]\). Let us analyze the codeword \(\mathbf{c}\) received at the destination. Define a matrix \(h_{j}=\left[h_{j,1},h_{j,2},\ldots,h_{j,N}\right]\), where \(h_{j,i}=\Pi_{j,i}\) if \(g_{j,i}^{1}=1\) in the cooperation matrix \(G_{1}\) as illustrated in Figure 4b and otherwise \(h_{j,i}=0_{K\times K}\). Thus, Equation (2) is transformed into  
\[p_{j}^{\mathrm{T}}=A^{-1}h_{j}m^{\mathrm{T}}. \tag{4}\]  
Define a sparse matrix  
\[h=\left[ \begin{array}{c|cccc}h_{1}&A&&&\\ h_{2}&&A&&\\ \vdots&&\ddots&\\ h_{N}&&&&&A\end{array} \right], \tag{5}\]  
satisfying  
\[Hc^{\mathrm{T}}=h\left[m,p\right]^{\mathrm{T}}=0^{\mathrm{T}}. \tag{6}\]  
Therefore, the whole codeword \(\mathbf{c}\) received at the mobile sink \(d\) from \(N\) cooperative sources during two phases is indeed a codeword of the LDPC code with \(h\) as the parity-check matrix and the matrix \(h\) can be easily derived from the cooperation matrix \(G_{1}\) according to Equation (5). Here, the code rate is \(1/2\) which stays constant for the variant \(N\) of cooperation graphs. Then, the iterative decoding can be performed at the sink node \(d\) to decode the distributed LDPC code and obtain the data of all the sources in \(S\). Moreover, the encoding and transmission are implemented by all the sources in the cooperative group \(S=\{s_{1},s_{2},\ldots,s_{N}\}\) in a distributed manner and thus the complexity of each source node is low. Thus, the line-like cooperative data collection in Figure 4 is quite different from the traditional multi-hop data transmission.