## 4 The Propose Transmission Optimization Algorithm
### Dynamic Learning Algorithm
After that, the learning function in Equation (24) is used to update the regret value based on the utility function. The probability of action selection is recalculated based on Equation (25). Then, the location of social sensor nodes is changed according to the model of social dynamic mobility in Section 3. Finally, when the number of iteration meets the stopping condition, the result is returned and the algorithm stops. Otherwise, the above procedure is repeated. ```
0: The number of sensor nodes \(M\); The coordinates of nodes and BSs \(\{r_{k},\varphi_{k}\},k=1,2,\cdots,M\); \(R_{l},l=0,1,\cdots,D\); The number of iteration \(T\)
0: The probability of action selection \(\mathcal{P}_{a_{i}}^{i}=1/2,i=1,2,\cdots,M,a_{i}\in\mathcal{A}_{i}\)
1: Initialization: The regret value of social sensor nodes \(R_{i}^{a_{i}}(t,n)=0\), \(i\in\{1,2,\cdots,O\}\),\(n=\{1,2,\cdots,S\}\), where \(n\) is the location label of social sensor node; The regret value of physical sensor nodes \(R_{j}^{a_{j}}(t)=0\), \(j\in\{O+1,O+2,\cdots,M\}\); The probability of action selection \(\mathcal{P}_{a_{i}}^{i}=1/2\), \(i=1,2,\cdots,M,a_{i}\in\mathcal{A}_{i}\); \(t=1\)
2: Calculate the transition probability \(\mathcal{F}_{jk}^{i},i\in\{1,\cdots,O\}\) based on Equations (3)-(5) of the model of dynamic mobility in Section 3.2
3: Repeat
4: For each sensor node \(z_{i}\) do
5: Select a action \(a_{i}\) for \(A_{i}\) based on the \(\mathcal{P}_{a_{i}}^{i}(t)\)
6: EndFor
7: Calculate the utility based on the Equation (23)
8: For each sensor node \(z_{i}\) do
9: If \(z_{i}\) is social node, \(i\in\{1,2,\cdots,O\}\)
10: Calculate the corresponding regret value \(R_{i}^{a_{i}}(t,n)\) of different action at location \(n\) according to Equation (23)
11: else
12: Calculate the corresponding regret value \(R_{i}^{a_{i}}(t)\) of different action using Equation (24)
13: EndIf
14: Update the probability of action selection \(\mathcal{P}_{a_{i}}^{i}(t)\) using Equation (25). 15: EndFor
16: Update the location information of each social node based on the transition probability \(\mathcal{F}_{jk}^{i},i\in\{1,\cdots,O\}\) of social dynamic mobility
17:\(t=t+1\)
18:Until \(t>=T\)
19:return the probability of action selection \(\mathcal{P}_{a_{i}}^{i}\)\(i\in\{1,2,\cdots,M\}\)
```  
**Algorithm 1** The proposed algorithm based on regret matching. In Algorithm 1, some initial variables are initialized on Line 1. The calculation of transition probability is presented on Line 2. On Lines 3-6, each node selects a action from action set based on the probability of action selection, i.e., selecting a transmission power level (zero or \(P_{max}\)). Then, the corresponding utility is calculated based on Equation (23) on Line 7. On Lines 8-013, the regret value \(R_{i}^{a_{i}}(t,n)\) or \(R_{i}^{a_{i}}(t)\) for social or physical sensor node is calculated based on Equation (24). Based on the regret value, the probability of action selection of each node is recalculated according to Equation (25). Next, the location of social sensor node is updated based on the transition probability of social dynamic mobility. Note that the location for physical sensor node is static. Thus, the location is unchanged. After this, it returns to Line 3 to repeat the calculation procedure. On Lines 18-19, when \(t>T\), the algorithm stops and returns the probability of action selection of each node.