# TRUST-ME: Trust-Based Resource Allocation and Server Selection in Multi-Access Edge Computing
## 4 Multilateral Bargaining Resource Allocation  
The proposed mechanism for the reinforcement-learning-based edge server selection enables each user to independently choose an MEC server for offloading their data computing tasks. This process allows the MEC servers to dynamically adjust their resource allocation (i.e., computing capacity) based on the number of users requiring service while considering the sequence of service requests and data-processing volumes requested by the users. The users engage in a competition between each other to access a larger share of the selected MEC server's computing capacity \(F_{s}\) to meet their latency constraints \(T_{n},\forall n\in\mathcal{N}\), and satisfy their minimum utility requests \(U_{n}\).  
This competitive interaction between the users who select the same MEC servers \(\mathcal{N}_{s}\) can be modeled as a _multilateral bargaining game_. In this game, the users negotiate between each other to share the common pool of resources \(F_{s}\) available at the selected MEC server. The computing capacity allocated to each user is denoted as \(f_{s,n}\). The bargaining operator for an individual user \(n\) is defined by the matrix \(\mathcal{B}_{n}\), where \(b_{n^{\prime}n^{\prime}}=\hat{t}_{n^{\prime}}\); \(\forall n\
eq n^{\prime},b_{nn^{\prime}}=1-\hat{t}_{n^{\prime}}\); and \(\forall n\
eq n^{\prime},b_{nn}=1\), with \(\hat{t}_{n}=\frac{B_{n}}{\sum_{n\in\mathcal{N}_{s}}B_{n}}\). In the matrix \(\mathcal{B}_{n},B_{n}\) represents the bargaining power of user \(n\), which is determined relative to the total bargaining power of all the users selecting the same MEC server \(F_{s}\):  
\[\mathcal{B}_{n}=\left[\begin{array}{cccccccc}\hat{t}_{1}&0&\dots&0&0&0&\dots &0\\ 0&\hat{t}_{2}&\dots&0&0&0&\dots&0\\ \vdots&\vdots&\dots&\vdots&\vdots&\vdots&\dots&\vdots\\ 1-\hat{t}_{1}&1-\hat{t}_{2}&\dots&1-\hat{t}_{n-1}&1&1-\hat{t}_{n+1}&\dots&1- \hat{t}_{N_{s}}\\ \vdots&\vdots&\dots&\vdots&\vdots&\vdots&\dots&\vdots\\ 0&0&\dots&0&0&0&\dots&\hat{t}_{N_{s}}\end{array}\right] \tag{18}\]  
Let the bargaining operator in the multilateral bargaining game be denoted by \(\mathcal{B}=\mathcal{B}_{1}\mathcal{B}_{2}\dots\mathcal{B}_{N_{s}}\), its corresponding characteristic polynomial be given by \(c(\lambda)=\det(\lambda I-\mathcal{B})\), and each individual bargaining operator be partitioned as follows:  
\[\mathcal{B}_{n}=\begin{bmatrix}\mathcal{B}_{11}^{(n)}&\mathcal{B}_{2}^{(n)}\\ \mathcal{B}_{21}^{(n)}&\mathcal{B}_{22}^{(n)}\end{bmatrix} \tag{19}\]  
where \(\mathcal{B}_{11}^{(n)}\) is a scalar matrix, and \(\mathcal{B}_{22}^{(n)}\) is a matrix with dimensions \((N_{s}-1)\times(N_{s}-1)\).  
A similar partition is performed for the bargaining operator of the overall multilateral bargaining game, as follows:  
\[\mathcal{B}=\begin{bmatrix}\mathcal{B}_{11}&\mathcal{B}_{12}\\ \mathcal{B}_{21}&\mathcal{B}_{22}\end{bmatrix} \tag{20}\]  
Based on the above analysis and following the principles of bargaining game theory [49; 50], the share function of each user is given as follows:  
\[\begin{split}&\mathbb{S}_{n}(\hat{t}_{n+1},\dots,\hat{t}_{N_{s} },\hat{t}_{1},\dots,\hat{t}_{n-1})\\ &=\det(I-\mathcal{B}_{22}^{(n)}\dots\mathcal{B}_{22}^{(N_{s})} \mathcal{B}_{22}^{(1)}\dots\mathcal{B}_{22}^{(n-1)})=\det(I-\mathcal{B}_{22}) \end{split} \tag{21}\]  
and each user's optimal share of the \(F_{s}\) computing resource of the selected MEC server is derived below:  
\[f_{s,n}=\frac{\hat{t}_{n}^{n-1}\cdot\mathbb{S}_{n}(\hat{t}_{n+1},\dots,\hat{t} _{N_{s}},\hat{t}_{1},\dots,\hat{t}_{n-1})}{\frac{\partial c(\lambda)}{\partial \lambda}|_{\lambda=1}}F_{s} \tag{22}\]  
A detailed flowchart of the TRUST-ME model is presented in Figure 1.