## 5 Optimization Design of Degree Distributions for Proposed Enhanced Distributed Fountain Codes
### Optimization of the Sources  
Similar to the analysis of degree distribution and asymptotic performance, the optimization of the sources will be discussed in the following two cases.  
* Case 1: When \(1\leq i\leq n-t\), the source \(S_{i}\) is connected to relay \(R_{1}\) only. For source \(S_{i}\), the objective of the optimization is to achieve the desired decoding failure probability\(\delta\) while minimizing the overall overhead \(1+\varepsilon\). By substituting (9) into (1), we can obtain the code overhead as follows \[1+\varepsilon=\frac{n\alpha_{i}k_{i}}{\Phi^{\prime}{}_{i}(1)\Gamma^{\prime}{}_{1} (1)\sum\limits_{j=1}^{n}k_{j}}\] (19) which can be used as the objective function. By substituting (4) into \(y_{i,l}\leq y_{i,l-1}\), we can obtain \[\alpha_{i}\phi_{i}(1-y_{i,l-1})\gamma_{1}\Bigg{(}\frac{1}{n}\sum\limits_{j=1}^ {n}\Phi_{j}\Big{(}1-y_{j,l-1}\Big{)}\Bigg{)}\geq-\ln(y_{i,l-1})\] (20) The inequality in (20) must be satisfied on all equidistant points \(\{z_{i,1},z_{i,2},\ldots,z_{i,m}\}\), that is \[\phi_{i}\big{(}z_{i,p}\big{)}\gamma_{1}\Bigg{(}\frac{1}{n}\sum\limits_{j=1}^{n }\Phi_{j}\big{(}z_{j,p}\big{)}\Bigg{)}\geq\frac{-\ln(1-z_{i,p})}{\alpha_{i}}, \;\;p=1,2,\ldots,m\] (21) The optimization equation of source \(S_{i}(1\leq i\leq n-t)\) can be expressed as follows \[\min\limits_{\[PERSON]_{i}}\frac{n\alpha_{i}k_{i}}{\[PERSON]^{\prime}{}_{i }(1)\[PERSON]^{\prime}{}_{1}(1)\sum\limits_{j=1}^{n}k_{j}}\] (22) \[\text{s.t.}\left\{\begin{aligned} -\frac{\[PERSON]^{\prime}{}_{i} \big{(}z_{i,p}\big{)}}{\[PERSON]^{\prime}{}_{i}(1)}\gamma_{1}\Bigg{(}\frac{1}{n} \sum\limits_{j=1}^{n}\Phi_{j}\big{(}z_{j,p}\big{)}\Bigg{)}-\frac{\ln\big{(}1-z_ {i,p}\big{)}}{\alpha_{i}}\leq 0,\;\;p=1,2,\ldots,m\\ \sum\limits_{d=1}^{k_{i}}\Phi_{i,d}=1\\ 0\leq\Phi_{i,d}\leq 1,\;d=1,2,\ldots,k_{i}\end{aligned}\right.\]
* Case 2: When \(n-t+1\leq i\leq n\), the source \(S_{i}\) is connected to relay \(R_{1}\) and \(R_{2}\) simultaneously. Similar to the analysis of Case 1, the optimization equation of source \(S_{i}(n-t+1\leq i\leq n)\) can be expressed as follows \[\min\limits_{\Phi_{i}}\frac{2\alpha_{i}k_{i}}{\Phi^{\prime}{}_{i}(1)\big{(} \frac{1}{n}\Gamma^{\prime}{}_{1}(1)+\Gamma^{\prime}{}_{2}(1)\big{)}\sum \limits_{j=1}^{n}k_{j}}\] (23) \[\text{s.t.}\left\{\begin{aligned} -\frac{\Phi^{\prime}{}_{i} \big{(}z_{i,p}\big{)}\bigg{(}\frac{1}{n}\Gamma^{\prime}{}_{1}\bigg{(}\frac{1}{ n}\sum\limits_{j=1}^{n}\[PERSON]_{j}\big{(}z_{j,p}\big{)}\bigg{)}+\frac{1}{n}\Gamma^{ \prime}{}_{2}\bigg{(}\frac{1}{n}\sum\limits_{j=-t+1}^{n}\[PERSON]_{j}\big{(}z_{j,p} \big{)}\bigg{)}}{\Phi^{\prime}{}_{i}(1)\big{(}\frac{1}{n}\Gamma^{\prime}{}_{1 }(1)+\frac{1}{n}\Gamma^{\prime}{}_{2}(1)\big{)}}-\frac{\ln\big{(}1-z_{i,p} \big{)}}{\alpha_{i}}\leq 0,p=1,2,\ldots,m\\ 0\leq\Phi_{i,d}\leq 1,d=1,2,\ldots,k_{i}\end{aligned}\right.\] ### Joint Iterative Optimization of Degree Distributions  
The above optimization of sources and relays can be performed in a joint and iterative way. The detailed joint iterative optimization process is as follows:  
1. Choose a robust soliton distribution \(\text{RSD}(k_{i},c_{i},v_{i})\) as the initial value of degree distribution \(\Phi_{i}(x_{i})\) of source \(S_{i}\);
2. Fix the degree distribution of each source, and optimize degree distributions \(\Gamma_{1}(x)\) and \(\Gamma_{2}(x)\) of the relays with (18);
3. Fix the degree distributions \(\Gamma_{1}(x)\) and \(\Gamma_{2}(x)\) obtained from step 2, then optimize degree distribution \(\Phi_{i}(x_{i})\) of source \(S_{i}(1\leq i\leq n-t)\) with (22) and optimize degree distribution \(\Phi_{i}(x_{i})\) of source \(S_{i}(n-t+1\leq i\leq n)\) with (23);
4. Repeat steps 2 and 3 until the degree distributions meet the specified requirements.