## 5 Exact Algorithm
### Exact Algorithm  
A Bellman-Ford framework-based exact algorithm (Algorithm 4) is essentially a label correction (LC) algorithm [42; 43] based on an improved version of the Bellman-Ford algorithm. In lines 1 to 2, we first initialize all label sets as empty. The outer loop runs for \(N^{\prime}-1\) iterations, which is similar to the classic Bellman-Ford algorithm. From lines 3 to 18, we iterate over all tasks according to List I. For each task, we generate all offloading schemes by combining the label sets of all predecessor nodes, and then calculate new labels based on these offloading schemes. Afterward, we perform a dominated test (DT) on the new labels with those having the same execution node index. If the newly generated label is not dominated by any other label, it returns false. We remove the labels dominated by  
Figure 3: Illustration of storing and updating labels of label set \(L_{v}\). the new label and insert the new label into the label set; otherwise, we discard the new label. In simple terms, during each iteration, the Pareto frontier is stored for the label set of each node on each server based on the DT table in Table 1. Finally, in line 19, we find the offloading scheme that satisfies the cost constraint and minimizes the delay in the label set of the virtual node \(t\), which serves as the optimal solution. As shown in Figure 3, the labels \(\{1,4\}\) and \(\{2,3\}\) are retained because they are nondominated. However, if a new label \(\{3,3\}\) arrives at the same execution node as labels \(\{1,4\}\) and \(\{2,3\}\), it cannot be added to the set \(L_{v}\), as \(\{3,3\}\) is dominated by \(\{2,3\}\). On the other hand, if the new label is \(\{2,2\}\), it will be added to the set \(L_{v}\) and the label \(\{2,3\}\) will be removed. Moreover, since the \(x\)-axis in Figure 3 represents different execution nodes, even though the labels \(\{2,4\}\) and \(\{3,3\}\) are dominated by the labels \(\{1,4\}\) and \(\{2,3\}\), respectively, they can still be added to the set \(L_{v}\). ```
1:Initialize \(L_{j,M_{j},k}\leftarrow\emptyset\) for all \(j\in V\), for any \(h\in[1,H]\). 2:Set \(L_{s,\mu,1}\leftarrow\{0,0,1,a\}\). 3:for\(q=1\) to \(N^{\prime}-1\)do
4:for\(j\in V\) in List \(I\)do
5:for\(m\in M_{j}\)do
6:\(k\leftarrow\) All permutations of \(L_{i}\), \(i\in\mathrm{C}(j)\). 7:\(L_{\mathrm{new}}\leftarrow\{f^{\mathrm{delay}}(k),f^{\mathrm{cost}}(k),h^{*},m\}\). 8:if\(DT(L_{\mathrm{new}}\odot L_{j,m,*})=false\)then
9:for\(h\in[1,H]\)do
10:if\(L_{\mathrm{new}}\odot L_{j,m,h}=L_{\mathrm{new}}\)then
11:\(L_{j,m,h}\leftarrow\emptyset\). 12:endif
13:endfor
14:\(L_{j,m}\gets L_{j,m}\cup L_{\mathrm{new}}\). 15:endif
16:endfor
17:endfor
18:endfor
19:The optimal solution is the label value in \(L_{t}\) that satisfies the cost constraint \(T\) and minimizes the delay. ```  
**Algorithm 4** BFF(\(G(V,E)\), \(M_{v}\), \(T\), List I)  
The maximum time complexity of BFF is \(N^{\prime 2}M^{\prime}(HM_{\mathrm{max}})^{d_{m}}\). Proof. : The outermost loop runs \(N^{\prime}-1\) times, where \(N^{\prime}\) denotes the total number of tasks. In each iteration of this loop, every task and server is traversed. Therefore, there are \(N^{\prime}M^{\prime}\) operations to find the new label set. Since each new label set is derived by permuting the label sets stored in all predecessor nodes, and each node's label set contains at most \(HM_{\mathrm{max}}\) labels, where \(M_{\mathrm{max}}\) denotes the maximum value of \(M^{\prime}\), the new label set can have at most \((HM_{\mathrm{max}})^{d_{m}}\) labels. Thus, the maximum time complexity is \(N^{\prime 2}M^{\prime}(HM_{\mathrm{max}})^{d_{m}}\).