# Game-Theory-Based Task Offloading and Resource Scheduling in Cloud-Edge Collaborative Systems
## 5 Task Unloading Strategy
### Multi-User Task Offloading Game  
The task unloading strategy is defined as a game-theoretic problem, denoted as \(G=\left\{N,(S_{n})_{n\in N^{\prime}},(u_{n})_{n\in N}\right\}\), where the mobile user \(N\) denotes the participant of the game; \(S\) is the set of task unloading strategies of the user; each user has \((M+1)\) choices of task processing strategies; \(s_{n}\in\left\{s_{n}^{l},s_{n}^{1},\cdots s_{n}^{M}\right\}\). \(u_{(S_{n}S_{-n})}\) is the utility function of user \(n\); and \(s_{-n}\) denotes the set of offloading policies for users other than user \(n\), \(s_{-n}=(s_{1},\cdots,s_{n-1},s_{n+1},\cdots s_{N})\). Supposing \(N\) rational mobile users, each of whom chooses a task processing strategy that optimizes its own utility function, the resulting function is  
\[\max_{s_{n}}(u(s_{n},s_{-n}))=s_{n}^{l}u_{n}^{l}+s_{n}^{m}u_{n}^{m} \tag{21}\]  
Nash equilibrium (NE) is an important concept in game theory, which refers to the situation where any one participant in a non-cooperative game system chooses the combination of optimal strategies given that the strategies of other participants are determined. **Definition 1**. : _If given the set \(S^{*}=\left\{s_{1}^{*},\cdots s_{n}^{*},\cdots s_{N}^{*}\right\}\) of unloading strategies, for \(\forall n\in N\), all have_  
\[u(s_{n}^{*},s_{-n}^{*})\geq u(s_{n},s_{-n}^{*}),s_{n}^{*}\in\left\{s_{n}^{l},s_{ n}^{m}\right\} \tag{22}\]Then, the set of strategies \(S^{*}\) is the NE of the game \(G\). A Nash equilibrium is a state that makes the system stable, and the users in the set of strategies have no incentive to leave the NE. If there exists a potential function \(\psi(s)\), when the unloading strategy of the participating users in the game \(G\) is changed unilaterally from \(s_{n}\) to \(s_{n}^{\prime}\), we can obtain  
\[u(s_{n},s_{-n}^{*})-u\big{(}s_{n}^{\prime},s_{-n}^{*}\big{)}=\psi(s_{n},s_{-n} )-\psi\big{(}s_{n}^{\prime},s_{-n}\big{)},\forall n\in N \tag{23}\]  
Then, the game \(G\) is a potential game. According to the properties of potential games, there exists a Nash equilibrium for a potential game with a finite set of strategies and finite improvement, which can be reached in a finite number of improvements. The game \(G\) is a potential game with the potential function shown in Equation (24) and can reach a Nash equilibrium within a finite number of improvements. \[\psi(s)=s_{n}^{l}\sum_{i=1}^{N}u_{i}^{l}+\left(1-s_{n}^{l}\right)\left(s_{n}^{ m}u_{n}^{m}+\sum_{i=1\&\&\&i\
eq n}^{N}u_{i}^{l}\right) \tag{24}\]  
It satisfies \(s_{n}=s_{n}^{l}=1;s_{n}=s_{n}^{m}=0\) when the user performs computational tasks locally. \(s_{n}=s_{n}^{l}=0;s_{n}=s_{n}^{m}=1\) when the user processes computational tasks on the edge server. For user \(n\), (\(\forall n\in\) N), the potential function should satisfy Equation (24) when the user's offloading decision is updated from \(s_{n}\) to \(s_{n}^{\prime}\). We consider the following three cases:  
1. The offload policy for mobile user \(n\) is updated from local processing \(s_{n}^{l}\) to edge server processing \(s_{n}^{m}\). We can obtain \[\psi\Big{(}s_{n}^{l},s_{-n}^{*}\Big{)}-\psi(s_{n}^{m},s_{-n}^{*}) =\sum_{i=1}^{N}u_{i}^{l}-u_{n}^{m}-\sum_{i=1\&\&i\
eq n}^{N}u_{i} ^{l}\] \[=u_{n}^{l}-u_{n}^{m}\] \[=u\left(s_{n}^{l},s_{-n}^{*}\right)-u(s_{n}^{m},s_{-n}^{*})\]
2. The offload policy for mobile user n is updated from offload to edge server processing \(s_{n}^{m}\) to local processing \(s_{n}^{l}\). We can obtain \[\psi(s_{n}^{m},s_{-n}^{*})-\psi\Big{(}s_{n}^{l},s_{-n}^{*}\Big{)} =u_{n}^{m}+\sum_{i=1\&\&i\
eq n}^{N}u_{i}^{l}-\sum_{i=1}^{N}u_{i} ^{l}\] \[=u_{n}^{m}-u_{n}^{l}\] \[=u(s_{n}^{m},s_{-n}^{*})-u\Big{(}s_{n}^{m},s_{-n}^{*}\Big{)}\]
3. The offload policy for mobile user n is updated by edge server \(s_{n}^{m}\) to edge server \(s_{n}^{m^{\prime}}\) for processing.