# Dynamic Computation Offloading with Deep Reinforcement Learning in Edge Network
## 5 Experiments
### Performance Evaluation
#### 5.2.1 Influence of Task Density  
We ran our experiments on several task densities--10, 25, 40, 55 tasks each second--to analyze the influence of different task densities on different algorithms. The task density varied from 10 to 55, representing a range from a low- to high-workload network state. In Figures 4 and 5, we plot a comparison of the energy consumption and delay for several task densities. A comparison of the total cost is shown in Figure 6.  
As shown in Figure 4, when the task density is 15, due to the low task density, the current task is processed before the next task reaches the edge server. The computing resources of a single edge server can satisfy most of the task requests, and the necessity of collaboration is greatly reduced. Hence, the gap in the delay between the three collaboration strategies is not large. When the task density is 25, the computing resources of a single edge server cannot meet the requirements of the task requests. A collaboration strategy is needed to reduce the processing delay in tasks at this situation. We can observe that the performance of DCOS and ESM are closer because the ESM algorithm restricts the task execution location to local execution. In the long-term, the workload of each edge server is balanced, so there is little difference in the performance of the two algorithms under a low workload. The performance of the DDPG algorithm is worse because it cannot dynamically reconfigure the service. With the increase in task density and workload, the difference between the the time costs of both DDPG and ESM algorithms and those of DCOS gradually increases. When the network reaches saturation, the DCOS algorithm can  
Figure 4: Delay comparison on different task densities. offload tasks to intermediate nodes with sufficient computing resources to reduce queuing delays. The parallel migration and offloading process enables the algorithm to complete the transmission of tasks and services at the most considerable time cost. When the task density reaches 55, the performance of DCOS clearly improves. Compared with DDPG, the delays in user requests decrease by 32.18%.The relative ESM delay in user requests is reduced by 27.16%. As shown in Figure 5, the energy consumption of the three algorithms increases with the increase in task density in a near-linear correlation, which is because all three algorithms inevitably need to transmit data, and the energy consumed by the transmission is independent of the operating status of the edge servers. It is worth mentioning that the task-processing delay is related to the operating status of the edge servers. When the workload of the edge network is over-saturated, the task-processing appears congested, so the delay is greater than the increase in energy consumption. In addition, since most of the tasks in this experiment are data-intensive, the amount of data transmitted during task offloading is larger than that during service migration, so the energy consumption of DDPG is larger than that of ESM. The DCOS algorithm combines the advantages of both algorithms and can flexibly adjust the decision according to the cost. Therefore it performs better than DDPG and ESM in terms of energy consumption. When the task density reaches 40, the energy consumption performance of DCOS is significantly improved compared with that of ESM, decreasing by 18.67%. When the task density reaches 40, the energy consumption is decreased by 18.67%. When the task density reaches 40  
consumption performance of DCOS is significantly improved compared with that of DDPG, decreasing by 28.21%. The observation made in Figure 6 shows that the DDPG and ESM algorithms perform only within a very small range of task densities. However, our proposed DCOS algorithm remains stable when the task density increases. The results demonstrate that the DCOS algorithm can perform cost-effective computation-offloading in various situations. Due to the weight of the heavy delays in user requests, the trend in the data in Figures 4 and 6 is basically the same.