## 4 Client-Edge Pairing Based on Similarity and Heterogeneous Computing Capabilities  
A way to pair clients and edges based on model similarity is detailed in [15] without considering heterogeneity of clients. However, when there are significant differences in client computing capabilities, this method has drawbacks: although the paired clients under each edge maintain dissimilar data distributions, their computing capabilities may vary greatly. If a synchronous aggregation strategy is maintained, high-computing-capability clients wait for low-computing-capability clients, resulting in extremely long waiting times [16]. Therefore, this section proposes to consider heterogeneous computing capabilities in the pairing method, ensuring that the paired clients under each edge maintain dissimilar data distributions and similar computing capabilities. The specific improvement method is as follows. First, we construct a similarity matrix \(S\) and group the similarities into \(K/N\) groups so that the data distribution characteristics of the clients within each group are approximately similar. Next, we introduce the consideration of heterogeneous computing capabilities: since there are significant differences in computing capabilities among clients within each group, we sort the computing capabilities within each group to obtain the sorted groups. Finally, when the cloud pairs each edge, if there are clients with the same computing capability in each group, they naturally cluster and form a pair for one of the edges. If there are no clients with exactly the same computing capability between groups or if partial matching has been completed, the remaining unselected clients are paired by the edge according to the sorted computing capability, from high to low, based on the sorted row numbers. The specific method is given in Algorithm 1. The paired clients under each edge maintain dissimilar data distributions but similar computing capabilities. Figure 1: Synchronous FL training process. ```
Input:Client \(i\) in the \(T\)th round of the global model \(W_{i}^{T,t}\), \(i\in\{1,2,\cdots,K\}\), \(t\) is update time in each round; the computing capability of client \(i\) is \(f_{i}\). Output:The set of clients paired with each edge \(K_{j},j\in\{1,2,\cdots,N\}\). 1 Generate a client set \(ClientSet=\{1,2,\cdots,K\}\);
2 for\(i\in\{1,2,\cdots,K\}\)do// Comparison of client similarity
3\(W_{i}^{T,t}=part(W_{i}^{T,t})\);
4\(\Sigma^{i}=SVD(W_{i}^{T,t}).resize()\);
5
6 end for
7 for\(i\in\{1,2,\cdots,K\}\)do// Construction of similarity matrix \(S\)
8 for\(i^{\prime}\in\{1,2,\cdots,K\}\)do
9\(S[i][i^{\prime}]=sim(\Sigma^{i},\Sigma^{i^{\prime}})\)
10
11 end for
12
13 end for
14 for\(i\in\{1,2,\cdots,K\}\)do// Client grouping and edge pairing
15 ifClient \(i\
otin ClientSet\)then
16 continue;
17
18 else
19 Select the top \(K\) unselected clients from the sorted \(S[i]\) to form \(arr[j]\);
20
21 end for
22
23 end for
24 Sort the clients within the \(K/N\) groups according to their computing capability \(f_{i}\) from high to low to obtain \(arr_{sort}\);
25 whilethere are clients with identical computing capability \(f_{i}\) in the groups,do
26 Considering as the pairing set for the edge \(\mathcal{K}_{j}\);
27
28 end for
29 for\(edge\)\(j\in\{1,2,\cdots,N\}\)do
30 Select one client from each row in the \(arr_{sort}\), from the highest row number to the lowest, to form \(\mathcal{K}_{j}\);
31
32 end for
```  
**Algorithm 1**Client-edge pairing based on similarity and heterogeneous computing capabilities  
The proposed client-edge pairing algorithm acts as a pre-processing module in the training process of a three-tier FL architecture. It performs client grouping based on local model similarity and heterogeneous computing capabilities. Since the algorithm does not directly participate in parameter optimization or model updates, it preserves the convergence properties of standard FL algorithms such as FedAvg or FedProx.