## 6 Modified Priority-Based Greedy Heuristic
\begin{tabular}{l l} AR & Augmented Reality \\ BRC & Basic Resource Consumption \\ CAPEX & CAPital EXenditure \\ CDC & Cloud Data Center \\ COTS & Commercial-Off-The-Shelf \\ EC & Edge Computing \\ ILP & Integer Linear Programming \\ IoT & Internet of Things \\ MDC & Micro Data Center \\ ModPG & Modified Priority-based Greedy \\ NF & Network Function \\ NFV & Network Function Virtualization \\ OPEX & OPerational EXenditure \\ \end{tabular} 

## Appendix A

The VNF placement problem can be formulated as an Integer Linear Programming (ILP) model as follows. ### Constraints

A first VNF placement constraint can be formulated as follows:

\[\sum_{u=0}^{|P|+|R|+|G|-1}x_{\gamma,n_{i}^{\mathrm{s}},n_{u}^{\mathrm{s}}}=1, \gamma\in\Gamma,n_{i}^{\mathrm{v}}\in p_{\gamma}\cup\Phi_{\gamma}\cup\Psi_{\gamma} \tag{1}\]

that is, a VNFr and SAR in an SFCr must be mapped on only one node in the substrate network. The binary \(x_{\gamma,n_{i}^{\mathrm{v}},n_{u}^{\mathrm{s}}}\) indicates whether the VNFr \(n_{i}^{\mathrm{v}}\) in SFCr \(\gamma\) is mapped on substrate node \(n_{u}^{\mathrm{s}}\). Due to geographical considerations, each SFCr specifies its SAR. Therefore:

\[x_{\gamma,n_{i}^{\mathrm{v}},n_{u}^{\mathrm{s}}}= \begin{cases}1,&n_{u}^{ \mathrm{s}}\text{ is the attachment of }p_{\gamma},\,\gamma\in\Gamma,\\ 0,&\text{otherwise}\end{cases}  \tag{2}\]

In addition, VNFrs in \(\Phi_{\gamma}\) and \(\Psi_{\gamma}\) can only be mapped on MDCs and CDCs, respectively. Therefore:

\[x_{\gamma,n_{i}^{\mathrm{v}},n_{u}^{\mathrm{s}}}= \begin{cases}\{0,1\},&n_{i}^{ \mathrm{v}}\in\Phi_{\gamma}\text{ and }n_{u}^{\mathrm{s}}\in R,\\ \{0,1\},&n_{i}^{\mathrm{v}}\in\Psi_{\gamma}\text{ and }n_{u}^{\mathrm{s}}\in G,\\ 0,&\text{otherwise}\end{cases}  \tag{3}\]

The CPU and memory consumptions of the VNFrs on an MDC cannot exceed the CPU and memory capacities of the MDC:

\[\sum_{\gamma=0}^{|\Gamma|-1}\sum_{i=0}^{|\Phi_{\gamma}|-1}CPU_{ \gamma,n_{i}^{\mathrm{v}}}\cdot x_{\gamma,n_{i}^{\mathrm{v}},n_{u}^{\mathrm{s }}}+\sum_{\lambda=0}^{\Lambda-1}BRC_{\lambda}^{CPU}\cdot z_{\lambda,n_{u}^{ \mathrm{s}}}\leq C_{n_{u}^{\mathrm{s}}}^{CPU},n_{u}^{\mathrm{s}}\in R \tag{4}\] \[\sum_{\gamma=0}^{|\Gamma|-1}\sum_{i=0}^{|\Phi_{\gamma}|-1}mem_{ \gamma,n_{i}^{\mathrm{v}}}\cdot x_{\gamma,n_{i}^{\mathrm{v}},n_{u}^{\mathrm{s }}}+\sum_{\lambda=0}^{\Lambda-1}BRC_{\lambda}^{mem}\cdot z_{\lambda,n_{u}^{ \mathrm{s}}}\leq C_{n_{u}^{\mathrm{s}}}^{mem},n_{u}^{\mathrm{s}}\in R \tag{5}\]

In Equations (4) and (5), the first term indicates the total CPU and memory consumption by the VNFs mapped on the substrate node \(n_{u}^{\mathrm{s}}\). The second term indicates the total CPU BRCs and memory BRCs, respectively, due to the instantiation of VNFs. Regarding BRCs, the variable \(z_{\lambda,n_{u}^{\mathrm{s}}}\) indicates if one or more than one VNFrs of type VNF \(\lambda\) are mapped on \(n_{u}^{\mathrm{s}}\), and it is defined as:\[z_{\lambda,n^{s}_{u}}= \begin{cases}1,&\sum_{\lambda=0}^{|\Lambda|-1}\sum_{i=0}^{| \Phi_{\gamma}|+|\Psi_{\gamma}|-1}x_{\gamma,n^{\pi}_{i},n^{\pi}_{i}}\cdot I_{ \gamma,n^{\pi}_{i},\lambda}\geq 1\\ 0,&\text{otherwise}\end{cases}  \tag{10}\]

where \(n^{s}_{u}\in R\cup G\). \(l_{\gamma,n^{\pi}_{i},\lambda}\), which indicates if VNFr \(n^{\pi}_{i}\) in SFCr \(\gamma\) demands VNF \(\lambda\); it is not a variable because the type of VNFr in an SFCr is known. In addition, if there is more than one VNFr mapped on one MDC, the MDC has to be activated. This constraint can be formulated as:

\[h_{\lambda,n^{s}_{u}}= \begin{cases}1,&\sum_{\gamma=0}^{|\Lambda|-1}\sum_{i=0}^ {|\Phi_{\gamma}|-1}x_{\gamma,n^{\pi}_{i},n^{\pi}_{u}}\geq 1,\,n^{s}_{u}\in R,\\ 0,&\text{otherwise}\end{cases}  \tag{11}\]

It is assumed that CDCs are always in operation. The model does not consider resource consumption on SARs, and it also assumes resource-rich CDCs. As described in Section 4.2, \(E^{\
u}_{\gamma}\) indicates the logical links between VNFrs of SFCr \(\gamma\).