# D2D-Assisted Adaptive Federated Learning in Energy-Constrained Edge Computing
## 4 Partite Graph-Based FL Scheme with Adaptive D2D Pairing and Aperiodic Local Iterations
It is easy to see that with the expansion of the edge computing network scale and the increase in the number of edge servers, the number of clusters formed by these three schemes gradually increases, but at different growth rates. The partite graph-based D2D pairing scheme has the slowest growth in the number of clusters, while our GNN-and-DRL-based scheme has the fastest growth. This is because the partite graph-based scheme mainly focuses on the communication topology between servers. As long as the transmission distance between the servers and the existing relay servers meets the aggregation requirements, the scheme will not trigger the generation of new clusters. In addition to considering the network communication topology, our designed GNN-and-DRL-based scheme further incorporates dataset correlation between different servers into the cluster formulation, thereby optimizing the arrangement of server clusters and improving FL training accuracy. The DRL-based scheme maps the topological relationship between servers and the correlation of datasets into hyperparameters. Some specific features of the correlation may be lost in the mapping process. Therefore, the change in the number of edge servers may not lead to a significant impact on the DRL hyperparameters, which slows down the growth of the number of server clusters. Figure 11 shows the training loss values, the local iteration numbers, and the energy costs of the proposed two schemes alongside the configuration parameters of the wireless channel numbers and energy budget restrictions. Subgraphs (a), (b), and (c) present the performance of Algorithm 1, while subgraphs (d), (e), and (f) correspond to the performance of Algorithm 2. Through the joint comparison of sub-figures (a), (b), and (c) it can be seen that the number of channels \(Z_{2}\) has a stronger impact on performance than the number of channels \(Z_{1}\), especially on the training loss value and the number of local training iterations. When the number of \(Z_{2}\) is reduced to 2, regardless of the value of energy budget \(\widetilde{E}_{n}^{\max}\) or the value of \(Z_{1}\), the training loss increases significantly compared with when \(Z_{2}\) is 4 or 6. This observation suggests that too few channels \(Z_{2}\) may limit D2D model aggregation between the servers, thus undermining the overall training performance of the FL. In subgraph (b), when both \(Z_{2}\) and \(\widetilde{E}_{n}^{\max}\) are large, the number of local training iterations of the servers increases significantly compared to other scenarios. This is because a rich energy budget and large D2D transmission capacity prompt the servers to conduct sufficient local training

Figure 9: Total energy cost of FL system with different schemes. before sharing model parameters in a D2D approach. Unlike subgraphs (a) and (b), the energy costs presented by subgraph (c) are less affected by \(Z_{2}\) and \(\bar{E}_{n}^{\max}\), but it shows a slow downward trend as \(Z_{1}\) increases. The growth number of \(Z_{1}\) means that more servers can directly interact with the aggregation server, reducing the energy costs of model parameters' relay forwarding. In subfigures (d), (e), and (f), the performance of Algorithm 2 with these configuration parameters has characteristics similar to Algorithm 1. Figure 11: Training loss, local iteration numbers and energy costs of different schemes. (**a**) Training loss of Algorithm 1; (**b**) Iteration number of Algorithm 1; (**c**) Energy cost of Algorithm 1; (**d**) Training loss of Algorithm 2; (**e**) Iteration number of Algorithm 2; (**f**) Energy cost of Algorithm 2. Figure 10: Number of server clusters with different schemes. ## 7 Conclusions

In this paper, we investigated FL-enabled mobile edge computing networks, and we presented a D2D-assisted FL mechanism that improves learning accuracy for energy-constrained servers.