# 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.2 Distributed LDPC Codes for Two-Round Collection  
In this model, the sink node \(d\) moves two rounds along the region of active sensor nodes in the set \(S\) and two different cooperative links of two rounds also play different roles in the data collection. During each round, each source node also acts sequentially when the sink node \(d\) approaches it according to its related cooperative link in the graph \(D\). The processing at the source nodes during the two rounds is described as follows, which is different from the one-round model above.  
In the first moving round, each source node \(s_{i}\) just broadcasts its own information data frame \(m_{i}\) with \(K\) bits to the mobile sink node \(d\) and the selected partner in the first round according to the directed graph \(D\). Each node just keeps the correctly decoded data from its partner and does not generate the parity check bits during the first round. For example, we assume that the node \(s_{j}\in S\) assists \(s_{i}\) during the first round, and thus the node \(s_{j}\) just stores the information data \(m_{i}\) received from the node \(s_{i}\) for the further encoding in next round.  
In the second moving round, each node generates and forwards the parity check bits using its own information data, the information data from its partner in the first round, and the parity-check data from its another partner in the second round. Taking the node \(s_{j}\) as an example, we assume that it assists \(s_{i}\) and  
where \(\Pi^{1}_{j,i}\), \(\Pi^{1}_{j,i}\), and \(\Pi^{2}_{j,k}\) are \(K\times K\) randomly-permuted identity matrices. Then, the parity check vector \(p_{j}\) can be transmitted to the mobile sink \(d\) by the node \(s_{j}\). Here, the generation and transmission of the parity check vectors \(p_{1},p_{2},\ldots,p_{N}\) are performed sequentially by the source nodes \(s_{1},s_{2},\ldots,s_{N}\) in a distributed and sequential manner. Indeed, for the encoding at each source node, we only need to sum all the permuted bits according to Equation (7). Therefore, the encoding complexity at each node is quite low. However, the disadvantage is the long storage time requirement including its own source data and the data from the partners during the two rounds.  
In this way, the sink node \(d\) combines the information data \(m=[m_{1},m_{2},\ldots,m_{N}]\) collected in the first round and the parity check data \(p=[p_{1},p_{2},\ldots,p_{N}]\) in the second round to form a whole codeword \(\mathbf{c}=[m,p]\), which is also a LDPC codeword. The iterative decoding can be performed for the sink node. Here, the code rate is \(r=1/2\), which is the same as the one-round model. The parity-check matrix \(h\) of the whole code can easily be obtained from the cooperative matrices \(G^{1}_{2}\) and \(G^{2}_{2}\) in Figure 5. In the following, we will simulate the performance of distributed LDPC codes with the expansion of the randomly-permuted identity matrix.