## 2 Materials and Methods
### Preliminaries
#### 2.2.1 Heterogeneous Nodes Transformation  
In the context of our study, a heterogeneous graph, denoted as G = (V, E), serves as a foundational representation, where V = {\(v_{1}\),\(v_{2}\), \(\cdots\), \(v_{k}\)} denotes the set of node types and E = {\(e_{1}\),\(e_{2}\), \(\cdots\), \(e_{n}\)} signifies the set of edge types. Within this heterogeneous graph, the union of nodes and edges (V + E > 2) reflects the rich diversity inherent in the graph structure. Figure 1 provides a visual representation of a heterogeneous graph illustrating the sales process of Xinjiang juijubes. This graph encompasses various node types, including  
producers (P), distributors (D), and retail markets (R). The connections within the graph capture the intricate relationships between nodes, with producers supplying through distributors and directly to retailers. This heterogeneous graph model serves as a pivotal framework for our analysis, allowing us to encapsulate the multifaceted nature of the Xinjiang jujube sales market and providing the foundation upon which our proposed HMAGNN operates. Within a heterogeneous graph G, nodes of different types often possess varying feature dimensions. To standardize the processing of these diverse node features, a transformation matrix is applied to project them into a shared feature space. This transformation is mathematically expressed as:  
\[h^{\prime}_{i}=W_{\phi_{i}}\cdot h_{i} \tag{1}\]  
Here, \(W_{\phi_{i}}\) represents the mapping matrix, \(\phi_{i}\) denotes the mapping specific to type \(i\), and \(h^{\prime}_{i}\) signifies the node feature following the projection mapping. This transformation process ensures that node features across distinct types are brought into alignment, enabling consistent analysis and computation in subsequent stages. The mapping matrix \(W_{\phi_{i}}\) encapsulates the learned relationships and dependencies required to effectively project features from type-specific spaces to a unified feature space. By employing this transformation, the HMAGNN can seamlessly navigate the intricacies of the Xinjiang jujube sales market, where diverse node types play vital roles in the sales process. The uniform representation of features facilitates a more robust and comprehensive analysis, contributing to the efficacy of the proposed model in handling the complexity inherent in heterogeneous graph structures. To deepen the understanding of the structural intricacies within a graph, HMAGNN initiates the extraction of a local subgraph tailored for the target link, serving as a pivotal component for subsequent training phases. This localized subgraph encapsulates pertinent neighbor information relative to the target link. Local subgraph extraction offers several advantages over global calculations that span the entire graph. First, it reduces computational complexity, making the modeling process more efficient. Second, by focusing on local environments, it enables a more nuanced understanding of node characteristics and attributes within specific contexts. This nuanced understanding, in turn, enhances the model's ability to generalize to unseen data while concurrently reducing the risk of overfitting. Consequently, local subgraph extraction is pivotal in enhancing the model's generalization performance. The size of this local subgraph is dynamically determined by a hyperparameter, denoted as K, which represents the number of nodes in the graph. The process commences by including first-order neighbors pertaining to the target node pair \((x,y)\) into the local subgraph. Subsequently, higher-order neighbors are sequentially incorporated. Should the total number of nodes within the local subgraph remain  
Figure 1: An example of a heterogeneous graph for Xinjiang jujube sales. (**a**) Three types of nodes: producers, distributors, and retailers. (**b**) A heterogeneous graph representing Xinjiang jujube sales with three node types and two types of connections. below the predefined K, virtual nodes are strategically introduced.