## 7 Performance Evaluation
### Resource and Energy Distribution Returned by DeepFogSim  
In this subsection, we provide results obtained by the _DynDeF_RAS_ function in terms of both resource allocation and energy performance. To begin with, the _DeepFogSim_ has been tested under topology \(T1\) and the obtained plots are shown in Figure 9. Specifically, Figure 9a,b illustrate the traces of the optimized frequencies of the convolutional and the classifier processors, respectively. Although the total number of iteration \(I_{MAX}\) of the _DynDeF_RAS_ function in Algorithm 1 is set to 450,  
Figure 8: The considered two test topologies: (**a**) topology \(T1\) and (**b**) topology \(T2\). these figures clearly show that the _DeepFogSim_ simulator stops Algorithm 1 after only 33 iteration. An examination of the traces and legends shown in Figure 9a,b also suggests that all the involved frequencies (both for the convolutional and classifier processors) are clustered into three groups, which correspond to the FNs allocated over each of the three tiers of the considered Fog topology. This behavior is justified by the fact that, at each tier, each FN has to process the same volume of the input workload. The last values of the traces in Figure 9a,b, i.e., the optimized frequencies of the convolutional and the classifier processors returned by the Algorithm 1, are shown in the bar plots of Figure 10a,b, respectively. These plots confirm the clusterization of the optimized frequencies of both the convolutional and the classifier processors: the four frequencies of the first tier converge to the same value, and a similar behavior holds for the two frequencies of the second tier. In a similar way, Figure 11a shows the traces of the optimized flow rates \(R_{1}\) and \(R_{2}\) between _tier_ #1 and _tier_ #2, and between _tier_ #2 and _tier_ #3, respectively. This figure shows that, although the rates start from different values, they converge to similar values at the steady state. Figure 11b illustrates the convergence of the lambda multipliers in (25) and supports the conclusion that a very limited number of iterations is sufficient to converge to a feasible solution. Figure 10: Values under topology \(T1\) of the final optimized frequencies of the: (**a**) convolutional processors and (**b**) classifier processors. Figure 9: Traces under topology \(T1\) of the obtained frequencies of the: (**a**) convolutional processors and (**b**) classifier processors. The values of the optimized values of the flow rates \(R_{1}\) and \(R_{2}\) are presented in Figure 12a, once again highlighting the similar optimized values. Figure 12b, instead, shows the ratio between the actual delay needed to perform the computation-plus-communi cation task at each tier in (6) and the maximum tolerated delays \(T_{EXIT}\). By definition, the returned optimized solution is feasible if all these rates are not greater than the unit. Figure 12b clearly shows that this constraint is met in all the three cases; hence, the presented steady-state resource allocations are, indeed, feasible. In order to describe the energy plots returned by the _DeepFogSim_ toolkit, Figure 13 presents the returned traces of the total energy \(\mathcal{E}_{TOT}^{(best)}\) (top plot), computing energy \(\mathcal{E}_{COP}^{(best)}\) (middle plot), and network energy \(\mathcal{E}_{NET}^{(best)}\) (bottom plot). In addition, for the energy consumption, it is evident that _DeepFogSim_ allows a considerable saving after only 33 iteration of Algorithm 1. The final optimized values for these energies are shown by the bar plots of Figure 14a, which explicitly illustrate that the main fraction of the total consumed energy is due to the computing part, while the network one is limited up to about 10%.