## 4 Methodology
### Dynamic Resource Scheduling and Task Offloading Based on Value Iteration
#### 4.1.2 Mathematical Formulation for Task Offloading and Resource Scheduling  
To optimize task offloading and resource scheduling in dynamic environments, we introduce a more comprehensive model that considers task dependencies, resource utilization efficiency, and task priorities. The latency model is extended to account for task dependencies and parallel processing capabilities. In this extended model, the start time of task \(j\) depends on the completion time of task \(k\). Therefore, the latency incurred during task offloading is influenced by both the transmission delay and the task dependency structure. The modified latency function is given by  
\[\mathbb{L}(s_{t},a_{t})=\sum_{i=1}^{N}\sum_{j=1}^{M}\left(\frac{t_{j}^{c}}{p_{i }(t)\cdot c_{i}}+\frac{d_{ik}^{j}(t)}{b_{i}(t)}\right)X_{ij}(t)+\sum_{(j,k) \in\mathcal{D}}\delta_{jk}(t) \tag{14}\]  
The first part of the equation represents the latency during task offloading, where \(t_{j}^{c}\) and \(t_{j}^{s}\) represent the computational and storage times for task \(j\). \(p_{i}(t)\) denotes the processing capability of node \(i\) at time \(t\). \(d_{ik}^{j}(t)\) represents the transmission delay for task \(j\) from node \(i\) to user terminal \(k\) at time \(t\). The second part accounts for the additional delay due to task dependencies, where \(\delta_{jk}(t)\) represents the additional delay between task \(j\) and task \(k\). A dynamic resource utilization rate is introduced to model resource efficiency more accurately. The resource utilization rate \(u_{i}(t)\) for node \(i\) at time \(t\) is defined as the weighted  
Figure 1: Schematic basic idea D-GTOM framework. sum of the resource usages across computational, storage, and bandwidth dimensions. This resource utilization rate is used to define the resource efficiency function as follows:  
\[u_{i}(t)=\frac{\sum_{j=1}^{M}X_{ij}(t)t_{j}^{c}}{c_{i}}+\frac{\sum_{j=1}^{M}X_{ij} (t)t_{j}^{s}}{s_{i}}+\frac{\sum_{j=1}^{M}X_{ij}(t)t_{j}^{b}}{b_{i}} \tag{15}\]  
where \(X_{ij}(t)\) indicates whether task \(j\) is assigned to node \(i\) at time \(t\). \(c_{i}\), \(s_{i}\), and \(b_{i}\) represent the computational, storage, and bandwidth capacities of node \(i\), respectively. This formula considers the resource demand of each task on node \(i\) and calculates the node's resource utilization rate as the weighted sum of the total resource usage. By optimizing this resource utilization rate, we can ensure the proper allocation of resources, avoiding both over-utilization and under-utilization. The resource efficiency function is then given by  
\[U(s_{t},a_{t})=\frac{1}{N}\sum_{i=1}^{N}(1-|1-u_{i}(t)|) \tag{16}\]  
where \(N\) is the total number of nodes.\(u_{i}(t)\) represents the resource utilization rate of node \(i\) at time \(t\). The term \(1-|1-u_{i}(t)|\) ensures that the efficiency is maximized when the resource utilization is close to its capacity. This function quantifies the system's resource efficiency by measuring the deviation of the resource utilization rate \(u_{i}(t)\) from the node's maximum resource capacity. When \(u_{i}(t)\) approaches 1, the efficiency reaches its maximum, indicating that the resources are being fully utilized. This efficiency function can guide the system to optimize towards higher resource utilization. To further optimize task scheduling, we incorporate task priorities and deadlines into the objective function. The priority \(\pi_{j}\) and deadline \(T_{j}\) of task \(j\) are considered to adjust the scheduling strategy. The extended objective function is  
\[F_{\text{opt}}(t)=\sum_{j=1}^{M}\pi_{j}\left(\alpha_{1}\cdot\frac{\sum_{i=1}^{N }X_{ij}(t)(c_{i}+s_{i}+b_{i})}{\sum_{i=1}^{N}(c_{i}+s_{i}+b_{i})}-\alpha_{2} \cdot\frac{t_{j}^{c}}{p_{i}(t)\cdot c_{i}}-\alpha_{3}\cdot\frac{d_{jk}^{i}(t) }{b_{i}(t)}\right) \tag{17}\]  
where \(\pi_{j}\) represents the priority of task \(j\). \(\alpha_{1}\), \(\alpha_{2}\), and \(\alpha_{3}\) are weighting parameters that control the trade-offs between resource efficiency, computational time, and transmission delay.