# An Energy-Efficient Game-Theory-Based Spectrum Decision Scheme for Cognitive Radio Sensor Networks
## 3 Energy-Efficient Game-Theory-Based Spectrum Decision
### Coordination Mode (C Mode)
#### 3.2.3 Spectrum Decision Module of C Mode
\begin{cases}1&\text{if}\left|\left(A_{idle}\right)_{i}\right|=0 \\ 2&\text{if}\left|\left(A_{idle}\right)_{i}\right|=1\\ 3&\text{if}\left|\left(A_{idle}\right)_{i}\right|=2\\ 4&\text{if}\ 2<\left|\left(A_{idle}\right)_{i}\right|\leqslant L\end{cases}  \tag{9}\]  
where type(\(CH\))\({}_{i}\) is the CH type of \(S_{i}\), and (\(A_{idle}\))\({}_{i}\) is the set of idle licensed channels observed by \(S_{i}\), i.e.,:  
\[ \begin{array}{ll}(A_{idle})_{i}&=\{A_{x1},A_{x2},...,A_{xl}\}_{i}\\ &=\{A_{xv}|A_{xv}\in A,status(A_{xv})=(idle),\ 1\leqslant v\leqslant L\}_{i} \end{array}  \tag{10}\]  
where \(v\) is an arbitrary value, \(1\leqslant v\leqslant L\), and \(A_{x1}\
eq A_{x2}\
eq\ldots\
eq A_{xl}\). For \(S_{i}\) with \(type(CH)_{i}=1\), because there is no idle licensed channel, both the operating channel and backup channel for the current frame, (\(C_{i}\))\({}_{f}\) and (\(C^{\prime}_{i}\))\({}_{f}\), are selected from a set of unlicensed channels. Hence:  
\[\left[(C_{i})_{f},(C^{\prime}_{i})_{f}\right]=\left[(C_{i})_{f}\in(B_{clean})_ {i},\ (C^{\prime}_{i})_{f}\in\left\{(B_{clean})_{i}-(C_{i})_{f}\right\}\right] \tag{11}\]  
for \(1\leqslant i\leqslant N\) and class(\(S_{i}\)) = (\(CH\)), where the set (\(B_{clean}\))\({}_{i}\) is the clean unlicensed channels of \(S_{i}\), i.e.,:  
\[ \begin{array}{ll}(B_{clean})_{i}&=\left\{B_{y1},B_{y2},...,B_{yk}\right\}_{ i}\\ &=\left\{B_{yv}|B_{yv}\in B,status(B_{yv})=(clean),\ 1\leqslant v\leqslant K \right\}_{i}\end{array}  \tag{12}\]  
where \(v\) is an arbitrary value, \(1\leqslant v\leqslant K\), and \(B_{y1}\
eq B_{y2}\
eq\ldots\
eq B_{yk}\). For \(S_{i}\) with \(type(CH)_{i}=2\), the operating channel is set to be the only idle licensed channel, and the backup channel is selected from (\(B_{clean}\))\({}_{i}\). For \(S_{i}\) with \(type(CH)_{i}=3\), one of its idle licensed channels is set as the operating channel, and the remaining one idle licensed channel is set as the backup channel. Hence:  
\[\left[(C_{i})_{f},(C^{\prime}_{i})_{f}\right]=\left[A_{x1},(C^{\prime}_{i})_{f }\in(B_{clean})_{i}\right] \tag{13}\]  
for \(type(CH)_{i}=2\), and:  
\[\left[(C_{i})_{f},(C^{\prime}_{i})_{f}\right]=\left[A_{x1},A_{x2}\right]or \left[A_{x2},A_{x1}\right] \tag{14}\]  
for \(type(CH)_{i}=3\). Additionally, for \(S_{i}\) with \(type(CH)_{i}=2\) or \(type(CH)_{i}=3\), the \(S_{i}\) broadcasts the licensed channel selection on the \(C_{control}\). For \(S_{i}\) with \(type(CH)_{i}=4\), the \(S_{i}\) performs spectrum etiquette by allowing \(S_{i}\) with \(type(CH)_{i}=2\) or \(type(CH)_{i}=3\) to claim their operating channel first. Thus, \(S_{i}\) with \(type(CH)_{i}=4\) listens for broadcasts on the \(C_{control}\) before it selects its operating channel. After listening to some declarations of operating channels, \(S_{i}\) with \(type(CH)_{i}\) = 4 eliminates the idle channels that have been claimed, and selects its operating and backup channels. Hence:  
\[[(C_{i})_{f^{\prime}}(C_{i}^{\prime})_{f}]=[(C_{i})_{f}\in\{(A_{idle})_{i}-(A_{ excl})_{i}\}\,,\ (C_{i}^{\prime})_{f}\in\left\{(A_{idle})_{i}-(A_{ excl})_{i}-(C_{i})_{f}\right\}] \tag{15}\]  
where the set \((A_{exclude})_{i}\) contains the idle channels of \(S_{i}\) that have been claimed by other CHs, i.e.,  
\[ \begin{array}{ll}(A_{excl})_{i}&=\left\{(C_{h1})_{f^{\prime}}(C_{h2})_{f},...,(C_{h(R-1)})_{f}\right\}_{i}\\ &\quad=\left\{\sum_{r=1}^{R-1}\ (C_{hr})_{f}\right\}\end{array}  \tag{16}\]  
where \(R\) is the number of total CHs in the network, and \((C_{hr})_{i}\) is the operating channel of CH \(r\) for current frame \(f\). We propose two spectrum selection algorithms: random selection (EGSD-R) and game-theory-based selection (EGSD-G). One of the spectrum selection algorithms is performed to select an operating channel and backup channel, as outlined in Equations (22), (24) and (26). In other words, one of the spectrum selection algorithms is performed by CH type 1, 2, and 4. In EGSD-R, the operating and backup channels are selected randomly.