## 5 The Proposed Protocol
### PDFH and SDFH Selection Utilizing the MPA
#### 5.2.3 Optimizing Data Fusion Regrouping (PDFH Reselection) Procedure
The numerator of Equation (33), which is carefully chosen to make certain that the smallest value is the ideal one, provides this assurance. (2) In the upstream direction, the CPDFR should have the greatest RE among all PDFHs; to maintain this, the average RE of all CPDFRs is divided by the RE of CPDFR \(j\). (3) \(ASBO_{CPDFRs[j]}\) is also considered based on Tables 4-7, Figure 8, and Equation (23). This leads to the proposal of an innovative RDFCF, whereby each PDFH chooses SR with the second-lowest RDFCF and PDFR with the lowest. Until the data reaches the sink node, the process is then repeated. For this reason, the RDFCF of a CPDFR \(j\) (\(RDFCF\)\([j]\)) is estimated as follows:  
\[RDFCF[j]=\left(\frac{do}{D_{PDFH_{i}\to CPDFRs[j]}}\right)+\left(\frac{Avg \Big{(}RE_{CPDFRs[K]}\Big{)}}{RE_{CPDFRs[j]}}\right)+\left(\frac{Avg\Big{(}ASBO _{CPDFRs[K]}\Big{)}}{ASBO_{CPDFRs[j]}}\right),\,j=0,1,2,\ldots,K-1, \tag{33}\]  
where \(D_{PDFH_{i}\to CPDFRs[j]}\) is the distance between CPDFRs[j] and \(PDFH_{i}\), each of which represents a distinct member of the CPDFRs array. Conversely, \(Avg(RE_{CPDFRs[K]})\) represents the average RE of all CPDFRs, and \(RE_{CPDFRs[j]}\) indicates the RE of CPDFRs[j]. By doing this, the multi-hop routing approach utilized in this work increases the effectiveness of communication in situations where there are considerable distances between PDFHs and the sink node, without using unnecessary energy during the communication process, thereby extending the lifetime of the network. Furthermore, the integration of data fusion plays a pivotal role in this context. Data fusion allows intermediate PDFRs to aggregate and synthesize incoming data from multiple sources, significantly reducing redundant transmissions. This process minimizes the amount of raw data forwarded to the sink node, conserving energy at each hop and reducing network congestion. As a result, the overall efficiency of the communication process improves, further extending the network's lifetime. Algorithm 4 provides a more thorough description of how the proposed protocol operates for scheduling, data transmission, and leveraging data fusion for optimized performance. ```
Input: In\(\mathcal{N}\), (Number of DFGMs in each DFG) In\(\mathcal{C}\) (Optimal number of DFGns) In\(\mathcal{D}\)PGFR [] (date of DFGMs for each DFG) In\(\mathcal{D}\)PGFR [] (date of DFGPs) In\(\mathcal{D}\)PGFR [] (date of DFGPs) In\(\mathcal{N}\) (Number of SNs in the network) Output: Out: TSs (Scheduling TDMA TS for each SN) Out: At\(\mathcal{A}\), \(\mathcal{A}\)h (Array index of the minimum RDCF and the second minimum one, respectively) Out: data packets (Total Number of transmitted data packets to the sink node) Main: For\(\mathcal{B}\)=1 to \(\mathcal{N}\)do  Switch node identifies the type of SNs (either PDFH or NDFGM)  Sink node assigns TDMA TSs based on the message arrival time and eq (30)  Sink node advertises the schedule (TDMA TSs) \(\rightarrow\) SNs End for For\(j\)=1 to \(\mathcal{C}\)do  For\(j\)=1 to \(\mathcal{N}\)do  If(DPGM[], type ==NDFGM' and it is in wakeup mode then  If(DPGM[]) sends its data packet \(\rightarrow\)PDFH []  Elseif(DFGM[], type ==PDFH' and it is turn for transmission then  Switch (type of the communication)  ifThe proposed protocol without routing (single hop communication)  Case 1:  PDFH [] aggregates the received data from DFGMS  PDFH [] sends the aggregated data directly --sink node; data_packets++;  End Case1  ifThe proposed protocol with multi-hop routing (multi-hop communication)  Case 2: If(Distance \(\mathrm{PCH}[j]\) - sink \(<d\)) then  Array CPDFR[0] // array of CPDFRs of size 0 (empty array)  PDFH [] aggregates the received data from DFGMS  PDFH [] sends the aggregated data directly --sink node; data_packets++;  Elseif  Count the number of CPDFRs--\(Q\)  Array CPDFR=[0] // array of CPDFRs of size \(Q\)  Temp++=\(\alpha\)// the minimum RDCFF  Temp++ (the second minimum RDCF  For\(j\)=0 to \(Q\)-1 do  Calculate HDFC[\(j\)] based on eq 27  If(DPFC[\(j\) < Temp.) Temp.)