## 4 Decoupled Computation Offloading and Resource Allocation with Coordinate Descent (CD)  
Inspired by [17], we adopted the CD method [16] to obtain the offloading scheme \(\mathbf{x}=(x_{1},x_{2},\cdots,x_{m},\cdots,x_{M})\), where \(x_{m}\in\{0,1\}\) indicates whether UD \(m\) offloads or not. The core idea of the CD-based scheme is to fix \(\mathbf{x}_{-m}^{i}=(x_{1}^{i},\cdots,x_{m-1}^{i},x_{m+1}^{i},\cdots,x_{M}^{i})\) iteratively (that is, to use the value in the \(i\)th iteration) and find the local optimum on \(x_{m}^{i+1}\). With the generated offloading scheme, the initial problem (P0) can be divided into two parts, i.e., a local processing part for \(\mathcal{M}_{0}=\{n|x_{n}=0,\quad\forall n\in\mathcal{M}\}\) (P1) and an edge resource allocation part \(\mathcal{M}_{1}=\{m|x_{m}=1,\quad\forall m\in\mathcal{M}\}\)(P2). The whole procedure is summarized in Algorithm 1. ```
Input:\(\mathbf{\theta}=(\theta_{1},\theta_{2},\cdots,\theta_{M})\) in ascending order Output: offloading decision \(\mathbf{x}^{*}\) and corresponding resource allocation scheme osch; \(\mathbf{x}^{0}\leftarrow(0,0,\cdots,0)\); for\(i\) in \(\{1,2,\cdots,M\}\)do: \(\mathbf{x}^{i}\leftarrow\mathbf{x}_{-m}^{i-1}\) and \(\mathbf{x}_{m}^{i}=1\);  get \((\alpha^{i},\beta^{i},p^{i})\) with \(\mathbf{x}^{i}\) as the input of Algorithm 2 and calculate \(\mathbf{r}^{i}\) with (8);  record \(\mathbf{r}^{i}\), \(\mathbf{x}^{i}\) and \((\alpha^{i},\beta^{i},p^{i})\);  find the max \(\mathbf{r}^{i}\) and corresponding offloading scheme \(\mathbf{x}^{i}\) and resource allocation scheme \((\alpha^{i},\beta^{i},p^{i})\), which is recorded as \(\mathbf{maxR}\), \(\mathbf{x}^{*}\) and osch, respectively; while True do: for\(i\in\{1,2,3,\cdots,M\}\)do: \(\mathbf{x}\leftarrow\mathbf{osch}\), and \(\mathbf{x}_{i}\leftarrow\mathbf{x}_{i}\oplus 1\) (\(\oplus\) is the XOR operator);  obtain \((\alpha,\beta,p)\) and \(\mathbf{r}\) with Algorithm 2 (\(\mathbf{x}\) as the input) and calculate \(\mathbf{r}\) with (8);  record \(\mathbf{r}\),\(\mathbf{x}\) and \((\alpha,\beta,p)\); if the maximum of recorded \(\mathbf{r}>maxR\)then \(maxR\gets r_{max}\), \(\mathbf{x}^{*}\leftarrow\mathbf{x}_{max}\) and osch\(\leftarrow\mathbf{osch}_{max}\); else  break; return scheme \(\mathbf{x}^{*}\), osch;
```  
**Algorithm 1** Linear CD-Aided Optimal Resource Allocation  
```
Input:\(\mathbf{\theta}=(\theta_{1},\theta_{2},\cdots,\theta_{M})\) in ascending order Output: offloading decision \(\mathbf{x}^{*}\) and corresponding resource allocation scheme osch; \(\mathbf{x}^{0}\leftarrow(0,0,\cdots,0)\); for\(i\) in \(\{1,2,\cdots,M\}\)do: \(\mathbf{x}^{i}\leftarrow\mathbf{x}^{i-1}\) and \(\mathbf{x}_{m}^{i}=1\);  get \((\alpha^{i},\beta^{i},p^{i})\) with \(\mathbf{x}^{i}\) as the input of Algorithm 2 and calculate \(\mathbf{r}^{i}\) with (8);  record \(\mathbf{r}^{i}\For each \(\mathbf{x}\), we solve the corresponding (P1) and (P2) and obtain a feasible solution to (P0). The computation complexity of our proposed bisection-search-based resource allocation scheme in Algorithm 2 is \(\mathcal{O}(M)\)[16]. For the worst case, the CD method solves (P1) and (P2) \(M^{2}\) times with Algorithm 2 to search for the best offloading decision scheme with maximized system gain. Therefore, the overall complexity of our proposed scheme to solve (P0) is \(\mathcal{O}(M^{3})\). For simplicity, we used the brute-force search method to compare with our CD-based algorithm. The brute-force method enumerates all the \(2^{M}\) offloading schemes and solves the corresponding (P1) and (P2), resulting in a complexity of \(\mathcal{O}(M^{2}2^{M})\). But it is never a time-friendly solution because the computation time grows exponentially with \(M\) (e.g., \(\geq 8\) UDs).