# FL-SDUAN: A Fuzzy Logic-Based Routing Scheme for Software-Defined Underwater Acoustic Networks
## 4 Methodology  
### The Definition and Procedure of Fuzzy Logic  
Fuzzy logic is a decision-making system inspired by human perception and judgment capabilities. It is a simple technique for deriving uncertain or fuzzy information with less computational power. Let \(X\) be a traditional set. Given the fuzzy set \(FA\) that is composed of ordered numbers in \(X\), as shown in (2).  
\[FA=\{(x,\mu_{A}(x))|x\in X\} \tag{2}\]  
where \(\mu_{A}(x)\in[0,1]\) is the attribution function. It indicates the degree to which \(X\) is affiliated with \(FA\).  
Given a fuzzy number in the set \(R\) of real numbers. Let \(FA=(l,m,r)\), and the attribution function \(\mu_{A}\)[38] is shown in (3)  
\[\mu_{A}(x)=\begin{cases}\begin{array}{cc}0,&x<l\\ \frac{x-l}{m-l},&l\leq x\leq m\\ \frac{r-x}{r-m},&m\leq x\leq r\\ 0,&r>x\end{array}\end{cases} \tag{3}\]  
where \(FA\) is a set of triangular fuzzy number, and \(l\in R,\ m\in R,\ r\in R\). \(m\) is the principal value of the triangular fuzzy number. \(l\) and \(r\) are the lower and upper bound of \(FA\). The attribution function \(\mu_{A}(x)\) is shown in Figure 5.  
Fuzzy logic includes three steps of fuzzification, fuzzy inference, and defuzzification.  
\begin{table}
\begin{tabular}{l l l l l l l l} \hline \hline \multirow{2}{*}{**Records**} & \multicolumn{4}{c}{**Factors**} & \multicolumn{4}{c}{**Path Weights**} \\ \cline{2-9}  & \(\alpha\) & \(\beta\) & \(\gamma\) & \(\mathbf{CH_{i}}\) to \(\mathbf{CH_{5}}\) & \(\mathbf{CH_{i}}\) to \(\mathbf{CH_{7}}\) & \(\mathbf{CH_{i}}\) to \(\mathbf{CH_{12}}\) & **Optimal CH** \\ \hline Item 1 & 0.3 & 0.34 & 0.36 & 0.22 & 0.28 & 0.23 & CH5 \\ Item 2 & 0.4 & 0.3 & 0.3 & 0.21 & 0.28 & 0.24 & CH5 \\ Item 3 & 0.33 & 0.28 & 0.39 & 0.22 & 0.28 & 0.25 & CH5 \\ Item 4 & 0.39 & 0.47 & 0.14 & 0.21 & 0.29 & 0.21 & CH5 or CH12 \\ Item 5 & 0.21 & 0.41 & 0.37 & 0.23 & 0.28 & 0.22 & CH12 \\ Item 6 & 0.18 & 0.49 & 0.33 & 0.23 & 0.28 & 0.2 & CH12 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Path weights under different factors.  
Figure 5: The attribution function.  
The rules correspond to the inference relation \(R^{*}\), as shown in (5).  
\[R^{*}=\mathop{\cup}\limits_{i=1}^{n}\widetilde{R}_{i}=\mathop{\cup}\limits_{i=1}^ {n}\left(\widetilde{A}_{i}\times\widetilde{\widetilde{B}}_{i}\right) \tag{5}\]  
The inference rules are shown in Table 3, and the CH with optimal fitness is selected.  
(3) Defuzzification  
In fuzzy logic, the output is also a fuzzy set. Selecting a quantity to determine the fuzzy value is called defuzzification. Multiple eligible candidates are generated when fuzzy inference is completed, and the results are ranked using defuzzification. In this paper, the maximum affiliation method was used for fuzzification. The point corresponding to the foremost affiliation (\(\widetilde{R}\)) is selected as the output quantity, as shown in (6).  
\[R_{out}=\max\biggl{\{}\mathop{\cup}\limits_{i=1}^{n}\mu\left(\widetilde{R}_{i }\right)\biggr{\}} \tag{6}\]  
If the number of points is not unique, it is expressed as an arithmetic or geometric mean. Let \(R_{out}^{Gn}\) be the geometric mean and \(R_{out}^{An}\) the arithmetic mean, as shown in (7).  
\[\begin{array}{l}R_{out}^{An}=\max\biggl{\{}\mathop{\cup}\limits_{i=1}^{n} \mathop{\oplus}\limits_{i=1}^{n}\mu\left(\widetilde{R}_{i}\right)\biggr{\}}\\ \\ R_{out}^{Gn}=\max\left\{\mathop{\cup}\limits_{i=1}^{n}\sqrt[n]{\mathop{\oplus} \limits_{i=1}^{n}\mu\left(\widetilde{R}_{i_{i}}\right)}\right\}\end{array} \tag{7}\]