## 2 System Model and Complexity Analysis
### Complexity Analysis for General Linear Block Codes and LDPC Codes  
In this section, we analyze the complexity of encoding and decoding at each node. The complexity is measured by the number of basic operations that one algorithm consumes to encode or decode a codeword. Decoding complexities of different algorithms are compared by calculating the number of basic operations an algorithm employs for decoding one codeword at a node. In some cases, we use the order of magnitude \(O(\cdot)\) complexity metric when considering the asymptotic behavior for large systems. Assume a linear block code. In our system, the encoding process is performed using a systematic generator matrix. For a \((N,K)\) systematic linear block code, the encoding process is equivalent to the multiplication of a \(1\times K\) information vector by a \(K\times N\) generator matrix. The total complexity of this operation is \(O(KN)\). However, in our system, the encoding process is performed by \(N\) nodes, and each node only calculates one bit of a codeword. The terminals transmit one information symbol to the other nodes, and there are no other calculations. For relay nodes, the CDD calculation (4) for one node involves a complex multiplication with complexity \(O(1)\). Consider the worst case, when the relevant group sizes associated with the relays approach the maximal value \(K\). In this case, each relay performs \(K\) CDDs and \(K-1\) binary additions of the \(K\) detected symbols. Therefore, the encoding complexity for relay nodes is \(O(K)\). Next, we analyze the number of different operations required at each terminal node with ML decoding and LDPC codes with log-BP decoding. Calculating the sign function or comparing two real numbers is regarded as one comparison operation. Looking up one number or value from a existing table is regarded as one table look-up operation. Multiplying a number by 1 or -1 is not considered as a multiplication in the following analysis. When using ML decoding with (14), two multiplications and one addition are needed to calculate one term in the summation; hence, \(2N\) multiplications and \(N+N-1=2N-1\) additions are required for the summation corresponding to one codeword. For a \((N,K)\) linear block code, there are a total of \(2^{K}\) possible codewords. Their value are pre-stored in a table; hence, there are a total of \(2^{K}\) table look-ups of codewords, \(2^{K+1}N\) multiplications, and \(2^{K}(2N-1)\) additions. Finally, finding the codeword that maximizes the summation in (14) requires \(2^{K}\) comparisons. We see the exponential dependency on \(K\) in the complexity results for ML decoding of general linear block codes, which poses a significant challenge for long codes of non-vanishing small rates. We now assume an LDPC code with average variable node degree distribution \(d_{v}\) and average check node distribution \(d_{c}\). The number of operations required at each step for binary LDPC codes with log-BP decoding is presented in Table 3, where \(I_{max}\) is the maximum number of iterations. The steps are divided based on the descriptions in [12]. The number of operations required for updating the variables \(L(q_{uv}(z))\) and \(L(r_{uv}(z))\) are analyzed in [51], and the results are summarized in Table 3. Calculating tentative LLRfor each symbol in \(x[k]\) is similar to updating \(L(q_{uv}(z))\), which involves \(Ld_{c}d_{v}\) additions. Then, making tentative decisions for each symbol requires \(N\) comparisons. Finally, \(\hat{\mathbf{x}}\cdot\mathbf{H}\) is calculated to determine whether to stop the iterations. This requires \(N(d_{c})\) multiplications, \(N(d_{c}-1)\) additions, and table look-ups of non-zero elements of \(\mathbf{H}\). To achieve a better error performance, \(I_{max}\) needs to be set to a relatively large value, resulting in a high decoding complexity. In Table 3, we notice the terms composed of four-factor multiplications involved in the number of additions required to update \(L(q_{uv}(z))\) and to calculate tentative LLRs.