1 Introduction

The new 5G mobile networks have the main advantage of being able to provide connections, even with a large number of connected users and devices. Each application or network service requested by users and devices has different requirements, but the 5G Network Slicing manages to guarantee a certain efficiency in infrastructure sharing scenarios. The main features of the 5G Network Slicing are: flexibility, common infrastructure, isolation and dedicated network. A fleet of Unmanned Aerial Vehicles (UAVs), such as drones, constitutes the 5G network infrastructure whose architecture is composed by different layers. The aim of this paper is to present a network-based optimization model that allows us to better manage the application and network services instances requested by users and devices on the ground, which represent the lower level of the network. Such services are executed by a fleet of UAVs at the highest level of the network. The second level, generically denoted as controller layer, consists of controller UAVs, that manage and monitor the functionalities between the layers in order to efficiently coordinate the service requests. In this paper, we study a more comprehensive and extensive model than the ones presented in the literature (see, for instance, Galluccio et al. 2019; Grasso and Schembra 2019), since we complete the forward chain by adding a reverse chain where users and devices receive the performed services.

The remainder of the paper is structured as follows. Section 2 reports a review of the main contributions in literature. A formal description of the problem and the mathematical model are given in Section 3. Section 4 is devoted to the presentation of the variational formulation. In Section 6, we perform an illustrative numerical simulation to validate the effectiveness of the proposed model. Finally, Section 7 provides the conclusions.

2 Literature Review

In the literature, several works have dealt with providing a mathematical formulation of the main characteristics concerning 5G networks. In Addad et al. (2018) propose a MILP optimization model that enables a cost-optimal deployment of network slices, allowing a Mobile Network Operator to efficiently allocate the underlying layer resources according to the users’ requirements. The objective function of the proposed model aims to minimize the number of nodes hosting the Network Functions that constitute different network slices under placement, resources, links arrangements, latency aware and bandwidth aware constraints. In Colajanni and Sciacca (2021) is proposed a three-tier supply chain network model consisting of a fleet of UAVs organized as a FANET (Flying ad hoc network) connected one to each other with direct wireless links, managed by a fleet of UAV controllers, whose purpose is to provide 5G network slices on demand to users and devices on the ground. Providing a system optimization perspective for the entire supply chain network, authors aim to determine the optimal distributions of request flows as a solution of a variational inequality problem. In Di Puglia Pugliese et al. (2021), Di Puglia et al. address the problem of delivering parcels in a urban area, within a given time horizon, by conventional vehicles, i.e., trucks, equipped with drones. Focusing on the energy consumption of the drones, they address the problem under the field of robust optimization, thus preventing energy disruption in the worst case, minimizing the total transportation cost. In Fan et al. (2021) study a UAVs system task assignment model (see Macrina et al. (2020) for an extensive review on the use of drones in various applications, especially in routing problems in the context of parcel delivery) with multiple constraints and propose a discrete adaptive search whale optimization algorithm to solve it. Fu et al. in (2018) deal with the relay in smart industrial wireless sensor networks (WSN), employing UAV as the relay in WSN, which can move in three-dimensional space to possess a better position to minimize the system power consumption. Gonzalez et al. (see Santoyo-González and Cervelló-Pastor (2018)), dealing with the latency problem in 5G use case scenarios, aim to model mathematically the service infrastructure placement problem, to minimize the delays in the service access layer. They provide a Fog Computing/NFV environment as a Mixed-Integer Linear Programming problem and propose a heuristic-based solution considering 5G mobile network requirements. In Skondras et al. (2021), Skondras et al. propose a network slicing scheme for 5G vehicular networks that aims to optimize the performance of modern network services. In particular, the proposed network architecture consists of UAVs acting as aerial relay nodes (ARNs) and road side units (RSUs) that provide communication resources to vehicular users. In addiction, the satisfaction grade of each user service is monitored considering both the QoS and the the signal-to-noise plus interference (SINR) factors. In Zhang et al. (2018) an integer optimization for the Network Function Virtualization (NFV) placement and chaining problem is formulated and it is mapped to min-cost flow problem. By relaxing the integer optimization problem into a linear programming one, authors propose efficient algorithms by selecting a small number of min-cost flow problems.

In this paper, in addition to the closed loop already mentioned in the Introduction, we introduce the reliability of the UAVs (which can fail during the flight or their battery can run out) and the consequent damage to be paid in the event of unperformed services, the possibility of adding additional UAVs, the evaluation of the quality level (with a quality constraint on the minimum guaranteed) and a budget constraint on the cost to increase the reliability of the pre-existing UAVs and to add new UAVs.

Fig. 1
figure 1

Network Topology

3 The Optimization Model Based on a Closed Loop Network

The supply chain network, consisting of a fleet of \(F_{3}\) UAVs (divided in two sets: \(\hat{\mathcal F}_{1}=\{ \hat{1},\;...,\; \hat{f}, \;...,\;\hat{F}_{1}\}\), the set of pre-existing UAVs and \(\tilde{\mathcal F}_{2}=\{ \tilde{1},\;...,\; \tilde{f}, \;...,\;\tilde{F}_{2}\}\), the set of possible additional UAVs, where \(F_{3}=\hat{F}_{1}+\tilde{F}_{2}\)), D controller UAVs and U users or devices on the ground, is depicted in Fig. 1 (see Colajanni and Daniele (2019) for another optimization model based on supply chain network, Colajanni and Daniele (2018) and Fargetta and Scrimali (2022) for other optimization models on closed-loop chains, and Khan and Abonyi (2022) for digital data sharing across the supply chains). The typical user or device on the ground is denoted by u, and could require S types of network or application services. Each controller UAV d, receives the requests for service s from users and devices and transmits them to the fleet of UAVs at the higher level. Each UAV \(f\in {\mathcal F}_{3}=\hat{\mathcal F}_{1} \cup \tilde{\mathcal F}_{2}= \{ \hat{1},\;...,\; \hat{f}, \;...,\;\hat{F}_{1},\; \tilde{1},\;...,\; \tilde{f}, \;...,\;\tilde{F}_{2}\}\) of the upper level receives the services requests from the controller UAVs and performs the executions (forward chain). Moreover, the same fleet of UAVs, after performing, sends the executed services to users and devices on the ground that had requested them (reverse chain). Therefore, since the fleet of UAVs and the users and devices belong to both the forward and reverse chain, we analyze a closed loop Multi-layer 5G Network.

The purpose of this paper is to determine a model that allows us to maximize the total profit (defined by the difference between the revenue and the sum of costs) and quality, while minimizing the penalty costs. The variables of the model are reported in Table 1.

Table 1 Variables notation and description

We underline that UAVs can fail during the flight (or their battery can run out) and such UAV failures can result in consumer dissatisfaction and loss of demand. Therefore, we consider the variable reliability of UAVs in a supply chain network to minimize the damage created by unmet demand. Moreover, the more reliable the network is, the less amount of services requests will be lost and the higher quality will be obtained. Note that such a variable belongs into the interval [0, 1] and for a given pre-existing UAV \(\hat{f}\in \hat{\mathcal {F}}_{1}\), \(a_{\hat{f}}=0\) denotes an entirely unreliable UAV, while \(a_{\hat{f}}=1\) denotes a completely reliable UAV. Moreover, for any additional UAV \(\tilde{f}\in \tilde{\mathcal {F}}_{2}\), without loss of generality, we are assuming total reliability (\(a_{\tilde{f}}=1\)) because they are new in the network and their probability of failure is almost nil.

For simplicity of notations, we group:

  • the quantities \(q_{uds}\), for all s into the vector \(Q^1_{ud}\) and for all u and for all d into the vector \(Q^1\);

  • the quantities \(q_{d\hat{f}s}\), for all s into the vector \(Q^2_{d\hat{f}}\), for all d into the vector \(Q^2_{\hat{f}s}\), for all d and for all s into the vector \(Q^2_{\hat{f}}\). We group, in turn, for all \(\hat{f}\) into the vector \(Q^2\);

  • the quantities \(q_{d\tilde{f}s}\), for all s into the vector \(Q^3_{d\tilde{f}}\), for all d into the vector \(Q^3_{\tilde{f}}\) and for all \(\tilde{f}\) into the vector \(Q^3\);

  • the quantities \(q_{fus}\), for all s into the vector \(Q^4_{fu}\), for all f into the vector \(Q^4_{us}\). We group, in turn, the quantities \(Q^4_{us}\) for all u into the vector \(Q^4_{s}\) and, finally, for all s into the vector \(Q^4\);

  • the quantities \(a_{\hat{f}}\), for all \(\hat{f}\) into the vector A.

Now, we present the parameters and cost functions. Let:

  • \(R_{us}\) be the total demand from the user or device u, for the application service or network service s, \(\forall u=1,\ldots ,U,\; \forall s=1,\ldots ,S\);

  • \(c_{ud}\) be the cost for transmission of the services requests on links between user or device u and controller UAV d and let us assume \(c_{ud}\) is a function of the transmitted quantity:

    $$\begin{aligned} c_{ud}=c_{ud}\displaystyle \left( \sum _{s=1}^S{q_{uds}}\right) = c_{ud}( {Q_{ud}^1}), \quad \forall u=1,\ldots ,U,\; \forall d=1,\ldots ,D; \end{aligned}$$
  • \(\overline{C}_d\) be the maximum capacity of service requests that the controller UAV d is able to manage, \(\forall d=1,\ldots ,D\);

  • \(c_{df}\) be the transmission cost of the services requests from controller UAV d to any UAV \(f \in {\mathcal {F}}_{3}\) at the highest level of the network and let us assume that such a cost is a function of the transmitted quantity:

    $$\begin{aligned} c_{df}=c_{df}\left( \sum _{s=1}^S{q_{dfs}}\right) , \quad \forall d=1,\ldots ,D,\; \forall f \in {\mathcal {F}}_{3}, \end{aligned}$$

    that is \(c_{d\hat{f}}=c_{d\hat{f}}({Q_{d\hat{f}}^2}), \quad \forall d=1,\ldots ,D,\; \forall \hat{f}\in \hat{{\mathcal {F}}}_{1}\) and \(c_{d\tilde{f}}=c_{d\tilde{f}}({Q_{d\tilde{f}}^3}), \quad \forall d=1,\ldots ,D,\; \forall \tilde{f}\in \tilde{{\mathcal {F}}}_{2}\);

  • \(c_{\hat{f}}^{(E)}\) and \(c_{\tilde{f}}^{(E)}\) be the performing costs of requested services to the UAV \(\hat{f}\in \hat{\mathcal {F}}_{1}\) and \(\tilde{f}\in \tilde{\mathcal {F}}_{2}\), respectively, and let us assume they are functions of the total amount of executed services:

    $$\begin{aligned} \displaystyle c_{\hat{f}}^{(E)}=c_{\hat{f}}^{(E)}\left( {a_{\hat{f}}\cdot \sum _{d=1}^{D}\sum _{s=1}^S q_{d\hat{f}s}} \right) =c_{\hat{f}}^{(E)}\left( {a_{\hat{f}},Q^2_{\hat{f}}} \right) ,\quad \forall \hat{f}\in \hat{\mathcal {F}}_{1}, \end{aligned}$$

    and

    $$\begin{aligned} \displaystyle c_{\tilde{f}}^{(E)}=c_{\tilde{f}}^{(E)}\left( { \sum _{d=1}^{D}\sum _{s=1}^S q_{d\tilde{f}s}} \right) =c_{\tilde{f}}^{(E)}\left( {Q^3_{\tilde{f}}} \right) ,\quad \forall \tilde{f}\in \tilde{\mathcal {F}}_{2}; \end{aligned}$$
  • \(e_s\) be the computing space requested to perform service s, \(s=1,\ldots , S\);

  • \(\overline{C}_f\) be the maximum capacity or execution space allowed on the UAV f, \(\forall f \in \mathcal {F}_3\);

  • \(c_{\hat{f}}\) be the investment cost function in order to increase the reliability level \(a_{\hat{f}}\) of the pre-existing UAV \(\hat{f}\in \hat{\mathcal {F}}_{1}\) and let us assume \(c_{\hat{f}}\) is a function of both the reliability level and the quantity of services requests that \(\hat{f}\) receives:

    $$\begin{aligned} c_{\hat{f}}\left( a_{\hat{f}},\sum _{d=1}^D\sum _{s=1}^S q_{d\hat{f}s}\right) =c_{\hat{f}}\left( a_{\hat{f}},Q^2_{\hat{f}} \right) ,\quad \forall \hat{f}\in \hat{\mathcal {F}}_{1}; \end{aligned}$$
  • \(P_s\) be the damage to be paid for each service-s request not executed due to the unreliability of the UAV \(\hat{f}\in \hat{\mathcal {F}}_{1}\), \(\forall s=1,\ldots ,S;\) therefore, the total penalty cost to be paid for each UAV \(\hat{f}\in \hat{\mathcal {F}}_{1}\) is given by:

    $$\begin{aligned} (1-a_{\hat{f}})\cdot \left( \sum _{s=1}^S{P_s \cdot \left( \sum _{d=1}^D q_{d\hat{f}s}\right) }\right) ; \end{aligned}$$
  • \(c_{\tilde{f}}\) be the cost due to add an additional UAV \(\tilde{f}\in \tilde{\mathcal {F}}_{2}\) in the upper tier fleet and let us assume such a cost is a function of the flow of requests received:

    $$\begin{aligned} c_{\tilde{f}}\left( \sum _{d=1}^D\sum _{s=1}^S q_{d\tilde{f}s}\right) =c_{\tilde{f}}\left( Q_{\tilde{f}}^{3}\right) , \quad \forall \tilde{f}\in \tilde{\mathcal {F}}_{2}, \end{aligned}$$

    we will assume this function in such a way that it is null in the event that no service request is sent to the UAV \(\tilde{f}\);

  • \(\overline{B}\) be the maximum budget to increase the reliability and to add new UAVs at the highest level of the network;

  • \(c_{fu}\) be the transaction cost of the services from any UAV \(f \in {\mathcal {F}}_{3}\) in the upper tier fleet to user or device u on the ground and let us assume \(c_{fu}\) is a function of the amount of services transferred \(\displaystyle \sum _{s=1}^S{q_{fus}}\):

    $$\begin{aligned} c_{fu}=c_{fu}\left( \sum _{s=1}^S{q_{fus}}\right) =c_{fu}\left( {Q_{fu}^4}\right) , \quad \forall f \in {\mathcal {F}}_{3},\; \forall u=1,\ldots ,U; \end{aligned}$$
  • \(\psi _{us}\) be the quality function related to the service s and the user or device u, \(\forall u=1,\ldots ,U,\; \forall s=1,\ldots ,S\), and let us assume \(\psi _{us}\) is an increasing function of the executed services:

    $$\begin{aligned} \psi _{us}=\psi _{us}\left( \sum _{f \in \mathcal {F}_{3}}{q_{fus}} \right) =\psi _{us}\left( {Q^4_{usk}} \right) , \quad \forall u=1,\ldots ,U,\;\forall s=1,\ldots ,S; \end{aligned}$$

    such a function enables distinct users or devices to have different qualities associated to each service;

  • \(\alpha _s\) be a parameter that allows to express the quality in terms of profit (unit benefit associated to the quality); hence, the revenue that the provider receives is given by the product between \(\alpha _s\) and the sum of the qualities of any user or device u on the ground:

    $$\begin{aligned} \alpha _s \cdot \left( \sum _{u=1}^U {\psi _{us}\left( \sum _{f \in \mathcal {F}_{3}}{q_{fus}} \right) }\right) ; \end{aligned}$$
  • \(\underline{\psi }_{us}\) be the minimum quality of the service (QoS) \(s,\; \forall s=1,\ldots , S\), guaranteed to user \(u,\; \forall u=1,\ldots ,U\) by the service-level agreement (SLA);

  • \(\rho _s\) be the revenue obtained for a unit of service s executed and sent to the users and devices on the ground, \(\forall s=1,\ldots , S\).

The presented model aims at determining the optimal distributions of requests and services flows, and the optimal reliability levels. The objective function consists of the profit to maximize and is given by the total revenue obtained from the sale of services to users and devices on the ground, to which all transmission, execution and transaction costs are subtracted, as well as the investment costs to increase the reliability of the fleet UAVs, the costs for additional UAVs and the total penalty costs are subtracted, while the quality in terms of profit is summed.

The problem formulation is as follows:

$$\begin{aligned} \begin{aligned}&\max \left\{ \displaystyle \sum _{f \in \mathcal {F}_{3}}\sum _{u=1}^U\sum _{s=1}^S{\rho _{s}q_{fus}}- \sum _{u=1}^U\sum _{d=1}^D c_{ud}\left( \sum _{s=1}^S{q_{uds}} \right) - \sum _{d=1}^D\sum _{f \in \mathcal {F}_{3}} c_{df}\left( \sum _{s=1}^S{q_{dfs}} \right) \right.&\\&\left. \displaystyle -\sum _{f \in \mathcal {F}_{3}}\sum _{u=1}^U {c_{fu}\left( \sum _{s=1}^S{q_{fus}} \right) } -\sum _{\hat{f} \in \hat{\mathcal {F}}_{1}} {c_{\hat{f}}^{(E)}\left( {a_{\hat{f}}\cdot \sum _{d=1}^{D}\sum _{s=1}^S q_{d\hat{f}s}} \right) }- \sum _{\tilde{f} \in \tilde{\mathcal {F}}_2} {c_{\tilde{f}}^{(E)}\left( \sum _{d=1}^D\sum _{s=1}^S{q_{d\tilde{f}s}} \right) }\right.&\\&\left. \displaystyle - \sum _{\tilde{f}\in \tilde{\mathcal {F}}_2}{c_{\tilde{f}}\left( \sum _{d=1}^D\sum _{s=1}^S q_{d\tilde{f}s}\right) } + \sum _{s=1}^S \alpha _s \cdot \left( \sum _{u=1}^U {\psi _{us}\left( \sum _{f \in \mathcal {F}_{3}}{q_{fus}} \right) }\right) \right.&\\&\left. \displaystyle - \sum _{\hat{f}\in \hat{\mathcal {F}}_1} {(1-a_{\hat{f}})\cdot \left( \sum _{s=1}^S{P_s \cdot \left( \sum _{d=1}^D q_{d\hat{f}s}\right) }\right) } - \sum _{\hat{f}\in \hat{\mathcal {F}}_1}{c_{\hat{f}}\left( a_{\hat{f}},\sum _{d=1}^D\sum _{s=1}^S q_{d\hat{f}s}\right) }\right\} \end{aligned} \end{aligned}$$
(1)

subject to

$$\begin{aligned} \displaystyle \sum _{d=1}^Dq_{uds}= R_{us} \quad \forall u=1,\ldots ,U,\; \forall s=1,\ldots ,S, \end{aligned}$$
(2)
$$\begin{aligned} \displaystyle \sum _{s=1}^S\sum _{u=1}^Uq_{uds} \le \bar{C}_{d} \quad \forall d=1,\ldots ,D, \end{aligned}$$
(3)
$$\begin{aligned} \displaystyle \sum _{\hat{f}\in \hat{\mathcal {F}}_1}q_{d\hat{f}s}+\sum _{\tilde{f}\in \tilde{\mathcal {F}}_2}q_{d\tilde{f}s} \le \sum _{u=1}^U q_{uds} \quad \forall d=1,\ldots ,D,\; \forall s=1,\ldots ,S, \end{aligned}$$
(4)
$$\begin{aligned} \displaystyle \sum _{d=1}^D\sum _{s=1}^S e_s q_{dfs} \le \bar{C}_{f} \quad \forall f\in \mathcal {F}_{3}, \end{aligned}$$
(5)
$$\begin{aligned} \displaystyle \sum _{u=1}^U q_{\hat{f}us} =a_{\hat{f}}\cdot \left( \sum _{d=1}^D q_{d\hat{f}s} \right) \quad \forall \hat{f}\in \hat{\mathcal {F}}_{1},\; \forall s=1,\ldots ,S, \end{aligned}$$
(6)
$$\begin{aligned} \displaystyle \sum _{u=1}^U q_{\tilde{f}us} = \sum _{d=1}^D q_{d\tilde{f}s} \quad \forall \tilde{f}\in \tilde{\mathcal {F}}_{2},\; \forall s=1,\ldots ,S, \end{aligned}$$
(7)
$$\begin{aligned} \displaystyle \sum _{{f}\in {\mathcal {F}}_3}{q_{fus}}\le R_{us} \quad \forall u=1,\ldots ,U,\; \forall s=1,\ldots ,S, \end{aligned}$$
(8)
$$\begin{aligned} \displaystyle \sum _{\hat{f}\in \hat{\mathcal {F}}_1}{c_{\hat{f}}\left( a_{\hat{f}},\sum _{d=1}^D\sum _{s=1}^S q_{d\hat{f}s} \right) } + \sum _{\tilde{f}\in \tilde{\mathcal {F}}_{2}} {c_{\tilde{f}}\left( \sum _{d=1}^D\sum _{s=1}^S q_{d\tilde{f}s}\right) } \le \overline{B}, \end{aligned}$$
(9)
$$\begin{aligned} \begin{aligned}&\displaystyle \psi _{us}\left( \sum _{f \in \mathcal {F}_{3}}{q_{fus}} \right) \ge \underline{\psi }_{us} \quad \forall u=1,\ldots ,U,\; \forall s=1,\ldots ,S,\\&\displaystyle q_{uds},q_{d\hat{f}s},q_{d\tilde{f}s},q_{fus}\in \mathbb {R}_+,\; \forall u=1,\ldots ,U,\;\forall d=1,\ldots ,D, \end{aligned} \end{aligned}$$
(10)
$$\begin{aligned} \forall \hat{f}\in \hat{\mathcal {F}}_1,\; \forall \tilde{f}\in \tilde{\mathcal {F}}_2,\; \forall f\in \mathcal {F}_3,\; \forall s=1,\ldots ,S, \end{aligned}$$
(11)
$$\begin{aligned} \displaystyle a_{\hat{f}}\in [0,1] \quad \forall \hat{f}\in \hat{\mathcal {F}}_{1}. \end{aligned}$$
(12)

According to the first constraint, (2), the demand of service s by user or device u equals the sum of quantities requested to all controller UAVs. Constraint (3) states that the maximum capacity \(\bar{C}_d\) for controller UAV d is not exceeded. Constraint (4) establishes that all the UAVs of the fleet (pre-existing and additional) receive an amount of requests from the controller UAV d that is less than or equal to the sum of requests that such controller UAV receives by all users or devices on the ground. Inequality (5) represents the capacity constraint and affirms that the computing space must not exceed the maximum allowed. Constraints (6) and (7) determine the equality, for each service, between the quantity of requests received (by all the controller UAVs) and the quantity of the performed services multiplied by the reliability level of the considered UAV. Constraint (8) guarantees that each user or device u cannot receive more services than requested. Constraint (9) affirms that the costs to increase the reliability level of the pre-existing UAV and to add new UAVs at the highest level of the network do not exceed the maximum available budget. Constraint (10) guarantees that the QoS defined in the SLA is respected. The latest constraint family defines the domain of the variables of the model.

4 Variational Formulation

We now provide a variational formulation of problem (1)-(12). Let all the involved cost functions be continuosly differentiable and convex and the quality functions be continuously differentiable and concave.

The following result allows us to obtain the variational formulation of the proposed model (see, for instance, Nagurney et al. (2017)).

Theorem 1

A vector \((Q^{1*},Q^{2*},Q^{3*},Q^{4*},A^*)\in \mathbb {K}\) is an optimal solution to the problem (1)-(12) if and only if there exist the Langrange multipliers vectors \(\mu ^*\in \mathbb {R}^{\hat{F}_1 S}\), \(\lambda ^{1*}\in \mathbb {R}_+\) and \(\lambda ^{2*}\in \mathbb {R}_+^{US}\) such that the vector \((Q^{1*},Q^{2*},Q^{3*},Q^{4*},A^*,\mu ^*,\lambda ^{1*},\lambda ^{2*})\in \mathbb {K}\times \mathbb {R}^{\hat{F}_1 S}\times \mathbb {R}_+\times \mathbb {R}_+^{US}\) is a solution to the variational inequality:

Find \((Q^{1*},Q^{2*},Q^{3*},Q^{4*},A^*,\mu ^*,\lambda ^{1*},\lambda ^{2*})\in \mathbb {K}\times \mathbb {R}^{\hat{F}_1 S}\times \mathbb {R}_+\times \mathbb {R}_+^{US}\) such that:

$$\begin{aligned} \begin{aligned}&\sum _{u=1}^U\sum _{d=1}^D\sum _{s=1}^S\left[ \frac{\partial c_{ud}(Q^{1*}_{ud})}{\partial q_{uds}}\right] \times (q_{uds}-q^*_{uds})\\&+\sum _{d=1}^D\sum _{\hat{f}\in \hat{\mathcal {F}}_1}\sum _{s=1}^s\left[ \frac{\partial c_{d\hat{f}}(Q^{2*}_{d\hat{f}})}{\partial q_{d\hat{f}s}} +\frac{\partial c_{\hat{f}}^{(E)}\left( {a_{\hat{f}}^*,Q_{\hat{f}}^{2*}} \right) }{\partial q_{d\hat{f}s}} +(1-a_{\hat{f}}^*)P_s+\frac{\partial c_{\hat{f}}(a_f^{*},Q^{2*}_{\hat{f}})}{\partial q_{d\hat{f}s}}\right. \\&\qquad \qquad \qquad \qquad \quad \left. -\mu ^*_{\hat{f}s}a^*_{\hat{f}}+\lambda ^{1*}\frac{\partial c_{\hat{f}}(a^*_{\hat{f}},Q^{2*}_{\hat{f}})}{\partial q_{d\hat{f}s}}\right] \times (q_{d\hat{f}s}-q^*_{d\hat{f}s})\\&+\sum _{d=1}^D\sum _{\tilde{f}\in \tilde{\mathcal {F}}_2}\sum _{s=1}^S\left[ \frac{\partial c_{d\tilde{f}}(Q^{3*}_{d\tilde{f}})}{\partial q_{d\tilde{f}s}}+\frac{\partial c_{\tilde{f}}^{(E)}\left( {Q_{\tilde{f}}^{3*}} \right) }{\partial q_{d\tilde{f}s}} +\frac{\partial c_{\tilde{f}}(Q_{\tilde{f}}^{3*})}{\partial q_{d\tilde{f}s}}+\lambda ^{1*}\frac{\partial c_{\tilde{f}}(Q^{3*}_{\tilde{f}})}{\partial q_{d\tilde{f}s}}\right] \times (q_{d\tilde{f}s}-q^*_{d\tilde{f}s})\\&+\sum _{f\in \mathcal {F}_3}\sum _{u=1}^U\sum _{s=1}^S \left[ \frac{\partial c_{fu}(Q^{4*}_{fu})}{\partial q_{fus}}-\alpha _s{\frac{\partial \psi _{us}(Q^{4*}_{us} )}{\partial q_{fus}}}-\rho _s+{\mu ^*_{\hat{f}s}\delta _{f}-\lambda _{us}^{2*}\frac{\partial \psi _{us}(Q^{4*}_{us})}{\partial q_{fus}}}\right] \times (q_{fus}-q_{fus}^*)\\&+\sum _{\hat{f}\in \hat{\mathcal {F}}_1}\left[ \frac{\partial c_{\hat{f}}^{(E)}(a_{\hat{f}}^*,Q^{2*}_{\hat{f}})}{\partial a_{\hat{f}}}+\frac{\partial c_f(a_{\hat{f}}^*,Q^{2*}_{\hat{f}})}{\partial a_{\hat{f}}}-\sum _{s=1}^S P_s\cdot \left( {Q^{2*}_{\hat{f}s}}\right) -{\mu ^*_{\hat{f}s}\sum _{d=1}^D q_{d\hat{f}s}^*}\right] \times (a_{\hat{f}}-a_{\hat{f}}^*)\\&{+\sum _{\hat{f}\in \hat{\mathcal {F}}_1}\sum _{s=1}^S\left[ a^*_{\hat{f}}\cdot \left( \sum _{d=1}^D q_{d\hat{f}s}^* \right) -\sum _{u=1}^U q_{\hat{f}us}^*\right] \times (\mu _{\hat{f}s}-\mu ^*_{\hat{f}s})}\\&{ +\left[ \overline{B}-\sum _{\hat{f}\in \hat{\mathcal {F}}_1}{c_{\hat{f}}\left( a_{\hat{f}}^*,Q_{\hat{f}}^{2*} \right) } - \sum _{\tilde{f}\in \tilde{\mathcal {F}}_2} {c_{\tilde{f}}\left( Q_{\tilde{f}}^{3*}\right) }\right] \times (\lambda ^1-\lambda ^{1*})}\\&+{\sum _{u=1}^{U}\sum _{s=1}^S\left[ \psi _{us}\left( {Q^{4*}_{us}} \right) - \underline{\psi }_{us}\right] \times (\lambda ^{2}_{us}-\lambda ^{2*}_{us})}\ge 0, \end{aligned} \end{aligned}$$
$$\begin{aligned} \forall (Q^1,Q^2,Q^3,Q^4,A,\mu ,\lambda ^1,\lambda ^2)\in \mathbb {K}\times \mathbb {R}^{\hat{F}_1 S}\times \mathbb {R}_+\times \mathbb {R}_+^{US}, \end{aligned}$$
(13)

where \(\delta _{f}=1\) if \(f\in \hat{\mathcal {F}}_1\) and \(\delta _{f}=0\) otherwise and where

$$\begin{aligned} \begin{aligned} \mathbb {K}:=\Big \{&(Q^1,Q^2,Q^3,Q^4,A)\in \mathbb {R}^{UDS+D\hat{F}_1S+D\tilde{F}_2S+(\hat{F}_1+\tilde{F}_2)US}_+\times [0,1]^{\hat{F}_1}:\\&(2), (3), (4), (5), (7), (11), (12) \text{ hold } \Big \}. \end{aligned} \end{aligned}$$
(14)

Following the well-known procedure described, for instance, in Colajanni et al. (2019), Daniele and Sciacca (2021), Nagurney (1993), we can put variational inequality (13) into standard form, that is: determine \(X^*\in \mathcal {K}\) such that:

$$\begin{aligned} \langle F(X^*),X-X^*\rangle \ge 0,\quad \forall X\in \mathcal {K} \end{aligned}$$
(15)

where \(\langle \cdot ,\cdot \rangle\) denotes the inner product in the Eucledian space

$$\begin{aligned} \mathcal {D}:=\mathbb {R}^{UDS+D\hat{F}_1 S+D\tilde{F}_2S+(\hat{F}_1+\tilde{F}_2)US}_+\times [0,1]^{\hat{F}_1}\times \mathbb {R}^{\hat{F}_1 S}\times \mathbb {R}_+^{1+US}, \end{aligned}$$

\(X\equiv (Q^1,Q^2,Q^3,Q^4,A,\mu ,\lambda ^1,\lambda ^2)\), F is a given function from \(\mathcal {K}\) to \(\mathcal {D}\) and \(\mathcal {K}=\mathbb {K}\) is a closed and convex set.

Since the feasible set \(\mathcal {K}\) is convex and compact and function F is a continuous function in virtue of hypothesis made for cost and quality functions, form the theory of variational inequality Nagurney (1993), we can state that a solution to variational inequality (13), or equivently, variational inequality (15) exists.

Moreover, we have the following uniqueness result:

Theorem 2

(Uniqueness) If the function F(X) in (15) is strictly monotone on \(\mathcal {K}\), that is:

$$\begin{aligned} \langle (F(X^1)-F(X^2))^T,X^1-X^2\rangle >0,\quad \forall X^1,\ X^2\in \mathcal {K}, X_1\ne X_2, \end{aligned}$$

then the variational inequality (15) or, equivalently, variational inequality (13), admits a unique solution that is the global optimum to the optimization model (1)-(12).

Finally, we provide a sufficient condition for the strictly monotonicity of function F (see Daniele and Sciacca (2021) for a proof).

Theorem 3

If all the involved cost functions are strictly convex and the quality functions are strictly concave, then the vector function F is strictly monotone on \(\mathcal {K}\).

5 Computational Procedure

To solve variational inequality (13), or equivalently, variational inequality (15), we recall now the Euler method (see Dupuis and Nagurney (1993) for a detailed description).

For every iteration \(\tau\), we calculate:

$$\begin{aligned} X^{\tau +1}=P_{\mathcal {K}} (X^{\tau }-a_{\tau }F(X^{\tau }), \end{aligned}$$

where \(P_{\mathcal {K}}\) is the projection on the feasible set \(\mathcal {K}\) defined as:

$$\begin{aligned} P_{\mathcal {K}}=\text{ argmin}_{x\in \mathcal {K}}\Vert \xi -z\Vert \end{aligned}$$

and F is the function entering variational inequality (15). In order to get the convergence of the iterative scheme, we need the sequence \(\{a_{\tau }\}\) to be such that:

$$\begin{aligned} \sum _{\tau =0}^{\infty } a_{\tau }=\infty ,\ a_{\tau }>0, a_{\tau }\rightarrow 0, \text{ as } \tau \rightarrow \infty . \end{aligned}$$
(16)

The iterative scheme is now described.

Step 0: Initialization

Set \(X^0\in \mathcal {K}\). Let \(\tau\) denote an iteration counter and set \(\tau =1\). Set the sequence

\(a_{\tau }\) such that condition (16) is satisfied.

Step 1: Computation

Calculate \(X^{\tau }\in \mathcal {K}\) solving the following variational inequality subproblem:

$$\begin{aligned} \langle X^{\tau }+a_{\tau }F(X^{\tau -1})-X^{\tau -1},X-X^{\tau }\rangle \ge 0,\quad \forall X\in \mathcal {K}. \end{aligned}$$

Step 2: Convergence

Fix a tolerance \(\epsilon >0\) and check whether \(|X^{ \tau }-X^{\tau +1} |\le \epsilon\) , then stop; otherwise,

set \(\tau :=\tau +1\), and go to Step 1.

The explicit formulas for the Euler method used in this model are as follows:

$$\begin{aligned} X^{\tau }=\max \{0,X^{\tau -1}-a_{\tau -1}F(X^{\tau -1})\}. \end{aligned}$$
Fig. 2
figure 2

Network Topology for the illustrative numerical simulation

6 An Illustrative Numerical Simulation

We now provide a numerical simulation. We consider \(U=5\) users or devices on the ground, \(D=2\) controller UAVs, \(\hat{F}_1=3\) pre-existing UAVs, \(\tilde{F}_2=2\) additional UAVs and \(S=1\) type of services (see Fig. 2 for an illustration of the proposed network). The optimal solution is computed through the Euler Method described before using the Matlab program on an HP laptop with an AMD compute cores 2C+3G processor, 8 GB RAM.

We consider 7 different scenarios (indicated, below, with S followed by the number of the scenario) where the service demand by users and devices on the ground varies increasingly:

  • S1: \(R_{11}=4\), \(R_{21}=R_{31}=9\), \(R_{41}=6\), \(R_{51}=4\);

  • S2: \(R_{11}=5\), \(R_{21}=R_{31}=10\), \(R_{41}=7\), \(R_{51}=5\);

  • S3: \(R_{11}=6\), \(R_{21}=R_{31}=11\), \(R_{41}=8\), \(R_{51}=6\);

  • S4: \(R_{11}=7\), \(R_{21}=R_{31}=12\), \(R_{41}=9\), \(R_{51}=7\);

  • S5: \(R_{11}=8\), \(R_{21}=R_{31}=13\), \(R_{41}=10\), \(R_{51}=8\);

  • S6: \(R_{11}=9\), \(R_{21}=R_{31}=14\), \(R_{41}=11\), \(R_{51}=9\);

  • S7: \(R_{11}=10\), \(R_{21}=R_{31}=15\), \(R_{41}=12\), \(R_{51}=10\).

Table 2 shows the main results (that are the variables \(q_{d\tilde{f}s}\)) obtained for each scenario as the coefficient \(c_{add}\) of the cost function,

$$\begin{aligned} \displaystyle c_{\tilde{f}}=c_{add}\left( \sum _{d=1}^D\sum _{s=1}^S{q_{d\tilde{f}s}}\right) ^2+\sum _{d=1}^D\sum _{s=1}^S{q_{d\tilde{f}s}}, \end{aligned}$$

varies. The results clearly show that for low costs it is convenient to use additional UAVs, while for higher costs then it is convenient not to use such additional UAVs unless a certain threshold of requests is exceeded.

Table 2 Optimal flows distribution to additional UAVs obtained for each scenario, changing the cost due to add UAVs

7 Conclusion

In this paper, we presented a network-based optimization model describing a closed-loop supply chain for the provision of 5G network slices on demand to users and devices on the ground. We provided an optimization model trough which a services provider seeks to maximize his/her total profit (defined as the difference between revenue and costs) and the quality of services and to minimize the penalty costs. We associated a budget constraint with the possibility to add additional drones to UAVs fleet and a quality constraint. We derived the Variational Inequality formulation of the problem and we discussed about existence and uniqueness of the solution which represents the global optimum to the proposed optimization problem. Finally, a numerical simulation has been performed. The results in this paper add to the growing literature of operational research for 5G network architecture managing.