GA-DRL: Graph Neural Network-Augmented Deep Reinforcement Learning for
  DAG Task Scheduling over Dynamic Vehicular Clouds
Vehicular clouds (VCs) are modern platforms for processing of
computation-intensive tasks over vehicles. Such tasks are often represented as
directed acyclic graphs (DAGs) consisting of interdependent vertices/subtasks
and directed edges. In this paper, we propose a graph neural network-augmented
deep reinforcement learning scheme (GA-DRL) for scheduling DAG tasks over
dynamic VCs. In doing so, we first model the VC-assisted DAG task scheduling as
a Markov decision process. We then adopt a multi-head graph attention network
(GAT) to extract the features of DAG subtasks. Our developed GAT enables a
two-way aggregation of the topological information in a DAG task by
simultaneously considering predecessors and successors of each subtask. We
further introduce non-uniform DAG neighborhood sampling through codifying the
scheduling priority of different subtasks, which makes our developed GAT
generalizable to completely unseen DAG task topologies. Finally, we augment GAT
into a double deep Q-network learning module to conduct subtask-to-vehicle
assignment according to the extracted features of subtasks, while considering
the dynamics and heterogeneity of the vehicles in VCs. Through simulating
various DAG tasks under real-world movement traces of vehicles, we demonstrate
that GA-DRL outperforms existing benchmarks in terms of DAG task completion
time.
Zhang Liu, Lianfen Huang, Zhibin Gao, Manman Luo, Seyyedali Hosseinalipour, Huaiyu Dai
GA-DRL: Graph Neural Network-Augmented Deep Reinforcement Learning for DAG Task Scheduling over Dynamic Vehicular Clouds

###### Abstract

Vehicular clouds (VCs) are modern platforms for processing of computation-intensive tasks over vehicles. Such tasks are often represented as directed acyclic graphs (DAGs) consisting of interdependent vertices/subtasks and directed edges. In this paper, we propose a graph neural network-augmented deep reinforcement learning scheme (GA-DRL) for scheduling DAG tasks over dynamic VCs. In doing so, we first model the VCs-assisted DAG task scheduling as a Markov decision process. We then adopt a multi-head graph attention network (GAT) to extract the features of DAG suflasks. Our developed GAT enables a two-way aggregation of the topological information in a DAG task by simultaneously considering predecessors and successors of each subtask. We further introduce non-uniform DAG neighborhood sampling through codifying the scheduling priority of different subtasks, which makes our developed GAT generalizable to completely unseen DAG task topologies. Finally, we augment GAT into a double deep Q-network learning module to conduct subtask-to-vehicle assignment according to the extracted features of subtasks, while considering the dynamics and heterogeneity of the vehicles in VCs. Through simulating various DAG tasks under real-world movement traces of vehicles, we demonstrate that GA-DRL outperforms existing benchmarks in terms of DAG task completion time.

 Vehicular cloud, directed acyclic graph, deep reinforcement learning, graph neural network.

## I Introduction

### _Background and Challenges_

Vehicular networks are one of the main components of the Internet-of-Things (IoT) ecosystem. They have been envisioned to provide a reliable platform for execution of a myriad of applications/tasks, such as autonomous driving and mobile E-health [1, 2]. Many of these tasks possess complex computation topologies, which are often represented as directed acyclic graphs (DAGs) [28]. Fig. 1 illustrates a real-world DAG task model corresponding to a navigation application executed on a vehicle [27], where vertices denote subtasks of the task and directed edges describe the dependencies between the execution of subtasks. In particular, each subtask represents a _processing component_ of navigation, while directed edges dictate the _sequence of executions_ of subtasks. The sequential execution of subtasks in a DAG model stems from the fact that processing of a subtask may depend on the output data of others (e.g., in Fig. 1, processing of subtask \(b_{2}\) relies on the output data of subtask \(b_{1}\) and processing of \(b_{4}\) relies on the output data of both \(b_{2}\) and \(b_{3}\)).

In vehicular networks, DAG tasks are frequently encountered. Nevertheless, one of the main obstacles in the execution of DAG tasks is that a task owner (i.e., a vehicle with a DAG task) in a vehicular network often fails to fulfill the task's execution requirements due to its limited on-board resources. To circumvent this, offloading the computation of DAG tasks from task owners to edge servers through the mobile edge computing (MEC) platform has been proposed [12, 13, 14]. However, such task offloading strategies often rely on vehicle-to-infrastructure (V2I) communications, which can suffer from a high latency (e.g., due to a high data traffic congestion on the fronthaul/backhaul links) and limited coverage (e.g., in suburban areas) [9]. In response to these limitations, vehicular clouds (VCs) have emerged as novel computing platforms that integrate heterogeneous and distributed computation resources of moving vehicles via opportunistic vehicle-to-vehicle (V2V) communications to build flexible and scalable computing topologies for real-time task processing [15, 16, 17]. Specifically, in a VC, DAG subtasks are dispersed across vehicles and the data needed for the execution of subtasks is transmitted via V2V links.

Fig. 1: A schematic of a DAG task describing a navigation application [27].
Although DAG task processing over VCs is promising, efficient scheduling of DAG subtasks across vehicles is a highly non-trivial problem, which resembles mixed integer programming (MIP) due to the existence of continuous and binary variables in the formulation (detailed in Section III-E). MIP are NP-hard problems [43], for which, dynamic programming [4, 7] and list scheduling algorithms [5, 12] have been widely used to obtain solutions. These algorithms, however, often suffer from a prohibitively high computation complexity, which renders them impractical for large-scale VC networks. Also, these algorithms require a prior knowledge about the system dynamics (e.g., time-varying V2V channel qualities), which is cumbersome to acquire in practical systems. To overcome these challenges, researchers have recently started exploring the learning-based methods, a popular example of which is deep reinforcement learning (DRL) [20, 21, 22, 23, 24, 25, 26]. Roughly speaking, DRL learns from interacting with an environment so as to generate real-time near-optimal mappings from the state space (detailed in Section IV-C) to the action space (detailed in Section IV-D) without requiring any prior knowledges about the environment.

Although DRL has shown a tremendous success in task scheduling/offloading [20, 21, 22, 23, 24, 25, 26], it cannot be readily adopted for scheduling of DAG tasks over dynamic VCs. This is due to the fact that DAG tasks' data (i.e., tasks' topologies) resides in a non-Euclidean space (i.e., graph). As a result, conventional DRL with handcrafted states designed to work with data in Euclidean spaces fails to automatically learn the topological information of DAG tasks, and thus can be hardly applied to unseen DAG task topologies upon deployment in real-world systems. To overcome this challenge, we propose to augment DRL with an emerging learning architecture called graph neural network (GNN). GNNs are capable of adaptively extracting discriminative features for each node of a graph based on the topological information aggregated from its neighboring nodes [41]. As a sub-category of GNNs, graph attention networks (GATs) have recently gained tremendous attentions, which extend the spatial convolution in convolutional neural networks (CNNs) to graph structures [42] and thus enjoy _inductive learning_, making their learned models generalizable to unseen graph topologies.

### _Overview and Summary of Contributions_

Inspired by the unique advantages of DRL and GNNs, we propose GA-DRL, a GNN-augmented DRL scheme to conduct DAG subtask-to-vehicle allocation aiming at minimizing the DAG task completion time. In doing so, we first model the VC-assisted DAG task scheduling as a Markov decision process (MDP). We then tailor a GAT to extract a set of features for each subtask of a DAG task. Finally, we integrate our developed GAT into the learning architecture of a double deep Q-network (DDQN) to generate subtask-to-vehicle allocation decisions, while taking into account the dynamics and heterogeneity of vehicles in a VC. Major contributions of this paper can be summarized as follows:

* We develop a multi-head GAT capable of extracting features for DAG subtasks. Particularly, our GAT conducts a two-way topological information aggregation by simultaneously considering predecessors and successors of each subtask. Further, we incorporate a non-uniform neighborhood sampling methodology into our GAT by codifying the scheduling priority of subtasks, making our GAT generalizable to unseen DAG task topologies upon being deployed over the real-world systems.
* We propose a DDQN to conduct subtask-to-vehicle allocation decisions according to the extracted features of subtasks by our GAT, while taking into account the dynamics and heterogeneity of vehicles in a VC. Further, we incorporate an action mask module into the DDQN to avoid infeasible subtask-to-vehicle allocations, ensuring successful execution of subtasks.
* We evaluate the performance of GA-DRL on a real-world road network obtained from OpenStreetMap [10] where SUMO [11], one of the most popular softwares for generating traffic flow, is used to form a VC. Through simulating DAG tasks with various topologies, we reveal that GA-DRL can outperform existing benchmarks in terms of task completion time.

The rest of this paper is organized as follows: Section II contains the related work. In Section III, we present the system model and formulate the VC-assisted DAG task scheduling as a MIP problem. We develop GA-DRL in Section IV. In Section V, we present simulation results before concluding the paper in Section VI.

## II Related Work

Existing works on DAG task scheduling over cloud-assisted networks can be roughly divided into two categories with respect to the type of their scheduling mechanisms: _i_) heuristic-based algorithms [17, 12, 13, 3, 4, 15, 14, 3]; _ii_) learning-based methods [16, 18, 20, 21, 22, 23, 24, 25, 26]. Below, we summarize the contributions of these works, and highlight the differences between our methodology in this paper and prior works.

### _Heuristic DAG Task Scheduling_

#### Ii-A1 Static computing environment

Heuristic methods for DAG task scheduling have been extensively studied for static MEC networks with fully connected servers [12, 13, 4, 6, 12]. H. Topcuoglu _et al._ in [12] proposed HEFT algorithm, where each subtask is assigned to the processor with the least execution time. In [3], L. F. Bittencourt _et al._ proposed forward looking attributions to improve the performance of HEFT. In [6], H. Kanemitsu _et al._ proposed a clustering-based DAG task scheduling algorithm via prioritizing assigning the subtasks located on the critical path to the same processor. G. C. Sih _et al._ in [4] adopted a compile-time-aware scheduling algorithm to dynamically allocate DAG subtasks over the existing processing units in the system. Recently, in [13], Y. Sahni _et al._ introduced JDOFH to simultaneously consider dependencies among DAG subtasks and start time of network flows to transmit the data of subtasks over the network.
#### Ii-A2 Dynamic computing environment

Few recent works have studied DAG task scheduling over dynamic networks [14, 15, 17]. Q. Shen _et al._ in [14] proposed DTOSC to conduct DAG task offloading and service caching in vehicular edge computing. F. Sun _et al._ in [15] addressed DAG task scheduling over VC via a modified genetic algorithm focusing on vehicles' dwell times. In [17], Y. Liu _et al._ developed MAMTS to prioritize allocation of different DAG tasks according to their computation topologies in vehicular edge computing.

The methodologies developed in the aforementioned works are heuristic, applying of which requires considerable number of iterations to reach locally optimal solutions. As a result they often suffer from prohibitively high computation complexities, which renders them impractical for real-time DAG task allocation. Also, these heuristic algorithms often presume a prior knowledge about the system dynamics (e.g., known time-varying V2V channel qualities), obtaining of which is extremely challenging in dynamic VCs, where the network topology may exhibit a significant temporal variation.

### _Learning-based DAG Task Scheduling_

#### Ii-B1 Static computing environment

DRL schemes have become one of the most popular learning-based techniques in the literature of task scheduling, especially for static MEC networks [20, 21, 22, 23, 24]. In [20], J. Yan _et al._ proposed an actor-critic DRL to learn the optimal DAG subtask assignment to access points. M. S. Mekala _et al._ in [21] developed a DRL-based DAG task offloading approach to reduce the utilization cost of edge servers. In [22], J. Wang _et al._ proposed a DAG task offloading methodology based on meta reinforcement learning. M. Goudarzi _et al._ in [23] introduced weighted actor-learner architectures for DAG task allocation over resource-constrained IoT devices. In [24], Z. Hu _et al._ presented a DRL-based Monte-Carlo tree search method to minimize DAG tasks' completion times through a clustered scheduler.

#### Ii-B2 Dynamic computing environment

Considering dynamic computing environments [16, 18, 25, 26], H. Liu _et al._ in [16] utilized a policy-based DRL for minimizing DAG tasks' completion times in multi-vehicle scenarios. In [18], J. Shi _et al._ proposed a DRL-based DAG task offloading scheme for vehicular fog computing considering the vehicles' mobility and availability. X. Wei _et al._ in [25] developed a DRL-based algorithm to jointly optimize the unmanned aerial vehicle trajectory planning, and DAG task scheduling. In [26], L. Geng _et al._ proposed a multi-agent actor-critic DRL to schedule DAG tasks in a vehicular edge computing network.

The DRL algorithms developed in the above works are based on handcrafted features, making them unable to fully capture the existing topological information in DAG tasks. This is because the state space of the DRL architectures studied in the above works merely contains basic, human-selected information regarding subtasks (e.g., their computation workloads, transmission data sizes, and number of predecessors/successors). As a result, the DRL methods explored in the above works are solely capable of making allocation decisions for DAG tasks with computation topologies that they have seen during their training period. In this work, we take the first steps towards addressing this limitation.

### _Footprints of GNNs in Mobile Edge Computing_

Recently, the success of GNNs in solving a variety of complex problems in wireless communications has been revealed [34, 35, 36, 37], while studying their application in the context of DAG task scheduling is still in early stages. In [34], Z. He _et al._ investigated the spectrum allocation in vehicle-to-everything networks based on the integration of GNNs and deep Q-learning. Y. Li _et al._ in [35] proposed a meta-reinforcement learning method for DAG task offloading in MEC platform, where the interdependencies between subtasks was extracted by GNNs. In [36], H. Lee _et al._ developed a graph convolution network (GCN) and DRL to effectively learn a priority-based scheduling policy for DAG tasks. J. Chen _et al._ in [37] proposed an algorithm called ACED for DAG task offloading, where a GCN is leveraged to capture the topological information of DAG subtasks.

The aforementioned works either ignore the topology of computation-intensive tasks (e.g., interdependencies among subtasks) [34] or focus on static MEC environments, overlooking the dynamics and instability of resource provisioning [35, 36, 37], which are significant features of VCs. Moreover, the GCN architecture developed in [36, 37] relies on _transductive learning_, which requires knowing the graph structure of DAG tasks upfront. As a result, their learned solutions for DAG task scheduling are not applicable to unseen DAG task topologies, which makes them suffer from a prohibitively high training overhead for each newly arrived DAG task to the system. In this work, we are particularly interested to address the shortcomings mentioned above.

## III System Model and Problem Formulation

In this section, we first give an overview of the system of our interest, DAG task model, vehicle mobility model, and computation offloading model. We then obtain an optimization formulation for VC-assisted DAG task scheduling. Table I summarizes the major notations used in this section.

### _System Overview_

We consider a time-slotted VC-assisted DAG task scheduling scenario, which is coordinated by a road side unit (RSU) with coverage diameter of \(D\). We presume that the area comprises \(|\mathcal{V}|\) vehicles collected by the set \(\mathcal{V}=\{v_{m}\mid 1\leq m\leq|\mathcal{V}|\}\). In order to fulfill its DAG task completion demands, a task owner engages in offloading its DAG task with \(|\mathcal{B}|\) subtasks collected by the set \(\mathcal{B}=\{b_{i}\mid 1\leq i\leq|\mathcal{B}|\}\) to other vehicles1.

Footnote 1: This paper investigates the DAG task scheduling problem for a single task owner with a single DAG task in one VC for analytical simplicity. Cooperations and resource sharing among VCs and competitions between multiple task owners to acquire computation resources are left as future work.

Fig. 2 shows a schematic of our VC of interest for the DAG task topology depicted in Fig. 1, subtask \(b_{0}\) is a virtual
subtask executed on the task owner (detailed in Section III-B). After receiving the offloading request from the task owner (i.e., \(v_{1}\)), the RSU acts as a centralized coordinator [16], which processes a set of collected data (e.g., locations and resources of vehicles) to assign DAG subtasks to vehicles. Specifically, in Fig. 2, virtual subtask \(b_{0}\) is assumed to be executed on the task owner locally, while subtask \(b_{1}\) is allocated to vehicle \(v_{3}\). After executing subtask \(b_{1}\), vehicle \(v_{3}\) is scheduled to transmit the output data of subtask \(b_{1}\) to vehicles \(v_{2}\) and \(v_{4}\) for processing subtasks \(b_{2}\) and \(b_{3}\). Due to the interdependencies among DAG subtasks, the execution of subtask \(b_{4}\) relies on the output data of both subtasks \(b_{2}\) and \(b_{3}\). Hence, vehicles \(v_{2}\) and \(v_{4}\) will both be scheduled to transmit their output data to vehicle \(v_{5}\). Finally, vehicle \(v_{5}\) will send a feedback (i.e., the final result of DAG task processing) to the RSU. The main assumptions made in this paper are summarized below:

* It is assumed that VC remains stationary during each time slot [39].
* We presume that a single vehicle can only handle one subtask at a time [21]. Consequently, if multiple subtasks are assigned to a vehicle, they must wait until resources become available2. Footnote 2: Upon having vehicles that can process multiple subtasks simultaneously, those vehicles can be modeled as multiple virtual vehicles with unlimited contact duration among them, where each of them can process one subtask at a time.
* Due to the mobility and the limited contact durations among vehicles, this paper only focuses on one-hop data transmission between vehicles [38].
* Since the size of the feedback sent to the RSU is usually smaller than that of the original input data, the time it takes to transmit this feedback is neglected [30].

### _DAG Task Model_

Without loss of generality, we index the task owner as \(v_{1}\) with a computation-intensive DAG task, which is represented by a graph \(\mathcal{G}=(\mathcal{B},\mathcal{E})\). In graph \(\mathcal{G}\), \(\mathcal{B}=\{b_{i}\mid 1\leq i\leq|\mathcal{B}|\}\) denotes the set of subtasks, and \(\mathcal{E}\) denotes the set of directed edges, where \(e_{i,j}\in\mathcal{E}\) indicates that subtask \(b_{i}\) has to be completed before the execution of subtask \(b_{j}\). To better capture the sequential execution nature of DAG tasks, we further define the set of immediate _predecessors_ of each subtask \(b_{i}\) as \(\mathcal{P}_{i}=\{b_{j}\mid b_{j}\in\mathcal{B},e_{j,i}\in\mathcal{E}\}\). Similarly, we define the set of immediate _successors_ of each subtask \(b_{i}\) as \(\mathcal{S}_{i}\). For example, in Fig. 1, we have \(\mathcal{B}=\{b_{1},b_{2},b_{3},b_{4}\}\), \(\mathcal{E}=\{e_{1,2},e_{1,3},e_{2,4},e_{3,4}\}\), \(\mathcal{P}_{4}=\{b_{2},b_{3}\}\), and \(\mathcal{S}_{1}=\{b_{2},b_{3}\}\). Furthermore, to make our analysis tractable, we introduce a virtual subtask to the DAG task topology denoted by \(b_{0}\), which is connected to subtask(s) with no immediate predecessors as shown in Fig. 2.

### _Vehicle Mobility Model_

We assume that each vehicle \(v_{m}\) is driving at a random and constant speed \(g_{m}\) (meters per second). Since the speeds of vehicles are non-negative, we adopt a truncated Gaussian distribution [32] to capture them. Specifically, for any value of speed \(g\), the probability density function of the truncated Gaussian distribution is defined as

\[\widehat{F}(g)=\frac{2F\left(g\right)}{\Phi\left(\frac{g_{\text{max}}-\mu_{a} }{\sigma_{g}\sqrt{2}}\right)-\Phi\left(\frac{g_{\text{min}}-\mu_{a}}{\sigma_{g }\sqrt{2}}\right)}, \tag{1}\]

where \(\Phi(x)=\frac{2}{\sqrt{2\pi}}\int_{0}^{x}e^{-t^{2}}dt\) is the Gaussian error function, and \(g_{\text{max}}\) and \(g_{\text{min}}\) are defined as the maximum and minimum

Fig. 2: VC-assisted cooperative DAG task scheduling scenario.
speed of vehicles, respectively. In (1), \(F\left(g\right)\) is the probability density function of a Gaussian distribution which is given by

\[F\left(g\right)=\frac{1}{\sigma_{g}\sqrt{2\pi}}\exp\left(\frac{-(g-\mu_{g})^{2}} {2\sigma_{g}^{2}}\right), \tag{2}\]

where \(\mu_{g}\) is the average speed of all vehicles, and \(\sigma_{g}\) is the standard deviation.

Considering resource provisioning for DAG subtasks is conducted by vehicles that are located in the VC (i.e., within the coverage of the RSU), we utilize the notion of the _dwell time_ to characterize vehicles' mobility. Specifically, considering that a contact event (i.e., V2V link formation) can happen between two vehicles as long as they have not left the VC, we define the dwell time of vehicle \(v_{m}\) in the VC as interval \([AT_{m},DT_{m}]\), where \(AT_{m}\) and \(DT_{m}\) represent the arrival and departure time of \(v_{m}\) at and from the VC, respectively, between which vehicle \(v_{m}\) is available to offer its computation resource.

### _Computation Offloading Model_

**Path Loss Model.** Let \((x_{m}(t),y_{m}(t))\) denote the 2D coordinates of each vehicle \(v_{m}\) at time slot \(t\), to consider the impact of dynamics of VCs on V2V links, we first adopt a dual-slope piecewise-linear model [29] to represent the propagation loss (in dB) between two vehicles \(v_{m}\) and \(v_{n}\), denoted by \(PL\left(d_{m,n}(t)\right)\), as follows:

\[PL\left(d_{m,n}(t)\right)=PL_{\mathsf{LoS}}\left(d_{m,n}(t)\right)+\beta,\ \forall v_{m},v_{n}\in\mathcal{V}, \tag{3}\]

where \(d_{m,n}(t)=\sqrt{(x_{m}(t)-x_{n}(t))^{2}+(y_{m}(t)-y_{n}(t))^{2}}\) (in meters) denotes the Euclidean distance between vehicles \(v_{m}\) and \(v_{n}\) at time slot \(t\), and \(\beta\) is an additional attenuation factor modeled according to a lognormal random variable with mean \(\mu_{\beta}=5+\text{max}(0,15\text{log}_{10}(d_{m,n}(t))-41)\) (in dB) and standard deviation \(\sigma_{\beta}=4.5\) (in dB). In (3) \(PL_{\mathsf{LoS}}\left(d_{m,n}(t)\right)\) is the path loss of the light-of-sight (LoS) transmission between two vehicles, which is given by

\[PL_{\mathsf{LoS}}\left(d_{m,n}(t)\right)=32.4+20\text{log}_{10}( d_{m,n}(t))\] \[+20\text{log}_{10}(F_{c})+\delta,\ \forall v_{m},v_{n}\in\mathcal{V}, \tag{4}\]

where \(F_{c}\) is the center frequency (in GHz), and \(\delta\) captures the effect of signal power fluctuations due to surrounding objects modeled by a lognormal random variable with standard deviation \(\sigma_{\delta}=3\) (in dB).

We then introduce the notion of _ready time_ which enables us to develop our scheduling methodology for DAG tasks by taking their sequential execution into account.

**Definition 1**.: _(Ready Time). Ready time \(RT_{i}\) indicates the time when all of the immediate predecessors of subtask \(b_{i}\) are completed/finished, which corresponds to the starting time of data transmission between \(b_{j}\) (\(b_{j}\in\mathcal{P}_{i}\)) and the vehicle that processes \(b_{i}\):_

\[RT_{i}=\max_{b_{j}\in\mathcal{P}_{i}}\{AFT_{j}\},\ b_{i}\in\mathcal{B}, \tag{5}\]

_where \(AFT_{j}\) is the actual finish time of subtask \(b_{j}\) when it is practically executed on a vehicle._

**Transmission Model.** Combining (3) - (5), we let \(TT_{i,m;j,n}\) denote the data transmission time associated with edge \(e_{i,j}\) when subtasks \(b_{i}\) and \(b_{j}\) are allocated to vehicles \(v_{m}\) and \(v_{n}\), respectively, which can be calculated as

\[TT_{i,m;j,n}=\left\{\begin{array}{l}c_{i,j}\Psi\left(PL\left(d_{m,n}(RT_{j })\right)\right),\ m\neq n\\ 0,\
over the VC as the following mixed integer programming (MIP):

\[\min_{\mathcal{I}}\ \max_{b_{i}\in\mathcal{B},v_{m}\in\mathcal{V}} \{EFT_{i,m}\xi_{i,m}\},\] (9) s.t. \[(\ref{eq:C1}),(\ref{eq:C2}),\] \[\sum_{v_{m}\in\mathcal{V}}\xi_{i,m}=1,\ b_{i}\in\mathcal{B},\] (C1) \[\xi_{i,m}\in\{0,1\},\ b_{i}\in\mathcal{B},\ v_{m}\in\mathcal{V},\] (C2) \[\bigcap_{b_{i}\in\mathcal{B}_{m}}[EST_{i,m},EFT_{i,m}]=\varnothing, \ v_{m}\in\mathcal{V},\] (C3) \[EST_{i,m}\geq EFT_{j,n},\ b_{i}\in\mathcal{B},\ b_{j}\in\mathcal{ P}_{i},\ v_{m},v_{n}\in\mathcal{V},\] (C4) \[\left[EST_{i,m},EFT_{i,m}\right]\subset\left[AT_{m},DT_{m}\right],\ b_{i}\in\mathcal{B},\ v_{m}\in\mathcal{V}.\] (C5)

In (9), the objective function captures the sequential execution of DAG subtasks, where the maximum finish time of all subtasks indicates the overall DAG task completion time. Also, constraint (C1) guarantees that each subtask is allocated to only one vehicle, while (C2) restricts the value of the allocation indicator \(\xi_{i,m}\) to be binary. Constraint (C3) ensures that a vehicle can only process one subtask at a time, where \(\mathcal{B}_{m}=\{b_{i}\ |\ \xi_{i,m}=1,\ 0\leq i\leq|\mathcal{B}|\}\) denotes the set of subtasks processed on vehicle \(v_{m}\). Constraint (C4) indicates that the processing of a subtask can not start until all of its predecessors are completed, (C5) guarantees the availability of computation resources of vehicles with respect to the vehicles' dwell times: the earliest start time and earliest finish time of executing each subtask \(b_{i}\) on vehicle \(v_{m}\) should between the arrival time and departure time of vehicle \(v_{m}\) in a VC.

It is known that MIP formulations similar to what we have in (9) are NP-hard [36]. Also, considering the sequential execution of DAG subtasks (i.e. different subtasks may be executed at different time slots), we need the prior knowledge of the V2V path loss and availability of vehicles' computation resources, obtaining of which is cumbersome in practice. As a result, to tackle these challenges, we propose a GNN-augmented DRL scheme, named GA-DRL, to efficiently find near-optimal solutions for (9).

## IV GNN-Augmented DRL (GA-DRL) for DAG Task Scheduling over Dynamic VCs

In this section, we first provide an overview of our GA-DRL methodology and the challenges we aim to address. We then tailor a GAT module for extracting features of subtasks. Subsequently, the VC-assisted DAG task scheduling is modeled as an MDP consisting of the state space, action space, and reward. Finally, we utilize a DDQN architecture to tackle (9) and discuss its training procedure.

### _GA-DRL Overview and Challenges_

#### Iv-A1 GA-DRL overview

Our method takes a different approach from traditional DRL methods developed for task scheduling [16, 18, 25], which only consider predetermined states, such as computation workload, data size, and number of subtask predecessors/successors. Instead, we propose a GNN-augmented DRL approach that automatically learns distinctive subtask features and creates assignments between subtasks and vehicles. In particular, as shown in Fig. 3, the features of subtasks are acquired through a GAT module, rather than being predetermined.

Our GA-DRL conducts subtask-to-vehicle allocations through a sequence of decision steps. At each decision step \(k\), the DRL agent functioning at the RSU diligently collects relevant data on the system _state_\(s^{(k)}\), which includes the extracted features of current subtask obtained by GAT, as well as the parameters of the vehicles describing their dynamics and heterogeneity. DRL agent then feeds state \(s^{(k)}\) to a DDQN. The objective of DDQN is to effectively assign subtasks to vehicles by determining the best course of _action_\(a^{(k)}\). To this end, DDQN evaluates the value of each state-action combinations, and conducts a subtask-to-vehicle allocation \(a^{(k)}\), which moves the system to the next state \(s^{(k+1)}\). Finally, the DRL agent receives a _reward_\(r^{(k)}\), that aids in the training of a deep learning model. This, in turn, enhances the agent's ability to take better actions over time.

#### Iv-A2 Main challenges

When applying GA-DRL to the VC-assisted DAG task scheduling, there are two main challenges that need to be tackled.

**(1) Feasibility of allocation decisions.** Unlike static computing environments that have stable, fully-connected computing servers [3, 4, 6], the dynamics of VC's resources can

Fig. 3: A schematic of our GNN-augmented DRL scheme for VC-assisted DAG task scheduling.
greatly affect the execution of DAG subtasks. This is captured by constraint (C5) in (9), satisfying of which guarantees the time-interval of processing subtask \(b_{i}\) on vehicle \(v_{m}\) to be within the dwell time of \(v_{m}\). Ensuring that subtask-to-vehicle allocation decisions are feasible (specifically, meeting constraint (C5)) can be difficult because neural networks typically lack a module to filter out infeasible actions.

**(2) Generalizability of designed GNN.** Efficient inductive learning is a key feature of GAT [31], which makes it suitable for using with previously unseen graph topologies. However, it can be difficult to ensure that the GNN model is applicable to various DAG tasks, as each task has its own unique topology and interdependence among subtasks. To overcome this challenge, we must carefully encode the information of each DAG task's topology to achieve meaningful results when combined with our later developed GAT.

Table II summarizes the major notations used in this section.

### _Graph Neural Network_

In this subsection, we explain the structure of GNNs and how we use a multi-head GAT to extract distinctive features of subtasks. Our GAT incorporates a two-way aggregation method that considers the topological information of both pre-decessors and successors of each subtask. To further enhance the adaptability of our GAT to new DAG tasks, we utilize a ranking-based sampling technique.

#### Iii-B1 Architecture of GNNs

The architecture of a GNN is depicted in Fig. 4, where a GNN takes raw features of all subtasks as the input and subsequently generates result features containing corresponding topological information of the DAG task. Specifically, GNN utilizes an **Aggregate** function to accumulate the topological information passed by the neighbors of each subtask. The accumulated information is then modified through a nonlinear **Update** function. This procedure is repeated \(L\) times to create the result feature for each subtask.

**Raw feature of each subtask.** Similar to conventional DRL methods [20, 21, 22, 23, 24], which rely on human-selected information to define DAG subtasks, we also define the raw feature3 of each subtask \(b_{i}\) as

Footnote 3: Super-index \(0\) is used to capture that these are initial features of the subtask, which are later processed and enhanced through GNN.

\[h_{i}^{(0)}=\{u_{i},\overline{c_{i}},|\mathcal{P}_{i}|,|\mathcal{S}_{i}|\},\ b_{i}\in\mathcal{B},\ b_{j}\in\mathcal{S}_{i}, \tag{10}\]

where \(u_{i}\) is the computation workload of subtask \(b_{i}\), and \(\overline{c_{i}}=\sum_{b_{j}\in\mathcal{S}_{i}}\frac{c_{i,j}}{|\mathcal{S}_{i}|}\) indicates the average transmission data size associated with edges \(e_{i,j},\ b_{j}\in\mathcal{S}_{i}\). Also, \(|\mathcal{P}_{i}|\) and \(|\mathcal{S}_{i}|\) represent the number of predecessors and successors of subtask \(b_{i}\), respectively.

**Neighbor set of each subtask.** Considering that DAG subtasks are executed sequentially, we define \(\mathcal{N}_{i}\) as the neighbor set of each subtask \(b_{i}\) which includes all of its predecessors as well as \(b_{i}\) itself; mathematically

\[\mathcal{N}_{i}=\{b_{j}\mid e_{j,i}\in\mathcal{E}\}\cup\{b_{i}\}. \tag{11}\]

Through an iterative process involving the use of **Update** and **Aggregate** functions, GNN obtains the result feature of each subtask \(b_{i}\). Mathematically, at each iteration \(\ell\), we have

\[h_{i}^{(\ell+1)}=\textbf{Update}(\textbf{Aggregate}(\{h_{j}^{(\ell)}|b_{j}\in \mathcal{N}_{i}\})), \tag{12}\]

where \(h_{i}^{(\ell+1)}\) denotes the result feature of subtask \(b_{i}\) at iteration \(\ell\). Through \(L\) iterations, the GNN derives the final result feature for each subtask, denoted by \(h_{i}^{(L)}\). This feature incorporates both the raw feature of each subtask (i.e., at \(\ell=0;h_{i}^{(0)}\)), as well as the topological information from neighboring subtasks (i.e., \(\mathcal{N}_{i}\)) within the DAG task.

Hereafter, we detail the **Aggregate** and the **Update** functions designed to extract features of DAG subtasks.

#### Iii-B2 Multi-head GAT

Considering that the subtasks involved in \(\mathcal{N}_{i}\) have different computation workloads, transmission data sizes and interdependencies, we employ an attention mechanism, which is inspired by [31] to assign diverse weights to subtasks with the aim of enhancing information of key subtasks. Specifically, at each iteration \(\ell\), we define an attention-based aggregation function called **Aggregate4** as

Footnote 4: Super-index \(0\) is used to capture that these are initial features of the subtask, which are later processed and enhanced through GNN.

\[\textbf{Aggregate}^{\textbf{at}}(\{h_{j}^{(\ell)}|b_{j}\in\mathcal{N}_{i}\})= \hskip-11.381102pt\sum\limits_{b_{j}\in\mathcal{N}_{i}}\alpha_{i,j}^{(\ell)}W ^{(\ell)}h_{j}^{(\ell)}, \tag{13}\]

where \(W^{(\ell)}\) is a trainable weight matrix at iteration \(\ell\), and \(\alpha_{i,j}^{(\ell)}\) is a normalized attention coefficient at iteration \(\ell\), which measures the relative importance of subtask \(b_{j}\) to subtask \(b_{i}\) as follows:

\[\alpha_{i,j}^{(\ell)}=\frac{\exp\left(A^{(\ell)}[W^{(\ell)}h_{i}^{(\ell)}||W^{ (\ell)}h_{j}^{(\ell)}]\right)}{\sum\limits_{b_{j^{\prime}}\in\mathcal{N}_{i}} \exp\left(A^{(\ell)}[W^{(\ell)}h_{i}^{(\ell)}||W^{(\ell)}h_{j^{\prime}}^{(\ell )}]\right)}. \tag{14}\]

In (14), \(A^{(\ell)}\) is a trainable vectors at iteration \(\ell\), and \(\cdot||\cdot\) denotes the vector concatenation.

Further, in order to enhance the effectiveness of GAT's learning process, we propose to use a multi-head GAT, where different attention heads learn to give more relevant weights to different subtasks. Let \(Z\) denote the total number of heads. Each attention head, denoted by \(z\) will individually aggregate topological information of subtasks, in conjunction with other

Fig. 4: A schematic of architecture of GNN for extracting the features of the DAG task depicted in Fig. 1. The colored squares in the diagram correspond to different features.
attention modules. The multi-head attention-based aggregation function called \(\textbf{Aggregate}^{\text{mat}}\) can be then formulated as

\[\textbf{Aggregate}^{\text{mat}}(\{h_{j}^{(\ell)}|b_{j}\in\mathcal{N }_{i}\})\] \[=\frac{1}{Z}\sum_{z=1}^{Z}\left(\sum_{b_{j}\in\mathcal{N}_{i}} \alpha_{i,j}^{(\ell)(z)}W^{(\ell)(z)}h_{j}^{(\ell)}\right), \tag{15}\]

where iteration index \(\ell\) and head index \(z\) are both used as superscripts hereafter.

To better suit our problem, we aim to modify the \(\textbf{Aggregate}^{\text{mat}}\) function defined in (15) through developing a two-way aggregation for the multi-head GAT. This approach takes into consideration the predecessors and successors of each subtask, which helps to aggregate topological information in a more effective manner.

#### Iii-B3 Two-way aggregation

To execute DAG subtasks, capturing the conditions of predecessors and successors of each subtasks are equally important. As a result, we develop a two-way aggregation approach that utilizes two different types of attention heads. This approach involves using the inverse neighbor set \(\mathcal{N}_{i}^{-1}\) of each subtask \(b_{i}\), which includes all of its successors and \(b_{i}\) itself

\[\mathcal{N}_{i}^{-1}=\{b_{j}\mid e_{i,j}\in\mathcal{E}\}\cup\{b_{i}\}. \tag{16}\]

At each iteration \(\ell\), half of the attention heads from \(Z\) are then allocated to collect topological information from the neighboring subtasks, while the remaining half is utilized to gather topological information from the inverse neighbor set, which leads to the modification of (15) to

\[\textbf{Aggregate}^{\text{mat}}(h_{j}^{(\ell)})=\frac{1}{Z}\Bigg{[} \sum_{z=1}^{Z/2}\Bigg{(}\sum_{b_{j}\in\mathcal{N}_{i}}\alpha_{i,j}^{(\ell)(z)}W ^{(\ell)(z)}h_{j}^{(\ell)}\Bigg{)}\] \[+\sum_{z=Z/2}^{Z}\Bigg{(}\sum_{b_{j}\in\mathcal{N}_{i}^{-1}} \alpha_{i,j}^{(\ell)(z)}W^{(\ell)(z)}h_{j}^{(\ell)}\Bigg{)}\Bigg{]}. \tag{17}\]

We then aim to further modify the \(\textbf{Aggregate}^{\text{mat}}\) function defined in (III-B3). This makes out GAT module different from other existing GNNs [34, 35, 36, 37]: we do not consider all the neighbors of a given subtask to accumulate topological information. Instead, we opt for a weighted sample of neighbors, based on their scheduling priority. This approach allows our GAT to be more generalizable to unseen DAG task topologies. We next describe this approach.

#### Iii-B4 Ranking-based sampling

We first devise an approach to prioritize scheduling of subtasks based on their ranking value. By employing a recursive method, we determine the ranking value of each subtask \(b_{i}\) labeled as \(rank_{i}\) as follows:

\[rank_{i}=\max_{b_{j}\in\mathcal{P}_{i}}\{rank_{j}+\overline{u_{j}}+\overline{ c_{j,i}}\},\ b_{i}\in\mathcal{B}, \tag{18}\]

where \(\overline{u_{j}}\) is the average execution cost of subtask \(b_{j},b_{j}\in\mathcal{P}_{i}\), which is given by

\[\overline{u_{j}}=\frac{\sum_{m=1}^{|\mathcal{V}|}u_{j}/f_{m}}{|\mathcal{V}|}, \ v_{m}\in\mathcal{V}, \tag{19}\]

and \(\overline{c}_{j,i}\) denotes the average transmission cost associated with edge \(e_{j,i},b_{j}\in\mathcal{P}_{i}\) at the beginning (i.e., at time slot \(0\)), which is given by

\[\overline{c_{j,i}}=\frac{\sum_{m=1}^{|\mathcal{V}|}\sum_{n=1}^{|\mathcal{V}|} c_{j,i}\Psi\left(PL\left(d_{m,n}\left(0\right)\right)\right)}{\left|\mathcal{V} \right|^{2}}. \tag{20}\]

Assuming \(rank_{0}=0\) for virtual subtask \(b_{0}\), we maintain a subtask scheduling priority list \(\mathcal{L}^{\text{rank}}\) as

\[\mathcal{L}^{\text{rank}}=\{b_{i}\succ b_{j}\mid b_{i},b_{j}\in\mathcal{B}, \ rank_{i}<rank_{j}\}, \tag{21}\]

where the preference relation \(b_{i}\succ b_{j}\) indicates that subtask \(b_{i}\) has a higher scheduling priority compared with subtask \(b_{j}\) due to a lower value of \(rank_{i}\)4.

Footnote 4: Our current ranking method for DAG subtasks relies on heuristics, which may limit the GNN-augmented DRL algorithm’s ability. We plan to address this issue by exploring alternative methods for determining the scheduling priority of DAG subtasks using DRL in the future.

Finally, we define \(\mathcal{N}_{i}^{\text{rank}}\) as a ranking-based neighbor set of subtask \(b_{i}\) which contains the subtasks sampled from \(\mathcal{N}_{i}\). The sampling probability/weight of subtask \(b_{j}\) from \(\mathcal{N}_{i}\) to be included in \(\mathcal{N}_{i}^{\text{rank}}\), denoted by \(p_{j}\), is calculated as

\[p_{j}=\frac{\exp\left(rank_{j}\right)}{\sum_{b_{j^{\prime}}\in\mathcal{P}_{i}} \exp\left(rank_{j^{\prime}}\right)}. \tag{22}\]

This weighted subtask sampling method leads to improving the generalizability of our method by intentionally losing topological information passed by the subtasks which are not sampled, which makes our GAT model less sensitive to the topological variations in DAG tasks. This resembles the dropout [19] mechanism widely leveraged in training deep neural network. Note that subtask sampling is done with replacement if the sample size is larger than the size of \(\mathcal{N}_{i}\).

**Aggregate function.** By integrating aforementioned methodologies, our designed \(\textbf{Aggregate}^{\text{mat}}\) function not only enables information enhancement of key subtasks by considering a two-way multi-head attention-based aggregation, but also improves generalizability by considering a ranking-based sampling; mathematically

\[\textbf{Aggregate}^{\text{mat}}(h_{j}^{(\ell)})=\frac{1}{Z}\Bigg{[} \sum_{z=1}^{Z/2}\Bigg{(}\sum_{b_{j}\in\mathcal{N}_{i}^{\text{rank}}}\alpha_{i,j} ^{(\ell)(z)}W^{(\ell)(z)}h_{j}^{(\ell)}\Bigg{)}\] \[+\sum_{z=Z/2}^{Z}\Bigg{(}\sum_{b_{j}\in\mathcal{N}_{i}^{-\text{ rank}}}\alpha_{i,j}^{(\ell)(z)}W^{(\ell)(z)}h_{j}^{(\ell)}\Bigg{)}\Bigg{]}, \tag{23}\]

where \(\mathcal{N}_{i}^{-\text{rank}}\) is the inverse ranking-based neighbor set of subtask \(b_{i}\) sampled from the \(\mathcal{N}_{i}^{-1}\) using a similar sampling method described in (22).

**Update function.** After receiving aggregated topological information in (23), we apply the exponential linear unit activation (ELU) [48] in the **Update** function. Finally, combining
the aforementioned **Aggregate** and **Update** functions, we can express (12) as

\[h_{i}^{(\ell+1)} =\textbf{ELU}\Bigg{(}\frac{1}{Z}\Bigg{[}\sum_{z=1}^{Z/2}\Bigg{(}\sum _{b_{j}\in\mathcal{N}_{i}^{\text{rank}}}\alpha_{i,j}^{(\ell)(z)}W^{(\ell)(z)}h_ {j}^{(\ell)}\Bigg{)}\] \[\quad+\sum_{z=Z/2}^{Z}\Bigg{(}\sum_{b_{j}\in\mathcal{N}_{i}^{ \text{rank}}}\alpha_{i,j}^{(\ell)(z)}W^{(\ell)(z)}h_{j}^{(\ell)}\Bigg{)}\Bigg{]} \Bigg{)}. \tag{24}\]

In our experiments, we found that our approach could achieve high performance with \(L=2,Z=4\), where \(W^{(1)}\in\mathbb{R}^{4\times 16}\), \(A^{(1)}\in\mathbb{R}^{32\times 1}\), and \(W^{(2)}\in\mathbb{R}^{16\times 32}\), \(A^{(2)}\in\mathbb{R}^{64\times 1}\).

A flow chart of the relationships between the components developed for **Aggregate** function is shown in Fig. 5. Also, **Algorithm** 1 details the corresponding procedure of our GAT module with computation complexity \(\mathcal{O}(|\mathcal{B}|LZ)\), where we assume a set of learned parameters (i.e., \(W^{(\ell)(z)}\) and \(A^{(\ell)(z)}\)). These parameters are later optimized in conjunction with DDQN parameters. We next formulate DAG task scheduling as an MDP with state, action, and reward representation.

### _State Representation_

The result feature of each subtask \(b_{i}\), denoted by \(h_{i}^{(L)}\), is generated through consecutive \(L\) iterations in (24). We assume subtasks to vehicles assignments through a series of decision steps indexed by \(k\), at each decision step \(k\), let subtask \(b_{\tau(k)}\) be the _current subtask_ waiting to be allocated to a vehicle, where \(\tau(k)\) indicates the subtask's index at position \(k\) in \(\mathcal{L}^{\text{rank}}\). We define the system state \(s^{(k)}\) as follows:

\[s^{(k)}=\Big{\{}h_{\tau(k)}^{(L)},\mathcal{I}^{(k-1)},\mathcal{A}^{(k)}, \mathcal{O}^{(k)}\Big{\}}, \tag{25}\]

where \(\mathcal{I}^{(k-1)}\) denotes subtask-to-vehicles allocation decisions for the subtasks located before current subtask \(b_{\tau(k)}\) in \(\mathcal{L}^{\text{rank}}\), and \(\mathcal{A}^{(k)}=\{avail_{1},avail_{2},\cdots,avail_{|\mathcal{V}|}\}\) is the availability indicator set at the instant of decision step \(k\), where \(avail_{m}=1\) denotes that vehicle \(v_{m}\) is available for offering its computation resource or processing current subtask, and \(avail_{m}=0\) otherwise. Also, \(\mathcal{O}^{(k)}=\{(x_{m},y_{m})\mid v_{m}\in\mathcal{V}\}\) is the instantaneous location of vehicles at decision step \(k\).

### _Action Space_

During each decision step \(k\), we need to determine which vehicle should be assigned to each subtask based on the system state \(s^{(k)}\) and subtask scheduling priority list \(\mathcal{L}^{\text{rank}}\). In particular, at decision step \(k\), for current subtask \(b_{\tau(k)}\), action \(a^{(k)}\) is defined as

\[a^{(k)}\in\{1,2,\cdots,|\mathcal{V}|\}, \tag{26}\]

where \(a^{(k)}=1\) implies that current subtask \(b_{\tau(k)}\) is processed locally on task owner \(v_{1}\), and \(a^{(k)}\in\{2,\cdots,|\mathcal{V}|\}\) implies that current subtask \(b_{\tau(k)}\) is allocated to other vehicles for a faster execution.

### _Reward Design_

At decision step \(k\), given state \(s^{(k)}\), we associate performing action \(a^{(k)}\) for allocating of current subtask \(b_{\tau(k)}\) to an immediate reward \(r^{(k)}\) leveraged to evaluate the quality of action \(a^{(k)}\). We define the reward \(r^{(k)}\) as the decrease in the \(EFT\) of all subtasks as

\[r^{(k)}=\underbrace{\max_{b_{i}\in\mathcal{B},v_{m}\in\mathcal{V}}\{EFT_{i,m }^{(k-1)}\}}_{\text{(I)}}-\underbrace{\max_{b_{i}\in\mathcal{B},v_{m}\in \mathcal{V}}\{EFT_{i,m}^{(k)}\}}_{\text{(II)}}, \tag{27}\]

where term (I) and (II) denote the maximum DAG task completion time before and after scheduling the current subtask, respectively. We next demonstrate the rationality of reward function introduced above.

Fig. 5: A flow chart of the relationships between different components of our methodology in Section IV-B.
**Rational of the Choice of Reward.** Let \(K\) denote the total number of decision steps. According to (27), the discounted cumulative reward can be calculated as

\[R=\sum_{k=1}^{K}\gamma_{1}^{k}r^{(k)}\] \[=\!\!\!\sum_{k=1}^{\infty}\gamma_{1}^{k}\Big{(}\max_{b_{i}\in \mathsf{B},v_{m}\in\mathcal{V}}\{EFT_{i,m}^{(k-1)}\}\max_{b_{i}\in\mathsf{B},v_ {m}\in\mathcal{V}}\{EFT_{i,m}^{(k)}\}\Big{)}, \tag{28}\]

where \(\gamma_{1}\) is the discount factor. Assuming \(\gamma_{1}=1\) for simplicity, since at decision step \(k\), we determine the allocation of only the current subtask \(b_{\tau(k)}\) according to scheduling priority list \(\mathcal{L}^{\text{ank}}\), we have \(K=|\mathcal{L}^{R}|=|\mathcal{B}|\). Thus, (28) can be rewritten as

\[R=\sum_{k=1}^{K}\Big{(}\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(k-1 ),m}\}-\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(k),m}\}\Big{)}\] \[=\Big{(}\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(0),m}\}-\max_{v_{m} \in\mathcal{V}}\{EFT_{\tau(1),m}\}\] \[+\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(1),m}\}+\cdots-\max_{v_{m }\in\mathcal{V}}\{EFT_{\tau(K),m}\}\Big{)}\] \[=-\Big{(}\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(K),m}\}-\max_{v_{m }\in\mathcal{V}}\{EFT_{\tau(0),m}\}\Big{)}, \tag{29}\]

where we define \(b_{\tau(0)}\) as the virtual subtask with \(\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(0),m}\}=0\). The last result in (29) (i.e., term \(-\max_{v_{m}\in\mathcal{V}}\{EFT_{\tau(K),m}\}\)) indicates that maximizing the cumulative reward is consistent with minimizing the task completion time given in (9).

Hereafter, in order to solve the above mentioned MDP, we resort to a DDQN, which adopts the action (i.e., subtask-to-vehicle allocation) at each decision step yielding the largest Q-value (i.e., state-action value) prior to DAG task scheduling over dynamic VCs.

### _Double Deep Q-Network_

#### Iv-F1 Deep Q-network

We first describe DQN methodology [49], which paves the way for DDQN. In DQN, we have two deep neural networks (DNNs) called _predict_ Q-network \(Q(s,a;\theta^{\text{p}})\) and _target_ Q-network \(Q(s,a;\theta^{\text{t}})\). Particularly, \(\theta^{\text{p}}\) and \(\theta^{\text{t}}\) are the vectors of weights/parameters of DNNs, and \(s\) and \(a\) denote the state and action, respectively.

**Predict Q-value.** At each decision step \(k\), given state \(s^{(k)}\), using the predict Q-network, the DRL agent first estimates/predicts the Q-value \(Q(s^{(k)},a;\theta^{\text{p}})\) of all actions \(a=1,2,\cdots,|\mathcal{V}|\), where \(s^{(k)}\) consists of the extracted feature of current subtask \(b_{\tau(k)}\) and vehicles' parameters given in (25). Q-value is a measure of the quality of the action: a higher Q-value is an indicator to a better action.

**Action selection.** The DRL agent then performs an action \(a^{(k)}\) using a max mathematical estimator as follow

\[a^{(k)}=\text{argmax}_{a}Q(s^{(k)},a;\theta^{\text{p}}),a\in\{1,2\cdots| \mathcal{V}|\}. \tag{30}\]

The DRL agent then receives a reward \(r^{(k)}\) computed by (27).

**Target Q-value.** The system subsequently transits to the next state \(s^{(k+1)}\), and the DRL agent resorts to target Q-network for calculating the target Q-value of state \(s^{(k)}\), denoted by \(\mathsf{y}^{(k)}\):

\[\mathsf{y}^{(k)}\!=\!r^{(k)}+\gamma_{2}\underbrace{Q\left(s^{(k+1 )},\underbrace{\text{argmax}_{a}Q\left(s^{(k+1)},a;\theta^{\text{t}}\right)}_{ \text{(II)}};\theta^{\text{t}}\right)}_{\text{(II)}},\] \[a\in\{1,2\cdots|\mathcal{V}|\}. \tag{31}\]

To obtain the parameter \(\theta^{\text{p}}\), the mean square error, denoted by \(\mathsf{G}(\theta^{\text{p}})\), is used with discount factor \(\gamma_{2}\) as follows

\[\mathsf{G}(\theta^{\text{p}})\!=\!\frac{1}{2}\left[\mathsf{y}^{(k)}-Q(s^{(k)}, a^{(k)};\theta^{\text{p}})\right]\!\!
Using which the parameter \(\theta^{\mathsf{p}}\) is obtained, the weights of the target network \(\theta^{\mathsf{t}}\) are then periodically copied from the predict network \(\theta^{\mathsf{p}}\).

### _Training Process_

We consider training of DRL through a series of _episodes_, where each episode contains total of \(K\) sequential decision steps. At each decision step \(k\), DRL agent generates a pair of observation \((s^{(k)},a^{(k)},r^{(k)},s^{(k+1)})\). An episode is considered to be complete when a vehicle is assigned the subtask with the lowest scheduling priority, which is listed in the last position of \(\mathcal{L}^{\mathsf{rank}}\) (i.e, \(K=|\mathcal{B}|\)).

#### Iv-G1 Q-network training

Based on policy gradient algorithm [40], predict Q-network \(Q(s,a;\theta^{\mathsf{p}})\) is trained by iteratively tuning the weights \(\theta^{\mathsf{p}}\) at each decision step \(k\) through minimizing the mean square error given in (34) as follows:

\[\theta^{\mathsf{p}}\leftarrow\theta^{\mathsf{p}}-\mu\frac{ \partial\mathsf{G}(\theta^{\mathsf{p}})}{\partial\theta^{\mathsf{p}}} \tag{35}\]

where \(\mu\) is the tunable learning rate. As for the target Q-network \(Q(s,a;\theta^{\mathsf{t}})\), \(\theta^{\mathsf{t}}\) is copied from \(\theta^{\mathsf{p}}\) at beginning, and \(\theta^{\mathsf{t}}\) will be iteratively updated to \(\theta^{\mathsf{p}}\) after conducting some iterations (5 decision steps in our simulations).

We adopt a \(\epsilon\)-greedy policy to select action, in which the DRL agent probabilistically explores the actions which have not been adopted yet instead of an action with the maximum Q-value in (30). Also, we leverage a replay buffer \(\mathcal{R}\) to store the sequence of \((s^{(k)},a^{(k)},r^{(k)},s^{(k+1)})\) obtained through decision steps \(k\). In particular, the gradient in (35) is obtained by selecting mini-batches of data from the reply buffer. At each decision step \(k\), we consider the feasibility of actions for the current subtask \(b_{\tau(k)}\). Actions that meet constraint (C5) are defined as feasible, while the others are infeasible. We leverage action mask [47] technique to prevent DDQN from performing infeasible actions. In this approach, the Q-value for an infeasible action is set to a large negative value, to ensure that taken actions are feasible.

#### Iv-G2 GAT training

The state \(s^{(k)}\) which consists of the extracted features of current subtask \(b_{\tau(k)}\) is obtained from the GAT with parameters \(\mathcal{W}=\{W^{(\ell)(z)}\mid 1\leq\ell\leq L,\ 1\leq z\leq Z\}\) and \(\mathcal{A}=\{A^{(\ell)(z)}\mid 1\leq\ell\leq L,\ 1\leq z\leq Z\}\). Thus, we can rewrite the right hand-side of (34) as

\[\left[r^{(k)}+ \gamma_{2}Q\left(s^{(k+1)}(\mathcal{W},\mathcal{A}),\operatorname {arg\,max}_{a^{*}}Q\left(s^{(k+1)},a^{*},\theta^{\mathsf{p}}\right);\theta^{ \mathsf{t}}\right)\right.\] \[-Q(s^{(k)}(\mathcal{W},\mathcal{A}),a^{(k)};\theta^{\mathsf{p}}) \right]^{2},a\in\{1,2\cdots|\mathcal{V}|\}, \tag{36}\]

which indicates that parameters \(\mathcal{W}\), \(\mathcal{A}\) and \(\theta^{\mathsf{p}}\) are trained simultaneously by minimizing (36) during the decision steps of the DRL agent.

**Algorithm** 2 presents a pseudocode of GA-DRL training procedure.

## V Performance Evaluation

In this section, we first provide parameter settings for simulations. We then study the convergence of GA-DRL. Finally, we compare the performance of GA-DRL with four DAG task scheduling benchmarks in terms of the task completion time.

### _Simulation Setting_

**Simulation environment.** All neural networks considered in this work are implemented using PyTorch 2.0.0 [44] and Python 3.8.1 platforms, and Adam [45] is leveraged to optimize networks. In our simulations, we consider a real-world highway traffic region as shown in Fig. 7(a) of size 1km\(\times\)1km in Xiamen, China, obtained from OpenStreetMap [10]. Moreover, SUMO [11] is utilized to import mobile vehicles using the mobility model developed in (1)-(2), and subsequently emulate a real-world VC as shown in Fig. 7(b). Also, the arrival time of each vehicle, i.e., \(AT_{m}\), is assumed to be uniformly distributed in \([1,5]\) (in second) for analytical simplicity, and \(\mu_{g}=50\) (in Kliometres per hour) with \(\sigma_{g}=10\).

**Parameter setting of DAG tasks.** The task owner has a DAG task which is generated according to [5]. We assume

Fig. 7: VC network visualization.
that the computation capability of each vehicle is uniformly distributed in \([1,10]\) (in GHz) [19], the distance between different vehicles during the task scheduling process are captured by SUMO, and function \(\Psi(\cdot)\) in (6) is defined as \(\Psi\left(PL\left(d_{m,n}(t)\right)\right)=0.15PL\left(d_{m,n}(t)\right)+0.001\)[38]. Also, the computation workload of each subtask is uniformly distributed in \([1,2]\) (in Gigalock cycles) [26] and the transmission data size of each edge is uniformly distributed in \([100,500]\) (in KB) [26]. During training, we have chosen \(\epsilon\)-greedy policy with \(\epsilon=0.9\) and discount factor \(\gamma_{2}=0.9\).

### _Convergence Performance_

In Fig. 8, we depict the convergence behavior of GA-DRL with respect to the number of episodes. Note that the best convergence and reward values are achieved when the GA-DRL's learning rate is 0.0001. On the other hand, as the learning rate increases from 0.0001 to 0.0005, the average reward is significantly decreased due to the instability of learning. As a result, we fix the learning rate of the GA-DRL to 0.0001 when comparing it with benchmarks in the following.

### _Benchmarks_

To study the performance of GA-DRL, we implement four DAG task scheduling benchmarks, including LPS, HEFT [12], MGA [15], and DRLOSM [46] as detailed below.

* _Local processing scheme (LPS):_ All subtasks are processed locally by the task owner itself without offloading to other vehicles.
* _Heterogeneous earliest finish time (HEFT) [12]:_ All subtasks are first sorted according to their ranking value in (24). The subtasks are assigned to the vehicles that can complete them in the shortest time. The HEFT algorithm does not take into account the constraint of V2V transmission (C5) since it was designed for a static computing environment. We assume that subtasks-to-vehicles allocations that do not satisfy constraint (C5) are executed locally.
* _Modified genetic algorithm (MGA) [15]:_ MGA considers an integer encoding to denote subtask-to-vehicle assignments. The assignments with high fitness (i.e., low task completion time) are stochastically selected to perform crossover (i.e., exchange their processing vehicles). Finally, a mutation (i.e., changing the processing vehicle) is adopted to avoid early convergence. MGA considers a VC environment satisfying V2V communication constraint (C5).
* _DRL offloading scheduling method (DRLOSM) [46]:_ DRLOSM is an improved version of the method proposed in [46]. All subtasks are first sorted according to their ranking value in (24). DRLOSM uses a DDQN architecture, where at decision step \(k\), the raw feature of _current subtask_\(b_{\tau(k)}\) is integrated in \(s^{(k)}\) without the use of GNNs. DRLOSM also satisfies the V2V communication constraint (C5) through an action mask module.

### _Simulation Results of Randomly Generated DAG Tasks_

We conduct performance evaluations by analyzing the average completion time of DAG tasks for various numbers of layers5 of DAG tasks, subtasks, and vehicles in the network. The results are the average performance obtained via 100 independent Monte-Carlo iterations. Also, to compare the generalizability of DRLOSM and our GA-DRL, during the training period, we use the same DAG task topology, while deploying them for various DAG task topologies under performance evaluation.

Footnote 5: The number of layers of a DAG task refers to the length of the longest path from the starting subtask to the finishing subtask. For a DAG task with a fixed number of subtasks, as the number of layers increases/decreases, there are more/less subtasks that are successors of the same subtask, implying a higher/lower potential for parallelism during the task execution.

#### V-D1 Impact of the number of vehicles in VC

The results presented in Fig. 9 illustrate the impact of increasing the number of vehicles from 1 to 20 on the completion time of the DAG task. The experiment was conducted with 20 subtasks and 5 layers. We observed that when only one vehicle is involved in VC, all DAG subtasks have to be executed sequentially and locally, resulting in the same completion time across different algorithms. However, as the number of vehicles increases, the completion of DAG tasks is significantly accelerated due to the sufficient computation resources. Overall, GA-DRL outperforms other algorithms in terms of task completion time. Itis 51.63\(\%\) better than LPS, 27.82\(\%\) better than HEFT, 24.69\(\%\) better than MGA, 5.17\(\%\) better than DRLOSM at 5 vehicles; and is 57.59\(\%\) better than LPS, 25.15\(\%\) better than HEFT, 17.08\(\%\) better than MGA, and 10.41\(\%\) better than DRLOSM at 20 vehicles.

#### V-D2 Impact of the number of subtasks

In Fig. 10, we can see the evaluation of the completion time for DAG tasks as the number of subtasks increases. In this experiment, we set the number of vehicles involved in the VC at 10, and the number of layers at 5. The results show that our proposed GA-DRL algorithm outperforms the other four benchmarks, achieving faster task completion times. Additionally, Fig. 10

Fig. 8: Average reward under different learning rates.
demonstrates the effectiveness of GA-DRL compared to conventional DRL in terms of generalizability. As the number of subtasks increases from 25 to 30, the task completion time of DRLOSM becomes longer than that of both MGA and HEFT. This is due to the fact that the topologies of DAG tasks become more complicated, making the DRLOSM algorithm, which relies solely on human-selected features without the usage of GNNs, unable to capture the topological information of the newly generated DAG task topologies. On the other hand, our GA-DRL algorithm benefits from the subtasks' features, which are automatically learned from GAT, making its models well generalizable to unseen DAG task topologies. In summary, the performance of GA-DRL in terms of the task completion time is 27.29\(\%\) better than LPS, 19.87\(\%\) better than HEFT, 13.76\(\%\) better than MGA, 11.29\(\%\) better than DRLOSM at 10 subtasks; and is 59.84\(\%\) better than LPS, 11.01\(\%\) better than than HEFT, 0.08\(\%\) better than MGA, and 15.19\(\%\) better than DRLOSM at 30 subtasks.

#### Iv-D3 Impact of the number of layers within DAG task

In Fig. 11, it is evident that changing the number of DAG task layers from 4 to 8 has a significant impact on the completion time of the DAG task. In this result, we considered 20 subtasks and 10 vehicles. It is observed that increasing the number of layers leads to a longer completion time. This is because, as the number of layers increases, the parallelism of the DAG task decreases, resulting in more subtasks being executed in a sequential manner. This, in turn, leads to a longer task completion time. The performance of GA-DRL in terms of the task completion time is 61.39\(\%\) better than LPS, 29.31\(\%\) better than HEFT, 23.35\(\%\) better than MGA, 8.27\(\%\) better than DRLOSM at 4 layers; and is 30.41\(\%\) better than LPS, 14.04\(\%\) better than HEFT, 4.36\(\%\) better than MGA, and 1.38\(\%\) better than DRLOSM at 8 layers.

### _Simulation Results for Real Application DAG Task_

In Fig. 12, we illustrate a real-world DAG task of a modified molecular dynamic code [12]. The subtasks' computation workload and transmission data size were set according to the parameter settings, and we considered 20 vehicles in the result. Table III presents the performance comparison of various benchmarks, except LPS6, with respect to the DAG task completion time (in seconds) and the algorithm running time (in seconds). It is important to note that DRLOSM, which solely learns from human-selected features of subtasks without the usage of GAT, exhibits a higher task completion time than others, such as HEFT, MGA, and our GA-DRL. This is a clear indication of the superiority of generalization of our GA-DRL, especially in the case of a large number of subtasks. Additionally, MGA has the longest running time among the benchmarks due to its internal iteration time for convergence. However, our GA-DRL shows better performance in terms of task completion time at the mild cost of higher algorithm running time. The performance of GA-DRL is \(19.09\%\) better

Fig. 11: Performance evaluations upon considering the different numbers of layers within DAG task.

Fig. 10: Performance evaluations upon considering the different numbers of subtasks within DAG task.

Fig. 9: Performance evaluations upon considering the different numbers of vehicles within VC’