Skip to main content

Trajectory planning in UAV emergency networks with potential underlaying D2D communication based on K-means


At present, unmanned aerial vehicles (UAVs) have been widely used in communication systems, and the fifth-generation wireless system (5G) has further promoted the vigorous development of them. The trajectory planning of UAV is an important factor that affects the timeliness and completion of missions, especially in scenarios such as emergency communications and post-disaster rescue. In this paper, we consider an emergency communication network where a UAV aims to achieve complete coverage of potential underlaying device-to-device (D2D) users. Trajectory planning issues are grouped into clustering and supplementary phases for optimization. Aiming at trajectory length and sum throughput, two trajectory planning algorithms based on K-means are proposed, respectively. In addition, in order to balance sum throughput with trajectory length, we present a joint evaluation index. Then relying on this index, a third trajectory optimization algorithm is further proposed. Simulation results show the validity of the proposed algorithms which have advantages over the well-known benchmark scheme in terms of trajectory length and sum throughput.

1 Introduction

1.1 Motivation

With the continuous update and iteration of communication technology, the era of fifth-generation wireless systems (5G) has quietly come to us and gradually opened up a new phase of interconnection of all things. In the evolution of 5G-oriented wireless communication technology, on the one hand, traditional wireless communication performance indicators need to be continuously improved to further improve the limited and increasingly tight wireless spectrum utilization; on the other hand, richer communication modes, resulting improvement of end-user experience and expansion of cellular communication applications are also evolving directions to be considered.

Device-to-device (D2D) communication, as one of the key technologies of 5G, has potential to improve system performance, enhance user experience and expand application of cellular communication and has received wide attention [1]. D2D is more flexible than other direct technologies that do not rely on infrastructure. It can not only connect and allocate resources under control of the base station (BS), but also exchange information when there is no network infrastructure. In addition, there is a relay scenario where users without network coverage can access the network by using their device as a springboard. D2D communication is mainly used in public safety scenarios such as natural disasters and equipment failures. This scenario is of great practical significance and has been supported by several national operators, such as the USA, which is preparing to allocate part of the spectrum on the 700 MHz frequency band specifically as D2D emergency communication resources.

In emergency network scenarios, it is very necessary for public and secure communication to respond in the first time. With the advantages of high mobility and flexible deployment, unmanned aerial vehicle (UAV) has become an important part of wireless network and is also a key driving factor of 5G and future wireless Internet of things (IoT). Especially as an air base station, it does not need to rely on infrastructure and road conditions like ground communication equipment, and it is not easily restricted by communication height. Therefore, dispatching UAVs equipped with communication facilities for temporary networking can quickly establish emergency rescue communication networks [2] and effectively recover and improve network performance in terms of coverage, connectivity and spectrum.

1.2 Related research

Unlike traditional ground BS, UAV base station can be deployed flexibly and moved along a given trajectory, which is determined by its aeronautical characteristics to cover the ground terminals (GTs) [3]. Therefore, trajectory planning is a basic prerequisite to ensure successful completion of UAV tasks [4] and has become an important research hot spot in the field of UAV. However, previous research work is mainly on UAV navigation applications under various environmental constraints (such as obstacle avoidance) [5]. Xu et al. [6] study a new type of wireless energy transfer (WPT) system for unmanned aerial vehicle (UAV), which optimizes the mobility of UAV by designing trajectory, so as to transfer energy to two energy receivers in limited charging period. Wu et al. [7] optimize multiuser communication scheduling with UAV trajectory and power control to maximize the minimum throughput of all ground users for fair performance between users. Especially in the face of communication tasks with a wide range of users and services, how to achieve full coverage quickly and effectively has become one of the goals of UAV. Yaliniz et al. [8] consider the deployment of a single UAV base station under the probabilistic line-of-sight (LoS) channel model to offload as many GTs as possible from the ground BS. Yong et al. [9] design UAV trajectory to ensure that each GT can restore files with a high probability of success, while also greatly reducing task completion time.

Since most single UAV trajectory planning algorithms are NP hard, many references consider the deployment of multiple UAV base stations. Lyu et al. [3] propose a polynomial time algorithm for continuous vehicle-mounted mobile base station placement. In addition, clustering algorithm is also one of the common methods to place multiple UAVs [10]. Mozaffari et al. [11] study the deployment of UAVs in a coexistence network of UAVs and D2D users (DUs). Based on the disk coverage problem, the minimum number of stop points (SPs) for UAVs to cover circular areas with different radii is obtained. On the basis of Lyu et al. [3], Ji et al. [12] realize optimization of UAV trajectory in the cache network where UAV and DUs coexist. This provides a new idea and method for studying trajectory planning of a single UAV, that is, first determine the UAV’s space position and then construct UAV’s trajectory.

At present, the main optimization objective of UAV trajectory planning is mission completion time or the number of stop points, without taking into account throughput performance of the GT side. Especially in the emergency network where UAV and DUs coexist, in order to improve the efficiency and quality of UAV mission completion, it is natural to hope that UAVs provide higher communication quality while reducing their own energy consumption as much as possible. The optimization goal can be converted from energy consumption to UAV trajectory length without considering communication energy consumption and speed change.

To sum up, most of the UAV service users studied in the previous literature are ground terminals with a single communication mode or unable to establish an effective communication link with each other. And the main optimization goals are task completion time, number of service users and number of stops. However, in the emergency network of UAV and D2D co-existence, in order to improve the efficiency and quality of UAV mission completion, it is natural to hope that UAV can provide higher communication quality while reducing its own energy consumption as much as possible, which means that the trajectory and communication indicators need to be considered comprehensively. Unlike other literature, the ground terminals considered in this paper have the potential to enable D2D communication mode, which provides the possibility of saving energy for UAVs and improving time efficiency. Therefore, the above-mentioned literature is not applicable to the issues studied in this paper.

1.3 Contributions

This paper studies the trajectory planning problem of UAV emergency networks for potential underlaying DUs with Homogeneous Poisson Point Process (HPPP) distribution. The process of trajectory planning is divided into two phases (clustering phase and supplementary phase), and three step-by-step optimization algorithms are proposed for three optimization objectives, including trajectory length, sum throughput and joint evaluation index that combines the two. The specific contributions are as follows:

  • We first propose a trajectory planning algorithm based on K-means algorithm to minimize trajectory length. The selection method of initial clustering centers is improved, and then the improved K-means algorithm is used to obtain the set of stop points in the first stage to construct the initial reference trajectory and determine the initial coverage. Then, a equation for SP coordinate is solved in a polar coordinate system to obtain the set of stop points for the second phase. The final trajectory consists of stop points obtained in two phases.

  • Based on algorithm 1, a sum-throughput optimized trajectory planning algorithm is presented. In clustering phase, sum throughput is optimized by using successive convex approximation (SCA) to update the initial stop points. In supplementary phase, UAV is placed directly above D2D users to maximize throughput. Finally, construct UAV’s trajectory.

  • In order to better balance the relationship between trajectory length and sum throughput, we present a joint evaluation index and propose algorithm 3 based on this index. Algorithm 3 preserves the method of maximizing sum throughput in the first phase of algorithm 2, and in the second phase, the joint evaluation index is used as a nonlinear optimization objective function to balance trajectory length and sum throughput.

  • Finally, we summarize and compare the three algorithms. The simulation results verify the validity of the above three algorithms. Algorithm 1 has obvious advantages in trajectory length. Algorithm 2 improves throughput significantly over algorithm 1, but it is at the cost of an increase in trajectory length. By contrast, algorithm 3 is able to better balance the relationship between trajectory length and sum throughput, showing remarkable performance in all aspects.

1.4 Paper organization

The rest of this paper is organized as follows. Section 2 introduces the system model and presents the problem formulations for UAV emergency communication network. In Section 3, trajectory length optimization algorithm based on improved K-means (TLOA-IK) is presented. Section 4 and Section 5 present sum-throughput optimization algorithm based on TLOA-IK (STOA-IK) and balance optimization algorithm based on STOA-IK (BOA-IK), respectively. Section 6 summarizes and compares the three algorithms. Section 7 provides the numerical results, and finally we conclude the paper in Section 8. For clarity, we summarize the key notations and their definitions in Table 1.

Notations: In the paper, scalars and vectors are denoted by italic letters and boldface lower-case letters, respectively. For a vector x, \(\left\| \mathbf{x }\right\|\) represents its Euclidean norm. \(\mathrm{log}2(\cdot )\) denotes the logarithm with base 2. For a set \({\mathcal{U}}\), \(|{\mathcal{U}}|\) denotes its cardinality. For sets \({\mathcal{U}}_{1}\) and \({\mathcal{U}}_{2}\), \({\mathcal{U}}_{1}\cup {\mathcal{U}}_{2}\) means the union of the two sets.

Table 1 Summary of key notations

2 System model and problem formulation

In this paper, we study a UAV-assisted network with potential underlaying D2D communication, where a UAV acts as an aerial BS to provide wireless coverage service to terrestrial DUs as shown in Fig. 1. It is worth noting that potential D2D communication means that all DUs have the flexibility to adjust the communication mode according to UAV’s trajectory, i.e., they can communicate directly with UAV or D2D communication. For example, when DU\(_1\) is in UAV’s coverage, DU\(_1\) communicates directly with UAV. However, when DU\(_1\) is outside UAV’s coverage and DU\(_2\) who matches DU\(_1\) can communicate with UAV, DU\(_1\) chooses to communicate directly with DU\(_2\).

Fig. 1
figure 1

A UAV-based wireless emergency communication system, where a UAV acts as a flying BS and GTs appear as D2D pairs

The DUs exist in the form of a Homogeneous Poisson Point Process (HPPP) \(\varphi\) with density \(\lambda\). We denote \(\{\mathbf{w}_\mathbf{d}[n]\}_{n\in {\mathcal{N}}}\) as the two-dimensional (2D) coordinates of DUs, where \({\mathcal{N}}=\{1,2,\ldots ,N\}\). We consider that all DUs are stationary in the process of UAV coverage [9].

We aim to plan trajectory of UAV to cover all ground DUs while minimizing trajectory length or maximizing sum throughput. In this paper, we separate trajectory into multiple line segments. Two end points of each segment are UAV’s SPs. In addition, we stipulate that UAV uses broadcast communication, that is, it can cover multiple DUs in each SP. Consequently, the main idea in this paper is to build a UAV trajectory by optimizing locations of SPs.

Assume that UAV takes off from the origin and flies at an altitude of H meters and does not need to return to the origin after performing coverage mission. Denoting by \({\mathcal{M}}=\{1,2,\ldots ,M\}\) the set of SPs, the horizontal coordinates of m-th SP are denoted by \({\mathbf{w}}_{u}[m]\), where \(m\in {\mathcal{M}}\). Therefore, the distance between m-th SP and n-th DU is expressed as

$$\begin{aligned} d_{n}[m]=\sqrt{H^{2}+\left\| {\mathbf{w}}_{u}[m]-{\mathbf{w}}_{d}[n]\right\| ^{2}},n\in {\mathcal{N}}; m\in {\mathcal{M}}. \end{aligned}$$

We consider that UAV-DU communication channels are dominated by LoS links. Under the LoS model, the distance between UAV and DU is the dominant factor for air-to-ground (A2G) channel power gain. The average channel power gain from UAV to n-th DU at m-th SP can be modeled as

$$\begin{aligned} \beta _{n}[m]=\beta _{0} d_{n}^{-\alpha }[m]=\frac{\beta _{0}}{\left( H^{2}+\left\| {\mathbf{w}}_{u}[m]-{\mathbf{w}}_{d}[n]\right\| ^{2}\right) ^{\alpha / 2}},n\in {\mathcal{N}}; m\in {\mathcal{M}}, \end{aligned}$$

where \(\beta _{0}\) is the channel power gain at reference distance which is 1m, and \(\alpha\) is the path loss exponent. The transmitting power of UAV is denoted by \(P_u\). The received signal-to-noise ratio (SNR) by n-th DU is given by

$$\begin{aligned} \gamma _{n}[m]=\frac{P_{u} \beta _{n}[m]}{\sigma ^{2}}=\frac{\gamma _{0}^{u}}{\left( H^{2}+\left\| \mathrm {w}_{u}[m]-\mathrm {w}_{d}[n]\right\| ^{2}\right) ^{a / 2}},n\in {\mathcal{N}}; m\in {\mathcal{M}}, \end{aligned}$$

where \(\sigma ^{2}\) denotes the additive white Gaussian noise (AWGN) power and \(\gamma _{0}^{u} \triangleq \frac{P_{u} \beta _{0}}{\sigma ^{2}}\) is the received SNR at reference distance \(d_0=1m\) [13].

Define the threshold of SNR at DU is \(\gamma _{th}\), the maximum transmitting power of UAV is \(P_u^{\mathrm{max}}\). Then, we have the maximum coverage radius of UAV,

$$\begin{aligned} R_{c}^{\mathrm{max}}=\sqrt{\left( \gamma_{0}^{\mathrm{\mathrm{u}} } / \gamma _{t h}\right) ^{2 / a}-H^{2}}. \end{aligned}$$

We aim to minimize the number of SPs, while each DU is covered by UAV at least once within its communication radius. This does not rule out the possibility that some DUs will be covered by UAV multiple times. The problem can be formulated as follows

$$\begin{aligned} \text{(P1) } :\left\{ \begin{array}{ll} \min _{\left\{ \mathrm {w}_{u}[m]\right\} _{{m\in M }}} &{} |{\mathcal{M}}| \\ \text{ s.t. } &{} \min _{{\text {m}}\in M}\left\| {\mathbf{w}}_{u}[m]-{\mathbf{w}}_{d}[n]\right\| \le R_{c}^{\mathrm{max}}, \quad \forall n \in {\mathcal{N}}. \end{array}\right. \end{aligned}$$

Srinivas et al. [14] point out that the UAV coverage problem P1 can be regarded as a geometric disk coverage problem. The problem of minimizing trajectory length can be transformed into minimizing the total number of disks, but the problem is still an NP problem [3].

In this paper, we start with minimizing trajectory length and then achieve the goal of maximizing sum throughput. Finally, we propose an effective algorithm to balance trajectory length and sum throughput. We adopt the idea of clustering and then gradually optimize locations of SPs. Therefore, we specify that SP set consists of two parts, one is the set of cluster centers obtained in clustering phase, which is denoted as \({{\mathbf{w}}_{u}^{k}[m_{i}]},m_{k}\in \{1,2,\ldots ,M_{i}\}\), and the other is the newly added set obtained in supplementary phase, which is denoted as \({{\mathbf{w}}_{u}^{a}[m_{a}],m_{a}\in \{1,2,\ldots ,M_{a}}\}\), based on DUs’ locations, i.e., \({\mathbf{w}}_{u}^{k} \cup {\mathbf{w}}_{u}^{a}= {\mathbf{w}}_{u}\). The set of Dus covered by \({{\mathbf{w}}_{u}^{k}}\) is denoted as \({{\mathbf{w}}_{d}^{c}[n_{c}]},n_{c}\in \{1,2,\ldots ,N_{c}\}\) , and the set of uncovered DUs is denoted as \({{\mathbf{w}}_{d}^{\mathrm{unc}}[n_{\mathrm{unc}}]},n_{\mathrm{unc}}\in \{1,2,\ldots ,N_{\mathrm{unc}}\}\), i.e., \({\mathbf{w}}_{d}^{c} \cup {\mathbf{w}}_{d}^{\mathrm{unc}}= {\mathbf{w}}_{d}\).

3 Trajectory length optimization algorithm based on improved K-means

In order to make UAV trajectory length as small as possible, we propose trajectory length optimization algorithm based on improved K-means (TLOA-IK). The main idea is to take locations of cluster centers as initial SPs and then determine initial coverage. The trajectory formed by initial SPs is defined as the reference trajectory. According to initial coverage and reference trajectory, determine whether new SPs need to be added. If necessary, add new SPs based on the stop point selection strategy (SPSS).

3.1 K-means algorithm

K-means is a common clustering method in which Euclidean distance is used to measure the similarity between data. In other words, the smaller the distance between the data, the more similar the data are. At the same time, the denser the data distribution, the greater the likelihood of clustering. In addition, the sum of squared errors (SSE) is adopted as objective function to measure clustering quality [4].

The basic principle of the K-means algorithm is described below. The data set \(\{w_{d}[n]\}_{n\in {\mathcal{N}}}\) consisting of DU’s position coordinates is a labeled collection. The goal of the algorithm is to cluster the data set into K clusters, \({\mathcal{C}}=\{C_{1}, C_{2}, \ldots , C_{K}\}\). Assume that \(\left| C_{i}\right|\) is the number of samples in i-th cluster \(C_{i}\), \(w_{u}^{k}[m_{i}]\) is the mean of these samples, i.e.,

$$\begin{aligned} {w_{u}^{k}[m_{i}]}=\frac{1}{\left| C_{i}\right| } \sum _{{w_{d}} \in C_{i}} {w_{d}}. \end{aligned}$$

Then, the SSE criterion can be expressed as

$$\begin{aligned} J_{e}=\sum _{m_{i}=1}^{K} \sum _{{w_{d}} \in C_{i}}\left\| {w_{d}}- {w_{u}^{k}[m_{i}]}\right\| ^{2}. \end{aligned}$$

Because \(J_{e}\) cannot be minimized by analytic method, it can only use iterative method to solve the problem by constantly adjusting the category of samples.

For K-means algorithm, the selection of K-values and initial cluster centers is critical to clustering results. To avoid local optimization, we use \(d_{\gamma }\) to limit the distances between initial cluster centers to obtain more dispersed initial clustering centers [15],

$$\begin{aligned} d_{\gamma }=\sqrt{\frac{A_{c}}{K}}, \end{aligned}$$

where the area of research region is denoted by \(A_{c}\). In other words, the distances between initial cluster centers should satisfy \(d_{i j \ge } d_{\gamma }\).

3.2 Stop point selection strategy

When initial SPs \({\mathbf{w}}_{u}^{k}\) are unable to achieve full coverage of the target area, i.e., there are DUs that cannot communicate effectively with UAV, the relationships between uncovered DUs and reference trajectory need to be determined. In this section, we will discuss the strategy of adding new stop points. The positional relationships between uncovered DUs and reference trajectory can be divided into three cases, as shown in Fig. 2.

Fig. 2
figure 2

Illustration of DU distribution and UAV trajectory. Both A and B are stop points, and triangles represent D2D users

3.2.1 Using D2D communication without adding new SP

As shown in Fig. 2, DU\(_1\) is uncovered and DU\(_2\) is covered. In this case, DU\(_1\) can get the content from DU\(_2\) without adding new SP. The trajectory length does not increase as a result.

3.2.2 Adding new SP, trajectory unchanged

Both DU\(_3\) and DU\(_4\) are uncovered in Fig. 2, and a new SP needs to be added to achieve coverage. It can be seen from Fig. 2 that DU\(_3\) is closer to line-AB than DU\(_4\), and the distance is less than R. In this case, we only need to find SP-E, which D\(_{3}\)E\(\perp\)AB. Namely, point E is the newly added SP.

3.2.3 Adding new SP, trajectory changed

Both the distance between the 3rd pair DUs (DU\(_5\) and DU\(_6\)) and the 4th pair DUs (DU\(_7\) and DU\(_8\)) to line-AB is greater than R. In this case, the selection of SP should consider both covering DUs and making the increment of trajectory as small as possible.

Let \(w_{d}^{\mathrm{unc}} (x_{d}^{\mathrm{unc}},y_{d}^{\mathrm{unc}})\) and \(w_{u}^{a} (x_{a},y_{a})\) denote coordinates of the uncovered DU and the newly added SP, respectively. Let \(w_{u}^{k,r} (x_{u}^{k,r} ,y_{u}^{k,r} )\) and \(w_{u}^{k,l} (x_{u}^{k,l},y_{u}^{k,l})\) denote coordinates of left endpoint and left endpoint, respectively. In polar coordinates, there are the following relationships:

$$\begin{aligned} \left\{ \begin{array}{ll} x_{a}(\theta )= x_{d}^{\mathrm{unc}}+R*cos(\theta ) \\ y_{a}(\theta )= y_{d}^{\mathrm{unc}}+R*sin(\theta ), \end{array}\right. \end{aligned}$$

where \(\theta \in [0,2\pi ]\). The sum of distances from the newly added SP to left endpoint \(w_{u}^{k,l}\) and right endpoint \(w_{u}^{k,r}\) is given by

$$\begin{aligned} D_{\mathrm{sum}}(\theta )&=\left\| w_{u}^{a} - w_{u}^{k,r}\right\| +\left\| w_{u}^{a} - w_{u}^{k,l}\right\| \\&=\sqrt{(x_{d}^{\mathrm{unc}}+R*cos(\theta )-x_{u}^{k,r})^{2}+(y_{d}^{\mathrm{unc}}+R*sin(\theta )-y_{u}^{k,r})^{2}}\\&\quad +\sqrt{(x_{d}^{\mathrm{unc}}+R*cos(\theta )-x_{u}^{k,l})^{2}+(y_{d}^{\mathrm{unc}}+R*sin(\theta )-y_{u}^{k,l})^{2}}, \end{aligned}$$

which is a nonlinear function about \(\theta\). Then make the derivative of formula (10) with respect to \(\theta\) equal to 0, that is

$$\begin{aligned} \frac{\mathrm {d}D_{\mathrm{sum}}(\theta )}{\mathrm {d}\theta }=0. \end{aligned}$$

Assume that \(\theta ^{*}\) is the solution of Eq. (12), \(w_{u}^{a*} (x_{a}(\theta ^{*}),y_{a}(\theta ^{*}))\) is the position of newly added SP. The points C and F in Fig. 2 are the corresponding optimization results.

SPSS is a decision-making process based on the relative position relationship between the trajectory and uncovered DUs. After obtaining clustering results, in order to avoid making large changes to trajectory as much as possible, we first determine whether there are DUs who can be covered by UAV through D2D communication. Then, according to the relationship between the distance from uncovered DUs to the trajectory and \(R_{\mathrm{max}}\), new SP is added. The specific decision-making process is shown in Fig. 3.

Fig. 3
figure 3

Illustration of stop point selection strategy

3.3 Minimum path selection strategy

After obtaining new SPs, how to construct discrete positions into a continuous trajectory is also an important issue. To keep the trajectory length as small as possible, we propose the minimum path selection strategy (MPSS). The UAV selects the nearest SP in turn from the origin until there is no SP remaining. For example, we obtained five SP positions as shown in Fig. 4 in the clustering phase. The trajectory route of scheme A is 1-2-3-4-5. The trajectory route of plan B is 1-2-5-3-4. Plan B is the trajectory result obtained by MPSS, and the trajectory length is significantly shorter than that of plan A.

In summary, set \({\mathbf{w}}_{u}^{k}\) is obtained by K-means algorithm in clustering phase and set \({\mathbf{w}}_{u}^{a}\) is obtained by SPSS in supplementary phase. Finally, the final trajectory is planned based on MPSS. The pseudo-code is summarized in Algorithm 1.

Fig. 4
figure 4

Schematic diagram of stop points connection

4 Sum-throughput optimization algorithm based on TLOA-IK

In the previous section, the primary optimization objective is trajectory length, so selection strategy for SPs requires that the closer the reference trajectory is, the better. Therefore, TLOA-IK ignores throughput performance of the ground DUs. In this section, we optimize TLOA-IK in the clustering phase and the supplementary phase to achieve the goal of improving sum throughput.

4.1 Optimization of the clustering phase

Algorithm 1 (TLOA-IK) determines whether there is D2D communication available after obtaining the initial SP \(w_{u}^{k}\) to cover as many users as possible without changing the initial trajectory. From this we can see that \(w_{u}^{k}\) is not the location set to get the best communication performance. Therefore, in this section, we aim to optimize the sum throughput of all DUs covered by a single SP. Assume that the coordinate of i-th SP is \(w_{u}^{k}[i]\) which has covered \(G_{i}\) DUs, the covered DU set is denoted as \(\mathcal{G_{i}}=\{1, 2, \ldots , G_{i\}}\). Thus, the sum throughput of \(\mathcal{G_{i}}\) when UAV hovers in \(w_{u}^{k}[i]\) can be expressed as

$$\begin{aligned} r_{i}^{k}&=\sum _{j=1}^{G_{i}}r_{i}^{k}[j]\\&=\sum _{j=1}^{G_{i}}Blog_{2}(1+\gamma _{i}[j]),j\in \mathcal{G_{i}}. \end{aligned}$$

Therefore, the optimization problem for maximizing sum throughput when UAV hovers in \(w_{u}^{k}[i]\) is formulated as

$$\begin{aligned} \text{(P2.1) } :\left\{ \begin{array}{ll} \mathrm{\mathrm{max}} &{}r_{i}^{k}\\ \text{ s.t. } &{}\left\| {\mathbf{w}}_{u}^{k}[i]-{\mathbf{w}}_{d}^{c}[j]\right\| \le R_{c}^{\mathrm{max}}, \quad \forall j \in \mathcal{G_{i}}. \end{array}\right. \end{aligned}$$

Restriction in P2.1 ensures normal communication of UAV-DU links, and it is obviously a convex constraint. However, due to the nonconvexity of objective function, P2.1 is not a convex optimization problem. To transform problem P2.1 into a solvable form, we utilize successive convex approximation (SCA) to improve sum throughput of DUs on the basis of TLOA-IK according to the following Lemma.

figure a
figure b


For \(w_{u,l+1}^{k}[i](x_{l+1},y_{l+1})\) the following inequalities hold

$$\begin{aligned} r_{i,l+1}^{k}[j]&\ge r_{i,l+1}^{k,lb}[j]\\&=r_{i,l}^{k}[j]+\alpha _{k,l} \delta x +\beta _{k,l} \delta y\\&=Blog_{2}\left( 1+\frac{\gamma _{0}^{u}}{\left( H^{2}+\left\| \mathrm w_{u,l}^{k}[i]-\mathrm {w}_{d}^{c}[j]\right\| ^{2}\right) ^{a / 2}}\right) +\alpha _{k,l} \delta x +\beta _{k,l} \delta y\\&=Blog_{2}\left( 1+\frac{\gamma _{0}^{u}}{\left( H^{2}+\left\| \mathrm w_{u,l}^{k}[i]-\mathrm {w}_{d}^{c}[j]\right\| ^{2}\right) ^{a / 2}}\right) +\alpha _{k,l} (x_{l+1}-x_{l}) \\&\quad +\beta _{k,l}(y_{l+1}-y_{l})\\ \end{aligned}$$

where l is the number of iterations, \(\alpha _{k,l}\) and \(\beta _{k,l}\) are coefficients given by (16).


We first define the function \(f(x,y)=log_{2}(1+\frac{c_{1}}{c_{2}+(x-a)^2+(y-b)^2})\), where \(c_{1}\), \(c_{2}\), a and b are constants. By leveraging the first-order Taylor approximation, for any given \((x_{0},y_{0})\), we have

$$\begin{aligned} f(x,y)\le f(x_{0},y_{0})+\frac{\partial }{\partial x}f(x_{0},y_{0})(x-x_{0})+\frac{\partial }{\partial y}f(x_{0},y_{0})(y-y_{0}) \end{aligned}$$


$$\begin{aligned} \frac{\partial }{\partial x}f(x_{0},y_{0})&=\frac{c_{1}(2a-2x_{0})}{log(2)\left( \frac{c_{1}}{c_{2}+(a-x)^2(b-y)^2+1}\right) (c_{2}+(a-x)^2+(b-y)^2)^2}\\&\triangleq \alpha _{k,l}\\ \frac{\partial }{\partial y }f(x_{0},y_{0})&=\frac{c_{1}(2b-2y_{0})}{log(2)\left( \frac{c_{1}}{c_{2}+(a-x)^2(b-y)^2+1}\right) (c_{2}+(a-x)^2+(b-y)^2)^2}\\&\triangleq \beta _{k,l}. \end{aligned}$$


Based on the lemma, the concave lower bounds of objective function at given \(w_{u,l+1}^{k}[i](x_{l+1},y_{l+1})\) are obtained. P2.1 can be further written as formula (17). Obviously, P2.2 is a convex optimization problem, which can be efficiently solved by iterations.

$$\begin{aligned} \text{(P2.2) } :\left\{ \begin{array}{ll} \mathrm{\mathrm{max}} &{} \sum _{j=1}^{G_{i}}r_{i,l+1}^{k,lb}[j]\\ \text{ s.t. } &{}\left\| {\mathbf{w}}_{u}^{k}[i]-{\mathbf{w}}_{d}^{c}[j])\right\| \le R_{c}^{\mathrm{max}}, \quad \forall j \in \mathcal{G_{i}}. \end{array}\right. \end{aligned}$$

4.2 Improvements in the supplementary phase

To keep the total length of the trajectory as small as possible, we proposed a SPSS strategy in TLOA-IK, but this is achieved at the expense of DUs’ sum throughput. The goal of this section is to improve the system’s sum-throughput performance, so the SPSS policy is no longer applicable. We assume that the altitude of the UAV does not change, while the DUs remain stationary during UAV flight. Obviously, the SP locations that maximize \(w_{d}^{\mathrm{unc}}\) throughput are directly above them, so we get \(w_{u}^{a}\). The implementation of the specific algorithm is summarized in Algorithm 2.

5 Balance optimization algorithm based on STOA-IK

Algorithm 2 is optimized in both the clustering and supplementary phases to improve sum throughput. During the clustering phase, better throughput performance can be obtained because there is little impact on the trajectory before and after optimization. However, the supplementary phase is an increase in throughput in exchange for an increase in the length of the trajectory. Therefore, it is necessary to weigh the relationship between throughput and trajectory length effectively in supplementary phase. In this section, we put forward a joint evaluation index to balance sum throughput and trajectory, and then use this index to optimize STOA-IK, to obtain a better performance algorithm in both sum throughput and trajectory.

figure c

5.1 A joint evaluation index

Our goal is to keep trajectory length as small as possible while maintaining maximum sum throughput. Therefore, we propose the following joint evaluation index

$$\begin{aligned} \rho _{e}=\frac{\gamma _{\mathrm{sum}}}{\upsilon _{b}}-\frac{L_{\mathrm{sum}}}{\mu _{b}} \end{aligned}$$

where \(\gamma _{\mathrm{sum}}\) is the sum throughput received by all terrestrial DUs, \(L_{\mathrm{sum}}\) is the length of UAV’s trajectory, \(\upsilon _{b}\) and \(\mu _{b}\) are the sum throughput and trajectory length of the benchmark, respectively.

This paper considers “strip-based waypoints (SBW)” as the benchmark planning trajectory [9]. First, get the minimum rectangle that contains all DUs and then divide the rectangle area into multiple rectangular bars with a width of R. The UAV starts from origin and flies in a snake-like fashion. When DUs are observed, the UAV hovers to provide communication services, as shown in Figs. 6a and 7a.

5.2 Joint optimization

Although STOA-IK optimizes sum throughput, it does not have a significant negative impact on the overall trajectory in this step. The main factor that affects trajectory length of STOA-IK is the locations of newly added SPs. Therefore, algorithm 3 will follow the optimization process of P2.2 in algorithm 2 and mainly perform joint optimization on the locations of the newly added SPs. For DUs that have not been covered by reference trajectory, the joint evaluation index is given as

$$\begin{aligned} \rho _{e}^{a}=\frac{\gamma _{g}^{a}}{\upsilon _{b}}-\frac{L_{p,q}^{g}}{\mu _{b}} \end{aligned}$$


$$\begin{aligned} \gamma _{g}^{a}=Blog_{2}(1+\frac{\gamma _{0}^{u}}{\left( H^{2}+\left\| {\mathbf{w}}_{u}^{a}[g]-\mathrm {w}_{d}^{\mathrm{unc}}[g]\right\| ^{2}\right) ^{\alpha / 2}}{,} \end{aligned}$$


$$\begin{aligned} L_{p,q}^{g}=\left\| {\mathbf{w}}_{u}^{k}[p]-{\mathbf{w}}_{u}^{a}[g]\right\| +\left\| {\mathbf{w}}_{u}^{k}[q]-{\mathbf{w}}_{u}^{a}[g]\right\| {.} \end{aligned}$$

\(\gamma _{g}^{a}\) is the throughput received by \({\mathbf{w}}_{d}^{\mathrm{unc}}[g]\) when UAV hovers over \({\mathbf{w}}_{u}^{a}[g]\). \(L_{p,q}^{g}\) is the sum of the distances from \({\mathbf{w}}_{u}^{a}[g]\) to \({\mathbf{w}}_{u}^{k}[p]\) and \({\mathbf{w}}_{u}^{k}[q]\). Therefore, \(\rho _{e}^{a}\)-based optimization for \({\mathbf{w}}_{u}^{a}[g]\) can be expressed as follows

$$\begin{aligned} \text{(P3) } :\left\{ \begin{array}{ll} \mathrm{\mathrm{max}} &{} \rho _{e}^{a}\\ \text{ s.t. } &{}\left\| {\mathbf{w}}_{u}^{a}[g]-{\mathbf{w}}_{d}^{\mathrm{unc}}[g]\right\| \le R_{c}^{\mathrm{max}}. \end{array}\right. \end{aligned}$$

P3 is a nonlinear optimization problem, which can be solved by algorithms such as interior point method or some iterative search algorithms [16].

This section optimizes the selection of stop points in the supplementary phase while retaining the \(w_{u}^{k}\) obtained by STOA-IK in the clustering phase. And considering the influence of SP position on trajectory and throughput, BOA-IK is proposed. The specific process is summarized in Algorithm 3.

Table 2 Simulation parameters

6 Summary and comparison of the three algorithms

In this section, we summarize and compare the three algorithms proposed and further illustrate their relationships. In clustering phase, all three algorithms depend on initial SPs obtained by K-means. Algorithm 1 (TLOA-IK) does not do any additional processing to avoid increasing trajectory length, while both algorithm 2 (STOA-IK) and algorithm 3 (BOA-IK) can further optimize initial SPs to improve performance of DUs’ sum throughput. In supplementary phase, TLOA-IK adopts SPSS to ensure that trajectory length changes as small as possible while adding SPs. To further improve sum throughput, SPs are supplemented by locations directly above the DUs that are not covered by the initial SPs in STOA-IK. To balance the relationship between trajectory length and sum throughput in the supplement phase, we propose a joint evaluation index in BOA-IK and use it as the optimization objective in the supplement phase. For ease of understanding, we summarize the three algorithms as shown in Fig. 5.

Fig. 5
figure 5

Comparison of three algorithmic processes and goals

The complexity of TLOA-IK comes from K-means in the clustering phase and SPSS in the supplementary phase, so the total complexity is \({\mathcal{O}}\left( 2L_{1}KN+N\right)\), which can be simplified to \({\mathcal{O}}\left( N\right)\). The complexity of STOA-IK comes from K-means in the clustering stage and solving P2.2, so the total complexity is \({\mathcal{O}}\left( 2L_{1}KN+L_{2}KN^{3}\right)\) , which can be simplified to \({\mathcal{O}}\left( N^{3}\right)\). The first two aspects of the complexity of BOA-IK are the same as those of Algorithm 2, and the third aspect comes from solving P3. The total complexity of BOA-IK is \({\mathcal{O}}\left( 2L_{1}KN+L_{2}KN^{3}+L_{3}N^{3}\right)\) , which can be simplified to \({\mathcal{O}}\left( N^{3}\right)\). Among them, \(L_{1}\), \(L_{2}\), and \(L_{3}\) are the number of iterations for executing K-means and solving P2.2 and P3, respectively. It can be seen that the optimization of sum throughput will bring higher complexity.

7 Simulation and analysis

We assume that DUs are distributed in a \(2000\times 2000\) square area, and UAV starts from the coordinate origin and does not need to return to the starting point after completing the coverage task and does not consider changes in speed. The main simulation parameters are listed in Table 2.

Fig. 6
figure 6

The trajectory planning results of each algorithm when \(\lambda =15\)

Figure 6 shows the trajectory planning result when \(\lambda =15\). Figure 6a is the planning result of strip-based waypoints algorithm. UAV moves along the planned path (blue dashed line), and it stops to provide service if DUs are detected. The blue dashed line in Fig. 6b is the reference trajectory of the initial SPs clustered by K-means and serves as the basis for adding SPs later. The red dashed line is the final planning result. As can be seen from the figure, the new stops \(W_{A}\) and \(W_{C}\) adopts policy Adding new SP, Trajectory Changed, and \(W_{B}\) is the planning result of policy Adding new SP, Trajectory Unchanged. Figure 6c shows that the initial SP coordinate is optimized from (1779, 1365) to (1702, 1464). It can be clearly found from Fig. 6d that trajectory length is greatly reduced with full coverage guaranteed.

Fig. 7
figure 7

The trajectory planning results of each algorithm when \(\lambda =20\)

Figure 7 shows the trajectory planning result when \(\lambda=20\). Figure 7a is also the planning result of the strip-based waypoints algorithm, and the number of SP is increased due to the increased user density compared to Fig. 6a. Figure 7b is the planning result of algorithm 1, \(W_{D}\), \(W_{E}\) are the results of policy Adding new SP, Trajectory Changed, and \(W_{F}\) is the result of policy Adding new SP, Trajectory Unchanged. Figure 7c is the planning result of algorithm 2. Obviously, in order to increase throughput, trajectory length of UAV has increased significantly, and SP coordinate is optimized from (1416, 927.7) to (1378, 890.2). Figure 7d is the optimization result of algorithm 3. In order to balance the increase in trajectory length, multiple groups of users use D2D communication mode, which can improve sum throughput and effectively reduce trajectory length.

Fig. 8
figure 8

Trajectory length and sum-throughput performance of each algorithm under different DU density

Figures 6 and 7 visually reflect the planning results of each algorithm. Figure 8 gives a more intuitive data representation of each algorithm in terms of sum throughput and trajectory length using data. Figure 8a shows the planning results for each algorithm under the distribution of \(\lambda =15\). Figure 8b shows the planning results for each algorithm under the distribution of \(\lambda =20\). It is clear that STOA-IK increases sum throughput while incurring the cost of increasing trajectory. In contrast, BOA-IK is more balanced in both ways.

Fig. 9
figure 9

Joint evaluation index performance of each algorithm under different DU density

Figure 9 shows the \(\rho _{e}\) performance of algorithms 1–3 under different \(\lambda\). As can be seen from the figure, BOA-IK is significantly higher than STOA-IK and TLOA-IK when \(\lambda =16\). Since STOA-IK and TLOA-IK already have preferable planning results when \(\lambda =20\), the improvement of BOA-IK is not obvious. However, no matter how density changes, the performance of algorithms is always BOA-IK > STOA-IK >TLOA-IK.

8 Conclusion

This paper considers an emergency network scenario where a UAV base station coexists with potential underlaying D2D communications. In order to save UAV energy consumption and improve the communication quality of ground DUs, three kinds of UAV trajectory optimization algorithms based on K-means are proposed, which include trajectory length, sum throughput and joint evaluation index of the two. Planning process of each algorithm is composed of two phases: the clustering phase and the supplementary phase. The results of this study indicate that proposed design algorithms have advantages in both trajectory length and sum throughput compared with benchmark plan. This paper is only applicable to the situation where locations of the ground terminals are given and stationary. The proposed algorithms can perform offline planning based on the user’s location coordinates. It is not applicable to scenarios where ground terminals change dynamically, so there are certain limitations.

Availability of data and materials

Not applicable.



Fifth-generation wireless systems




Unmanned aerial vehicle


Internet of things


Base station


Ground terminal


Stop point


D2D user


Successive convex approximation


Signal-to-noise ratio


Additive white Gaussian noise


Stop point selection strategy


Sum of squared errors


Minimum path selection strategy


  1. A. Asadi, Q. Wang, V. Mancuso, A survey on device-to-device communication in cellular networks. IEEE Communications Surveys Tutorials 16(4), 1801–1819 (2014).

    Article  Google Scholar 

  2. I. Bucaille, S. Hethuin, A. Munari, R. Hermenier, T. Rasheed, S. Allsopp, Rapidly deployable network for tactical applications: aerial base station with opportunistic links for unattended and temporary events absolute example, pp. 1116–1120 (2013)

  3. J. Lyu, Y. Zeng, R. Zhang, T.J. Lim, Placement optimization of UAV-mounted mobile base stations. IEEE Commun. Lett. 9(99), 1 (2016)

    Google Scholar 

  4. X. Yue, W. Zhang, UAV path planning based on k-means algorithm and simulated annealing algorithm, in 2018 37th Chinese Control Conference (CCC) (IEEE, 2018), pp. 2290–2295

  5. T. Schouwenaars, B.D. Moor, E. Feron, J. How, B. Demoor, E. Frazzoli, M.A. Dahleh, Mixed integer programming for multi-vehicle path planning, in Control Conference (2015)

  6. J. Xu, Y. Zeng, R. Zhang, UAV-enabled wireless power transfer: trajectory design and energy region characterization, in 2017 IEEE Globecom Workshops (GC Wkshps), vol. 17, pp. 5092–5106 (2017)

  7. Q. Wu, Y. Zeng, R. Zhang, Joint trajectory and communication design for multi-uav enabled wireless networks. IEEE Trans. Wireless Commun. 17(3), 2109–2121 (2018)

    Article  Google Scholar 

  8. R.I.B. Yaliniz, A. El-Keyi, H. Yanikomeroglu, Efficient 3-D placement of an aerial base station in next generation cellular networks (2016)

  9. Y. Zeng, X. Xu, R. Zhang, Trajectory design for completion time minimization in UAV-enabled multicasting. IEEE Trans. Wirel. Commun. 7(4), 2233–2246 (2018).

    Article  Google Scholar 

  10. B. Galkin, J. Kibilda, L.A. Dasilva, Deployment of UAV-mounted access points according to spatial user locations in two-tier cellular networks, in Wireless Days, pp. 1–6 (2016)

  11. M. Mozaffari, W. Saad, M. Bennis, M. Debbah, Unmanned aerial vehicle with underlaid device-to-device communications: performance and tradeoffs. IEEE Trans. Wirel. ss Commun. 15(6), 3949–3963 (2016)

    Article  Google Scholar 

  12. J. Ji, K. Zhu, D. Niyato, R. Wang, Probabilistic cache placement in UAV-assisted networks with d2d connections: performance analysis and trajectory optimization. IEEE Trans. Commun. 9(99), 1 (2020)

    Google Scholar 

  13. Y. Zeng, R. Zhang, T.J. Lim, Throughput maximization for UAV-enabled mobile relaying systems. IEEE Trans. Commun. 64, 4983–4996 (2016).

    Article  Google Scholar 

  14. A. Srinivas, G. Zussman, E.H. Modiano, Construction and maintenance of wireless mobile backbone networks. IEEE/ACM Trans. Networking 17(1), 239–252 (2009)

    Article  Google Scholar 

  15. Y. Zhou, R. Xie, T. Zhang, J. Holguin-Veras, Joint distribution center location problem for restaurant industry based on improved k-means algorithm with penalty. IEEE Access 9(99), 1 (2020)

    Google Scholar 

  16. H. Long, W. Xiang, Y. Zhang, Y. Liu and W. Wang, Secrecy capacity enhancement with distributed precoding in multirelay wiretap systems. IEEE Trans. Inf. Forensics Secur. 8(1), 229–238 (2013)

Download references





Author information

Authors and Affiliations



All authors contributed to the idea development, study design, theory, result analysis and article writing. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Shuo Shi.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare that they have no competing interests..

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhang, S., Shi, S., Feng, T. et al. Trajectory planning in UAV emergency networks with potential underlaying D2D communication based on K-means. J Wireless Com Network 2021, 107 (2021).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI:


  • Unmanned aerial vehicle (UAV)
  • Device-to-device (D2D)
  • Trajectory planning
  • Sum-throughput optimization