# Game-Based Resource Allocation Mechanism in B5G HetNets with Incomplete Information
## 3 Distributed Resource Allocation Algorithm
### Leader Game  
When obtaining the BNE in the follower game, the network operators as leaders can know the equilibrium strategies of mobile users. Furthermore, the competition for mobile users among networks is modeled as a dynamic non-cooperation game, where the actions made by the players are sequential and the information can be known by the players of the other players' decisions. This is so that, different from the follower game, the leader game acquires complete information and the Nash equilibrium is the solution. * Players are \(m\) network operators in the set of \(M=\{j|j=1,2,\ldots,m\}\). * Strategy of network \(j\) is the price of allocated bandwidth charged from the mobile users, represented as \(b_{j}\), which is a non-negative and continuous value. Let \(B_{j}\) be the set of actions available to network \(j\), and \(\mathbf{b}=(b_{1},b_{2},\ldots,b_{m})\) denotes the strategy profile of all network operators. * Payoff of network \(j\) in the leader game with complete information is expressed in Equation (17), which contains only the profit obtained by selling the bandwidth (as in Equation (4)). \[u_{j}^{L}(b_{j},\mathbf{b}_{-j};\mathbf{q})=b_{j}\cdot\sum_{i=1}^{n}q_{ij}\] (17) where \(\mathbf{b}_{-j}=\left(b_{1},b_{2},\ldots b_{j-1},b_{j+1},\ldots b_{m}\right)\) denotes the strategies profile of all networks, except network \(j\). The best response dynamic of network \(j\) is to maximize its utility given the strategies of other networks and the users' equilibrium strategies in the follower subgame. In the leader game the Nash equilibrium \(\mathbf{b}=(b_{1},b_{2},\ldots b_{m})\) can be reached if and only if the optimal price strategy \(b_{j}\) can satisfy the following equation for any \(j\):  
\[b_{j}\in\underset{b_{j}}{\arg\max}u_{j}^{L}\big{(}b_{j},\mathbf{b}_{-j}; \mathbf{q}\big{)} \tag{18}\]  
The utility function curve also proves the existence of the Nash equilibrium, where we took Net 1 as an example to study the player's utility curve changing with its price strategy. It is easy to see that the network's utility function is a concave function based on the price strategy of the bandwidth. Similar to the follower game, a distributed iteration algorithm is used to obtain the Nash equilibrium in the leader game. Based on the equilibrium strategy profile of mobile users, network operators will adjust their price strategies correspondingly, and the rate of change can be presented with its marginal utility:  
\[\dot{b}_{j}=\frac{\partial u_{j}^{L}\big{(}b_{j},\mathbf{b}_{-j};\mathbf{q} \big{)}}{\partial b_{j}} \tag{19}\]We can obtain the marginal utility by giving a little increment \(\varepsilon\) to the network's utility function:  
\[\frac{\partial u_{j}^{L}\big{(}b_{j},\textbf{b}_{-j};\textbf{q}\big{)}}{\partial b _{j}}=\frac{u_{j}^{L}\big{(}b_{j}(t)+\varepsilon,\textbf{b}_{-j};\textbf{q} \big{)}-u_{j}^{L}\big{(}b_{j}(t)-\varepsilon,\textbf{b}_{-j};\textbf{q}\big{)}} {2\varepsilon} \tag{20}\]  
As a result, the iteration of price strategy made by network \(j\) can be expressed as:  
\[b_{j}(t+1)=b_{j}(t)+\dot{\mu_{j}}b_{j}(t) \tag{21}\]  
where \(\mu_{j}\) represents the adjustable step for the price strategy of network \(j\). When obtaining the best price strategy \(b_{j}\)* for all \(j\), the Nash equilibrium in the leader game will be reached. Sequentially, the hole two-tiered game converges to its final equilibrium, denoted as \((\textbf{q}^{*},\textbf{b}^{*})\), where \(\textbf{q}^{*}\) and \(\textbf{b}^{*}\) represent, respectively, the optimal bandwidth requesting strategy profile of mobile users and the optimal price strategy profile of networks. Algorithm 1 details the proposed two-tier game-based distributed resource allocation algorithm. We assume that networks will announce their pricing strategy profile to all mobile users at the beginning of the follower game. ```
1:Input: InitialInitialize \(\tau=1\), \(t=1\), \(\textbf{b}\), \(\textbf{q}\).