*2.8. Operational Expenditure*

In respect to operational expenditure, our objective is to maximize the number of jobs denoted as *yij* the index of a job while satisfying constraints such as *τj* delay for every job. Furthermore, each drone must return back to its drone port. Lastly, the path generated must not exceed the drone's energy capacity denoted as the function *f*(*dij*)

$$\begin{aligned} \text{maximize} & \quad \sum\_{i} \sum\_{j} y\_{ij\prime} \\ \text{subject to} & \quad \sum\_{j} \qquad y\_{ij} f(d\_{ij}) \le B\_{i} & \quad i = 1, \dots, n\_{\prime} \\ & \quad \mathbf{x}\_{0} = \mathbf{x}\_{f\_{ac}\prime} \\ & \quad \mathbf{x}\_{final} = \mathbf{x}\_{f\_{ac}\prime} \\ & \quad \mathbf{r}\_{j} \le \mathbf{t}\_{j\prime} \\ & \quad f(d\_{ij}) = P\*d\_{ij} + \eta\_{\prime} \\ & \quad \mathbf{r}\_{j} = t\_{\text{complete}} - t\_{\text{arrival}} \end{aligned} \tag{3}$$

#### *2.9. Drone Port Placement Algorithm*

Algorithm 1 is an overview of our proposed algorithm to efficiently place drones in a distributed area. We develop a heuristic approach by implementing a clustering and traveling salesman problem ensemble to determine the feasibility our algorithm's output data. We continue to increase the number of drone ports until each drone has enough energy to perform all of the tasks in its coverage.

#### **Algorithm 1** Facility Location Problem for Drones

```
procedure DRONE PORT PLACEMENT AND SHORTEST ROUTE
   i ← max number of droneports
   T ← Task Locations array
   P ← Set of drone ports array
   Pmax ← max number of droneports
   p ← Initial number of droneports
   while p ≤ Pmax do
       clusters ← GenerateCluster(Tasks, p)
       shortestroute ← TSP(tasks, droneport)
       e ← f(di j)
       if e ≥ θ then
          Break
       else
          p ← p + 1
   return Drone Port location
   return Shortest Routes
```
### *2.10. Traveling Salesman Problem*

After creating the clusters, we apply a shortest route algorithm to ensure that the drone can perform all of the tasks allocated to it while completing a round-trip back to its original drone port. It is denoted as the Traveling Salesman Problem (TSP) below.

## **3. Performance Evaluation**

Our simulation was conducted on a PC with the operating system Ubuntu 16.04. We applied the algorithms in Table 2 written in Python 3.5 to conduct our simulations. The area size for our simulation is 1000 × 1000 units.


**Table 2.** Algorithms we compared.

#### *3.1. Coverage Size effect on the Combinatorial Search Space*

In Figure 3, we analyzed the combination space size in log units if clustering was not applied. Increasing the potential coverage size and the number of potential drone ports exponentially increases the search space. The average complexity is given by *O*(*kn<sup>T</sup>*), where *n* is the number of combinations and *T* is the maximum number of iterations. In practice, the k-means algorithm is fast, but it tends to return a local minima. To avoid this, we used a bottom up approach to avoid falling in to any local minima [18]. This means we can effectively reduce the number of combinations greatly by applying k-means instead of using a naive approach such as a fixed coverage area. The constraints in our proposal ensure that no task appears outside a drone port's range due to improper clustering.

**Figure 3.** The worst case to determine the optimal solution for possible drone port coverage sizes.

#### *3.2. Average Round Trip Distance*

In Figure 4, we determined the coverage and round trip distance. The result comes from our problem formulation constraint, which is that the drone must visit all the tasks assigned within its cluster. Our k-means selects locations based on shortest average distance between the potential drone port point and task locations. The red line shows the optimal solution. It may provide the shortest path and least cost, but it is computationally expensive by almost 50% on average compared with the approximation algorithms. The issue with the genetic algorithm shown in Figure 4 is due to the random approach it takes to converge to the optimal solution. This may have been due to not allowing enough generations to fine the combination that gives the shortest path. Secondly, the 2-opt algorithm performs slight worse, due to being a single thread and with a limited number of iterations to find the optimal solution. Each time the number of drone ports increases, the number of combinations between drone ports and tasks is restricted—thus allowing the solver to find the optimal solution with multiple solution sub-spaces to solve producing a near-optimal solution. The genetic algorithm was able to find a near-optimal solution once the sub-spaces were small enough so its random choices had a larger impact on the distance traveled.

#### *3.3. Infrastructure and Energy Cost*

In Figure 5, we compared the cost of having drones fly further versus the cost of installing a drone port. For this experiment, we set the cost of a drone flying per unit distance *γ* to 0.5. In addition, the cost of a drone port to *c* 2. If our cost to install a drone port was a lot less than the operating cost of a drone, then there would likely be a lot more drone ports since more ports would be possible without increasing the budget. However, this cost does not consider the on-going costs of maintenance for the drones and drone ports. These values can be configured later to reflect actual prices of drone ports and electricity.

**Figure 4.** Average round trip for drones based on k-means clustering and Traveling Salesman Approximation.

**Figure 5.** Infrastructure vs. monetary cost.
