# Optimal User Association Strategy for Large-Scale IoT Sensor Networks with Mobility on Cloud RANs
## 4 Evaluation
### Time Complexity  
The proposed algorithms allows finding optimal solutions for each time slot. Therefore, to enable the proposed methods running in real time, it is important to consider their time complexity. The average time taken in seconds to run each algorithm is shown in Figure 9. It should be noted that the plotted values, i.e., the time taken to solve the given optimization problem, include the time for making function calls for measuring time (In this work, we used tic and toc functions provided by MATLAB. We summed up the time required to run each algorithm for 1000 iterations, and then, we divided the sum by 1000 to get the average time. ), modeling time for each given optimization problem, and time required for a solver to find the optimal solution (In CVX, for a given optimization problem, the modeling process runs first to transform the problem into the form that the particular solver can take in. After that, the solver solves the problem and then returns the optimal solution. [29]). Therefore, the actual time to solve the problem is smaller than the ones reported in Figure 9. In addition, if the operating platform is changed to a powerful computing machine, such as BBU pool in C-RAN, much less CPU time will be required to run the algorithms. In short, solving SDF or RND takes a negligible amount of time compared to the proposed algorithms due to their simplicity. It takes almost the same amount of time to solve ALGO-1 and ALGO-2 because the corresponding optimization problems P. (2) and P.(3), respectively, are similar to each other except that P. (3) has some additional complexity for its relatively complex objective function. Although ALGO-2 and ALGO-3 are basically the same, and thus, take the same amount of time to find optimal solutions when IoT devices are moving fast, ALGO-2 is significantly efficient when the proximity matrix does not change often. It is worth mentioning that the CPU time for SDF and RND took \(\leq\)1 ms in all cases. It is because the corresponding algorithms are quite simple. For each IoT device, the SDF algorithm compares the distance to nearby RRHs and chooses the closest one. On the other hand, for each IoT device, the RND algorithm randomly chooses an RRH among the nearby ones. However, the proposed schemes need to solve the optimization problem with binary variables. Owing to the advanced schemes available  
Figure 8: Total number of handovers with respect to the number of IoT devices when \(v=20\). to reduce the time complexity of such problems, such as relaxation and branch-and-bound, solving binary (or integer in general) optimization problems does not take much time, as shown in Figure 9.  
The CPU time values required for ALGO-1 and ALGO-2 are very close to each other because of the similarity in their problem formulation. However, ALGO-2 takes a longer time to compute because it has a more complex objective function. For a small \(v\), ALGO-3 requires much shorter CPU time to run than ALGO-2 because the network does not change significantly when IoT devices are moving slowly, therefore ALGO-3 often skips the steps of solving the optimization problem. As \(v\) increases, the difference between the two becomes smaller. Overall, taking into account the limitations of the computing power of the PC used for this simulation and the difficulties in separating the actual solver time from the aggregated CPU time to find the optimal solution, the proposed algorithms can be used in real time if the same or similar network configuration is used, e.g., time slot of 1 s, tens of IoT devices, and a small data rate of IoT devices. Figure 10 shows the time complexity of the five algorithms in cases when there are more devices in the network. Even though the proposed methods need to solve computationally heavy optimization problems, the CPU time has not been drastically increased. Considering the configurations used for the evaluation, the time complexity has shown a rather linear pattern with a gentle slope. A further discussion on the time complexity is given in Section 5.