# A Multi-Parameter Comprehensive Optimized Algorithm for MPTCP Networks
## 3 MPCA Algorithm
Based on the result of Step 5, taking the input parameter set CC, _PM_, _TP*_ and _BS_ as input, a prediction model between buffer size _BS_ and throughput _TP_, which varies with CC and _PM_, can be established by using multiple regression analysis method through a scikit-learn tool [26]. The model shows like function \(f_{5}\), see Equation (8). When the most essential two criteria values of prediction model after \(N\) times run: once R-Squarer and \(p\)-value have reached the idea range (R-Square \(\geq\) 0.90 (interval [0, 1]) and \(p\)-value \(\leq\) 0.05), which means that this prediction model is a commonly accepted in statistical society. The detail of model construction can be seen in [4],  
\[ \begin{split} tp=\varphi\big{(}bs,pm,cc\big{)}_{\begin{subarray}{ c}\big{|}_{pm=PM_{i}}=f_{5}\big{(}bs\big{)}\big{|}_{(PM_{i},CC_{j})}\\ PM_{i}\in PM\big{(}i=1,2\big{)},CC_{j}\in CC\big{(}j=1,2,\cdots,6\big{)}\end{subarray} \end{split}  \tag{8}\]
7. Obtain the comprehensive optimized outputs. The final goal of this algorithm is to find the minimum buffer size _BS_ when maximizing the throughput _TP_, and determine the corresponding _PM_ and _CC_ accordingly,  
\[\left\{ \begin{array}{l}f_{5}|_{(PM_{i},CC_{j})}:BS\to TP\\ s.t.\ \ \ bs\in BS(BS=\{0.5,1.0,1.5,\cdots,30.0\}),tp\in TP,\\ \min_{bs}\Big{(}\operatorname*{argmax}\Big{(}f_{5}|_{(PM_{i},CC_{j})}\Big{)} \Big{)}\end{array} \right. \tag{9}\]  
However, when the throughput is maximum, the corresponding _BS_ is not the minimum. Therefore, we need to seek the minimum _BS_ in a certain range (e.g., \(1-\delta\)) of the maximum throughput, and obtain the minimum value of _BS_ by sacrificing \(\delta\) throughput, e.g., empirical value \(\delta\) = 7%, which can be mathematically described as follows:  
\[ \begin{split} obs_{i,j}=\min_{bs}\Big{\{}bs\in f_{5}^{-1}\Big{|} _{(PM_{i},CC_{j})}\Big{[}(1-\delta)\max f_{5}|_{(PM_{i},CC_{j})},\max f_{5}|_{ (PM_{i},CC_{j})}\Big{]}\subset BS\Big{\}}\end{split}  \tag{10}\]  
\[ \begin{split} OBS=\min_{i,j}\{obs_{i,j}\}\end{split}  \tag{11}\]  
Figure 3: Time sequence diagram of measuring impact factor of subpath. According to the corresponding \(i\) and \(j\), the corresponding output can be given as follows,  
\[ \begin{array}{l}OPM=PM_{i}\\ OCC=CC_{j}\\ OTP=f_{5}(OBS)\end{array}  \tag{12}\]  
Algorithm 1 shows the pseudo code. ```
Inputs:\(CC=\) {Cubic,OLIA,Hybla,Reno,Scalable,Vegas},
1:\(PM=\) {PCDC, FullMesh},

\(TOP=\) [Site Name, ISP, Bandwidth]
2:Outputs:\(OTP\), \(OBS\), \(OCC\), \(OPM\)
3:Initialize:\(BS=\) {0.5,1.0,1.5,... 30.0}, \(SP^{*}=\) {}, \(\delta=0.07\)
4:Start
5:Obtain \(SP\) from \(TOP\)
6:For \(cc\) in CC do
7:For \(pm\) in \(PM\) do
8:If \(pm\) is PCDC then
9:Calculate \(TP_{i}\) for each subflow \(sp_{i}\) in \(SP\), then obtain \(\Omega_{i}\)
10: \(\Omega_{i}=1-\frac{\sum_{j=1}^{2}TP_{i}(t)}{\sum_{i=0}^{2}Tb_{i}(t)}\)
11:If \(\Omega_{i}>0\) then
12:\(SP^{*}=SP^{*}+sp_{i}\)
13:End If
14:Else If \(pm\) is FullMesh then
15:\(SP^{*}=SP\)
16:End If
17:End For
18:Measure and obtain the throughput \(TP^{*}\)
19:Using sklearn.LinearRegression(\(BS\),\(PM\),\(TP^{*}\)), get the regression model
20:\(tp=f_{5}(bs)\)
21:Calculate the maximum \(tp_{cc}\) of \(TP\)
22:Calculate the minimum \(bs_{cc}\) in [(1-\(\delta\))\(tp_{cc}\), \(tp_{cc}\)] according to the inverse function \(f_{5}^{-1}\)
23:End For
24:\(bs_{\min}=\min(bs_{cc})\)
25:\(OBS=bs_{\min}\)
26:Making use of \(OBS\) and the function \(f_{5}\), obtain \(OTP\), \(OCC\) and \(OPM\)
27:Outputs:\(OTP\), \(OBS\), \(OCC\), \(OPM\)
```  
**Algorithm 1**MPCOA  
Note that MPCOA can control the usage of subflows for the transport of user data. Regardless of whether subflows are used or not, they are always established. That is, the resilience of plain MPTCP remains: as long as there is at least one working subflow in each direction, the connection does not break. If a subflow used for data transmission is detected as broken, the best currently unused subflow--according to its IF value--can be used.