# An Adaptive Delay-Tolerant Routing Algorithm for Data Transmission in Opportunistic Social Networks
## Appendix A The Details of Curve-Trapezoid Mamdani Fuzzy Inference System
### The De-Blurring Component  
The proposed curve trapezoid Mamdani fuzzy inference system uses the maximum membership principle to compute the corresponding membership degree, which also can be expressed as the method of \"first OR then AND\" operation [13; 22]. However, fuzzy evaluation subsets can only be regarded as the primary classification of nodes in terms of reliability of data transmission, rather than the final decision assessment value. To this end, the De-Blurring component will be constructed to determine a precise classification value for node classification, judging whether the current node _node_, is a reliable next hop or not. In the classical fuzzy inference system, De-Blurring component could adopt a centroid method, average weighting approach, or maximum membership method. Because the independent variables with small changes in the centroid method will present large differences in the dependent variables, contributing to a relatively high classification accuracy, it could be adopted in the proposed fuzzy system. To provide the way of manual adjustment of parameters, we define \(W_{(w_{1},w_{2})}\) as the weight matrix for two-factor fuzzy input \(U_{f}=\left\{L^{re}_{(node_{i},AI)},L^{re}_{(node_{j},AI)}\right\}\), consisting of two different weight values \(w_{1}\) and \(w_{2}\) for \(L^{re}_{(node_{i},AI)}\) and \(L^{re}_{(node_{j},AI)}\), therefore the fuzzy relationship matrix \(Mr\) can be defined as:  
\[Mr=\left[ \begin{array}{cc}\mu_{\widetilde{A}_{low}}\Big{(}x_{1}^{node_{i}} \Big{)}&\mu_{\widetilde{A}_{medium}}\Big{(}x_{1}^{node_{i}}\Big{)}&\mu_{ \widetilde{A}_{high}}\Big{(}x_{1}^{node_{i}}\Big{)}\\ \mu_{\widetilde{A}_{low}}\Big{(}x_{2}^{node_{i}}\Big{)}&\mu_{\widetilde{A}_{ medium}}\Big{(}x_{2}^{node_{i}}\Big{)}&\mu_{\widetilde{A}_{high}}\Big{(}x_{2}^{node_{i}} \Big{)}\end{array} \right] \tag{12}\]  
Combined with the weight adjustment matrix \(W_{(w_{1},w_{2})}\), the fuzzy transformation from factor set \(U_{f}=\left\{x_{j}^{node_{i}}\right\}\) to evaluation set \(F(U_{f})\) can be defined as:  
\[ \begin{array}{ll}FT^{node_{i}}&=W_{(w_{1},w_{2})}\circ M_{r}\\ &=(w_{1},w_{2})\circ\left[\begin{array}{cc}\mu_{\widetilde{A}_{low}}\Big{(}x _{1}^{node_{i}}\Big{)}&\mu_{\widetilde{A}_{medium}}\Big{(}x_{1}^{node_{i}} \Big{)}&\mu_{\widetilde{A}_{high}}\Big{(}x_{1}^{node_{i}}\Big{)}\\ \mu_{\widetilde{A}_{low}}\Big{(}x_{2}^{node_{i}}\Big{)}&\mu_{\widetilde{A}_{ medium}}\Big{(}x_{2}^{node_{i}}\Big{)}&\mu_{\widetilde{A}_{high}}\Big{(}x_{2}^{node_{i}} \Big{)}\end{array}\right]\\ &=(fc_{low}^{x^{node_{i}}},fc_{medium}^{x^{node_{i}}},fc_{high}^{x^{node_{i }}})\end{array}  \tag{13}\]  
where \(fc_{low}^{x^{node_{i}}},fc_{medium}^{x^{node_{i}}},fc_{high}^{x^{node_{i}}}\) represent different levels of single fuzzy control result of two-factor fuzzy input for low, medium, and high levels of fuzzy subset, respectively. After normalization, these three levels of single fuzzy control result can be formalized as:  
\[ \begin{array}{ll}FT^{node_{i}}&=(fc_{low}^{x^{node_{i}}},fc_{medium}^{x^{ node_{i}}},fc_{high}^{x^{node_{i}}})\\ &=(\frac{fc_{low}}{f_{low}^{x^{node_{i}}}+fc_{medium}^{x^{node_{i}}}+fc_{high}^ {x^{node_{i}}}},\frac{fc_{medium}^{x^{node_{i}}}}{fc_{low}^{x^{node_{i}}}+fc_ {medium}^{x^{node_{i}}}+fc_{high}^{x^{node_{i}}}},\frac{fc_{high}^{x^{node_{i}}} }{fc_{low}^{x^{node_{i}}}+fc_{medium}^{x^{node_{i}}}+fc_{high}^{x^{node_{i}}}}) \end{array}  \tag{14}\]  
According to the maximum membership principle, the final fuzzy control result \(FC^{node_{i}}\) is the maximum of three single membership control values after the first \"OR\" then \"AND\" operation, and this process can be expressed as the union of \(fc_{low}^{x^{node_{i}}},fc_{medium}^{x^{node_{i}}},fc_{high}^{x^{node_{i}}}\), which is shown as:  
\[FC^{node_{i}}=\left\{fc_{low}^{x^{node_{i}}}\lor fc_{medium}^{x^{node_{i}}} \lor fc_{high}^{x^{node_{i}}}\right\} \tag{15}\]  
To effectively distinguish the impact of two-factor fuzzy input on data transmission, we adopt the centroid method to evaluation the final fuzzy control result.