Research Article
Multitask Learning with Graph Neural Network for Travel Time Estimation
Algorithm 1
The dependency between road segments along the path.
| Input: sp, p, , ts, t | | Output: | | Initialize matrix: randomly | | Initialize vector: randomly | | Initialize scalar: randomly | | // sp: the speed tensor. | | // : the speed after GAT operation. | | // P: the given path. | | // : the neighbor road segments of the object road segment. | | // ts: the start time of the given path. | | // t: the return travel time of the road segment. | | // j: the ID number of the object road segment. | (1) | //The road segment ID involving the given path | (2) | while i < |p| | (3) | [i] = sp[i] | (4) | //The time step K; | (5) | for s = ts; s < K; s++ do | (6) | //The neighbor road ID of the object road segment. | (7) | for j = i; j < |N (i)| + 1; j++ do | (8) | // The correlation of the neighbor road segments. | (9) | (see (4)) | (10) | [j][s] = | (11) | end for | (12) | [j][s + t] = | (13) | end for | (14) | | (15) | end while | (16) | Return |
|