## 4 Energy Efficient D2D over Single Frequency Network (EED2D-SF)
The EE KPI we will refer in this work is the Mobile Network data Energy Efficiency (\(EE_{MN,DV}\)), expressed in \(bit/J\), and defined as the ratio between the data volume \(DV_{MN}\) and the energy consumption (\(EC_{MN}\)):  
\[EE_{MN,DV}=\frac{DV_{MN}}{EC_{MN}} \tag{2}\]  
In practice, it is the amount of information that can be reliably transmitted per Joule of consumed energy. Starting from this performance metric, the gNodeB determines the MCSs for the multicast and the D2D transmissions that maximize the overall Network Energy Efficiency (NEE), as in the following:  
\[\underset{(CQI_{CMS},CQI_{D2D})}{\arg\max}\bigg{\{}\sum_{i=1}^{n_{CMS}}\frac{ DV}{EC_{i,RX}^{CQI_{CMS}}}+\sum_{j=1}^{n_{D2D}}\frac{DV}{EC_{i,RX}^{CQI_{D2D}}}+ \sum_{k=1}^{n_{nel}}\frac{DV}{EC_{k,TX}^{CQI_{D2D}}}\bigg{\}} \tag{3}\]  
where the three sums represent the EE of, respectively, the \(n_{CMS}\) devices receiving the multicast content \(DV\) by using the \(CQI_{CMS}\) MCS; the \(n_{D2D}\) devices receiving the same multicast content by relay nodes in D2D mode using the \(CQI_{D2D}\) MCS; and the \(n_{rel}\) relay nodes that forward the multicast content to D2D receivers by using the \(CQI_{D2D}\) MCS. Equation (3) is subject to:  
\[\mathcal{N}_{gNB}\cup\mathcal{N}_{D2D}=\mathcal{N} \tag{4}\]  
where \(\mathcal{N}\) is the total number of MTC devices, \(\mathcal{N}_{gNB}\) is the number of MTC devices served through gNodeB transmission and \(\mathcal{N}_{D2D}\) is the number of MTC devices receiving data in D2D communications. The EED2D-SF follows an iterative approach analyzing all possible combinations of multicast (from gNodeB to relays) and D2D (from relays to cell-edge devices) connections, and follows the steps shown in the flow chart in Figure 2. In particular, the gNodeB receives CQI feedbacks from all devices regarding both the device-to-gNodeB (D2 gNB) and the D2D links. The D2 gNB CQIs are candidates as potential CQIs for the CMS in the downlink subframes. Then, starting from the lowest device-to-gNodeB CQI and increasing it at each iteration, the gNodeB determines the subgroup of devices that can receive data via multicast directly from the gNodeB for the considered CQI. The selected multicast devices at a given iteration are those that, according to their channel conditions (the CQI under investigation), are able to receive data sent from the gNodeB with the  
Figure 1: Energy Efficient D2D over Single Frequency Network (EED2D-SF) scenario. currently selected MCS. Then, a subset of these nodes must be selected as relays towards the devices out-of-coverage from the multicast transmission. Specifically, the relay nodes will be those allowing to serve the highest number of out-of-multicast-coverage sensor/machine nodes. Then, the MCS to be used for D2D communication is chosen as the most robust among those supported by the selected relay nodes, in order to exploit the single frequency operation. If all devices are served through either CMS or D2D transmissions, the algorithm computes and stores the achievable NEE value as shown in Equation (3) for the current configuration; otherwise, the configuration is discarded. The algorithm stops when all configurations have been analyzed and the gNodeB selects the one that guarantees the highest overall network energy efficiency and provides service to all devices. The implementation of the proposed EED2D-SF algorithm has an overall complexity equal to \(O(N^{2})\), where N is the number of MTC devices. We highlight that the designed scheme is executed at the gNodeB that is a high performing node. Hence, the implementation of the proposed scheme is feasible.