# Towards Efficiently Provisioning 5G Core Network Slice Based on Resource and Topology Attributes
## 4 Heuristic 5G Core Network Slice Provisioning Algorithm Design
### Heuristic Slice Provisioning
#### 4.2.1 Slice Node Provisioning  
When a slice request arrives at the slice provisioning system, each slice node in the slice request is scored according to Equation (17), and then the slice nodes are ranked according to the score from high to low. The higher the score of the slice node is, the more preferentially it is provisioned. Here, \(\alpha=\beta=0.5\).  
\[S(v_{i})=\alpha LR(v_{i}^{S})\cdot DC(v_{i}^{S})+\beta GR(v_{i}^{S})\cdot CC(v _{i}^{S}). \tag{17}\]  
If physical network nodes are also scored according to Equation (17), the selected physical nodes hosting slice nodes in the final provisioning result may be far apart. Long physical paths would have to be provisioned under this circumstance, resulting in low utilization of physical network resources. To overcome this issue, we use the following cooperative provisioning method. When the current slice node is to be provisioned, the candidate physical node-set that can host the slice node is attained. The sum of the hop counts of the shortest path between the physical nodes hosting all the neighbor slice nodes of current slice node and the candidate physical node is calculated as the cooperative provisioning coefficient. The candidate physical node having the smaller coefficient may be a good hosting node. This cooperative way is beneficial to obtain a shorter physical path to host the slice link in the slice link provisioning stage, thereby improving the utilization of network bandwidth. Thus, we introduce cooperative provisioning coefficient for scoring the physical nodes.  
\[H(v_{i}^{I})=\sum\limits_{v_{i}^{I}\in M(Adj(v^{S}))}h(v_{i}^{I},v_{j}^{I}). \tag{18}\]\[S(v_{i}^{I})=\frac{\alpha LR(v_{i}^{I})\cdot DC(v_{i}^{I})+\beta GR(v_{i}^{I}) \cdot CC(v_{i}^{I})}{H(v_{i}^{I})+\epsilon}. \tag{19}\]  
\(H(v_{i}^{I})\) is the cooperative provisioning coefficient. \(v_{i}^{I}\) represents the candidate physical node that satisfies the CPU and location requirements of slice node \(v^{S}\). \(M(Adj(v^{S}))\) represents a physical node set hosting all the neighbor slice nodes of the slice node \(v^{S}\). \(h(v_{i}^{I},v_{j}^{I})\) is the hop counts of the shortest path between the physical nodes \(v_{i}^{I}\) and \(v_{j}^{I}\). \(\epsilon\) is set to be \(10^{-5}\) to prevent divisor from being 0. Here, \(\alpha=\beta=0.5\). The slice node provisioning algorithm is described in Algorithm 1.  
```
0: Infrastructure network \(G^{I}\) and slice request \(G^{S}\)
0: Slice node provisioning solution
1:for each slice node \(v^{S}\in V^{S}\)do
2:\(S(v^{S})\) is calculated based on Equation (17).
3:endfor
4:Rank all the slice nodes in descending order of \(S(v^{S})\) value.
5:Put the ranking results into \(sliceNodeRankList\).
6:for each physical node \(v^{I}\in V^{I}\)do
7:\(RTScore\) based on resource and topology attributes is calculated based on Equation (16).
8:endfor
9:for each slice node \(v^{S}\in sliceNodeRankList\)do
10: Obtain the candidate physical nodes \(candidate(v^{S})\) for \(v^{S}\) meeting its CPU capacity and provisioned location demands.
11:if\(candidate(v^{S})\) is not empty then
12: Obtain the physical nodes \(M(Adj(v^{S}))\) hosting the neighbor slice nodes of \(v^{S}\).
13:for each physical node \(v^{I}\in candidate(v^{S})\)do
14: Cooperative provisioning coefficient \(H(v^{I})\) is calculated based on Equation (18).
15:\(S(v^{I})\) is calculated based on Equation (19).
16:endfor
17: Provision \(v^{S}\) onto the candidate physical node which has the largest \(S\).
18: Put the provisioning result of \(v^{S}\) into \(sliceNodeProvisioningList\).
19:else
20:return\(sliceNodeProvisioningFailed\)
21:endif
22:endfor
23:return\(sliceNodeProvisioningList\)
```  
**Algorithm 1** Slice node provisioning based on network resource and topology attributes.