# Energy-Efficient Distributed Edge Computing to Assist Dense Internet of Things
## 6 Optimized Resource Allocation Algorithm
We measured the average consumed energy, as a percentage, for each IoT node as follows:

\[\textit{Average energy consumption}\ (\%)=\frac{\textit{Total energy consumed during simulation process}}{\textit{Initial energy}}\,, \tag{15}\]

The other metric is the average latency to handle the assigned computing tasks. Furthermore, the amount of traffic passed to the core network was measured. Also, the percentage of resource utilization was considered to check the effectiveness of introducing a new level of edge computing resources (i.e., fog layer). This metric gives the percentage of resources effectively utilized by the system. It was measured by comparing used resources to the total available resources. Higher utilization percentages indicate more efficient use of system resources. ### Experimental Results

Figure 2 provides the average consumed energy of IoT nodes for the three considered systems. The energy consumption was recorded ten times for each system, and the number of deployed nodes differs each time. The network was simulated, while the end devices were assigned computing tasks from the three mentioned categories of services. Figure 2a provides the results for energy consumption, when devices generate the workload of the first category of applications. Figure 2b,c provide the results, when using the more complex workloads of the second and third categories, respectively. With the increased number of deployed nodes, the average energy consumption increases due to the communication overhead resulting from the massive deployment of devices and the increased data retransmission. However, this energy consumption increase was minimal for the proposed fog/MEC-IoT due to the availability of fog and MEC nodes that reduce the communication overhead, retransmission, and communicated distances. Furthermore, with increased task

complexity, the network requires higher capabilities in terms of computing resources. However, the proposed fog/MEC IoT network achieves higher energy efficiency for complex applications that required higher resources. Figure 3 indicates the percentage of traffic passing through the core network compared to the total amount of traffic. This record was measured for the three simulated systems with different numbers of deployed IoT devices. Figure 3a

Figure 2: Average consumed energy for the three considered networks, (**a**) the first category of applications, (**b**) the second category of applications, and (**c**) the third category of applications. traffic passed to the core network for the three considered categories of tasks. With the increase in IoT nodes, the amount of traffic passed to the core network gets increased in the three systems. Most traffic is passed through the core network to the application server for the traditional IoT, without distributed edge computing paradigm deployment. However, the introduction of edge computing technology introduces a path for offloading, and thus, reduces the amount of traffic passing through the core network. This reduces the overall network congestion. The results indicate that the proposed fog/MEC-IoT has the lowest network congestion level compared to traditional IoT, fog-IoT networks, and the system proposed in [5]. Figure 3: Percentage of the traffic passed to the core network, (**a**) first category of applications, (**b**) second category of applications, and (**c**) third category of applications. Figure 4 provides the average latency required to handle the considered heterogeneous computing tasks. The average latency required to handle data is reduced due to the reduction in communication distances between IoT end devices and the server. This was clear for the three considered types of workloads. However, the latency is increased mainly for complex tasks, i.e., tasks of the third category, compared to other simulated systems. This can be interpreted by the introduction of two layers of computing resources and the deployed offloading and resource management strategies that reduce the overhead.