## 5 The Geometric Distribution Algorithm for SF Assignment  
Reverting to the DER results run by the default ADR scheme, a significant challenge arose since more than 70% of all nodes from the uniform random and fixed patterns were assigned SF7 at 4 and 5 km. To significantly improve the DER, we needed to find the optimal SF distribution by redistributing the number of SF7 nodes using the PMF. Initially, we defined the probability of success \(p\) as the weight factor (\(w\)) for each SF. Then, we utilized the weight factor (\(w\)) to determine the number of SF nodes, as shown in Equations (16) and (17), respectively. \[N_{SF\text{ max}}=w_{1}N_{SF\text{ max}}+w_{2}N_{SF\text{ max}}+\dots+w_{6}N_{SF \text{ max}}, \tag{16}\]  
where \(N_{SF\text{ max}}\) is the total number of majority SF nodes--in our case, SF7 nodes. \(w_{n}\) is the weight factor of new SF7 (\(n=1\)) to new SF12 (\(n=6\)) and is defined as  
\[w_{n}=p(1-p)^{n-1}, \tag{17}\]  
where \(n=1\)-\(6\). Equation (16) is only valid when the summation of \(w_{1}\) to \(w_{6}\) is equal to 1--that is,  
\[\sum_{n=1}^{6}w_{n}=\sum_{n=1}^{6}p\Big{(}1-p)^{n-1}=1. \tag{18}\]  
However, due to variation in the \(p\)-value, Equation (18) is not always summed to 1. To address this, a weight correction factor, calculated as the inverse of Equation (17), was multiplied to the right term of Equation (16). The corrected weight factor is  
\[w_{n,\text{ corrected}}=\frac{w_{n}}{\sum_{n=1}^{6}w_{n}}. \tag{19}\]  
For the sake of simplicity, we refer to the corrected weight factor by the original variable \(w\) for the rest of the paper. The numbers of new SF7-SF12 are obtained by multiplying \(w_{1}\)-\(w_{6}\) in Equation (18) by \(N_{SF\text{ max}}\), respectively. The GD algorithm was developed next and is shown in Algorithm 1. First, we input the highest number of nodes with a similar SF value, which in our case is SF7, to the proposed GD algorithm. Then, SF7 nodes were separated using the GD approach. The process entered a loop starting at \(p=1\), and the corresponding weight factors \(w[x]\) were multiplied by the SF7 count (\(N_{SF\text{ max}}\)) to obtain the number of new SFs. The loop iterated  
Figure 5: The probability of success from the GD PMF. as the \(p\)-value decreased by 0.1 decrement. The weight factors were recalculated at each \(p\)-value and, thus, the number of new SFs was obtained. The loop continued until the \(p\)-value reached 0.1, marking the end of the algorithm. Note that, although the 0.1 decrement was carefully selected to observe the overall SF variation characteristic, we added the calculation of weight factors at \(p\)-value = 0.005 to finely observe the SF variation when the \(p\)-value approaches the zero limit. The resulting set of weight factors at the \(p\)-value equaling 1 to 0.005 is presented in Table 4.  
```
1:Input: Number of highest SF (\(N_{SF\ max}\))
2:Define: Weight factor (\(w\))
3:Geometric distribution factor (\(p\))
4:Initialize:\(p=1\)
5:Do
6:// Calculate the weight factor of each SF
7:\(w[x]\gets p\times(1-p)^{\alpha}(x-1)\) let \(x\) = 1, 2, 3, 4, 5, 6
8:// Calculate the number of each SF
9:SF[\(w\)] \(\leftarrow\)\(N_{SF\ max}\times w[x]\) let \(x\) = 1, 2, 3, 4, 5, 6 and \(y\) = 7, 8, 9, 10, 11, 12
10:// Return the new number of each SF
11:Return SF [7], SF [8], SF [5], SF [10], SF [11], SF [12]
12:\(p\gets p-0.1\)
13:While\(p>0.1\)//\(p\) starts at 1 to 0.1, with 0.1 decrement
```  
**Algorithm 1**Geometric distribution  
The complete implementation workflow is as shown in Figure 6. Initially, nodes were classified according to the sensitivity levels outlined in Figure 1. After applying the GD algorithm, the sets of weight-classified SF nodes were ingested into the simulation to determine Data Extraction Rate (DER) values for probabilities ranging from \(p=1\) to 0.1. Note that the DER is synonymous to the throughput in the sense that both terms refer to the amount of data successfully transferred from the source to its destination in a given timeframe.