Abstract
The graph isomorphism, as a key task in graph data analysis, is of great significance for the understanding, feature extraction, and pattern recognition of graph data. The best performance of traditional methods is the quasi-polynomial time complexity, which is infeasible for huge graphs. This paper aims to propose a lightweight graph network to resolve the problem of isomorphism in huge graphs. We propose a partitioning algorithm with linear time complexity based on isomorphic necessary condition to handle network graphs that cannot be fully computed by a single computer. We use anti-weight convolution analysis and skip connections to obtain a more stable representation with fewer layers and parameters. We implement simulations on personal computer (PC) with graphs consisting of hundred millions of edges, demonstrating the identification performance () and time efficiency.

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
1. Introduction
Artificial intelligence (AI) is increasingly integrated into scientific discovery to enhance and expedite research processes, providing insights beyond traditional scientific methods [1]. Recent advancements in AI, such as self-supervised learning and geometric deep learning, have improved scientific breakthroughs by enabling models to train on vast unlabeled data and leverage structural knowledge of scientific data [2, 3]. Generative AI techniques, capable of analyzing diverse data modalities like images and sequences, have facilitated designs of small-molecule drugs and proteins [4, 5]. Other achievements like solving the protein-folding problem and conducting AI-driven simulations of complex molecular systems underscore AI's potential in tackling intricate scientific challenges [6, 7].
Graph isomorphism (GI) is a fundamental problem in theoretical computer science [8]. The best classical algorithm takes quasi-polynomial time [9], which is inefficient for large graphs in applications, see examples shown in figure 1. The graph neural networks (GNNs) as efficient approaches has been introduced to predict graph similarity [10–14]. GNNs can yield useful representations of graph data from the intrinsic symmetries of graphs [15–21]. However, the existed GNN models do not focus on large graphs, lacking of the stability of graph embedding and the scalability.
Figure 1. Schematic isomorphic tasks in social networks and chemistry. (a) Two graphs differ by one edge (red line). (b) Two isomers of anti-tumor drug teniposide (C32H32O13S) with different activity, bioavailability, and toxicity characteristics.
Download figure:
Standard image High-resolution imageThe large graph can be simplified by partitioning it into several isomorphic subgraphs, and the task of detecting isomorphism in the entire graph becomes easier. Dividing the network graph into a set of subgraphs typically involves breaking the original graph into smaller components based on specific rules. The concept of isomorphism suggests that if two network graphs are isomorphic, the corresponding pairs of subgraphs are also isomorphic. Consequently, all corresponding subgraphs are isomorphic can serve as strong evidence for the isomorphism of the original graph. Furthermore, the witnessed identical subgraph patterns may indicate structural connection between the graphs. This further aids in uncovering structural features within the network graph [22].
In real-world scenarios, the complexity of graphs often exceeds the range assumed by traditional isomorphism detection algorithms [23]. For example, it may contain millions or even billions of vertices and edges, making exhaustive search strategies impractical. Other factors such as data noise, missing information, or intentional confusion further increase the difficulty of identifying isomorphic pairs [24]. Although there are necessary conditions for determining whether two graphs are isomorphic, such as the same degree sequence or eigenvalue spectrum [25], these conditions are not sufficient to guarantee the isomorphism of the two graphs. Hence, it is very important to develop algorithms that can effectively distinguish between truly isomorphic graphs and surface similar graphs.
In this paper, we introduce a lightweight graph neural network (LGNN) for resolving the isomorphism problem of large graphs. The first stage is to divide a large network graph into multiple subgraphs, which accelerates the speed of traversal, update, aggregation, and other operations on the large network. The second is to extract features that ensure different isomorphic networks have different representations by combining injective transformations, enhancing representation capabilities while maintaining the simplicity of network layers. The last is utilizing the learned graph features to determine the isomorphism between two graphs. LGNN exhibits low computational complexity and storage requirements. The simulation results show that the present method has good performance for large-scale network graphs with PC, as well as other tasks such as node classification and graph classification. Compared to other models, our method has higher and more stable accuracy, as well as higher efficiency, demonstrating its practicality in practical applications.
2. Graph isomorphism problem
Given two graphs and
, they are isomorphic if and only if there is a one-to-one mapping
such that for any edge
, there is
with
. Here, V and E represent nodes and edges of the network graph
, respectively. All graphs considered here are finite and simple.
Graph isomorphism (GI) emerged as a computational problem in the 1950s, initially used to match a molecular graph with a database of similar graphs [26]. Its significance grew in the 1970s when it was recognized as one of the few natural problems in the NP complexity class [8]. To determine graph isomorphism, one may look for a matching between two graphs [27]. A prominent method is the Weisfeiler–Leman algorithm [28], which includes a series of algorithms parameterized by a positive integer dimension and commences with the fundamental one-dimensional version known as color refinement or naive vertex classification, see one example shown in figure 2. This method has evolved into the k-dimensional Weisfeiler–Leman algorithm (k-WL) or for graphs of Euler genus g [29]. In contrast to the Weisfeiler–Leman classifications, there exist algorithms that leverage group theory [30–32]. Notably, Babai's quasipolynomial-time algorithm represents a significant advancement over all former approaches [9].
Figure 2. Examples of color segmentation. It updates their own information based on node labels, and finally obtains the quantity of each different representation in the entire graph.
Download figure:
Standard image High-resolution imageAll the previously mentioned algorithms are limited in their ability to handle large graphs. The emergence of graph neural networks (GNNs) has brought about more efficient approaches for graph isomorphism analysis [13]. GNNs typically utilize recursive neighborhood aggregation (or message passing) schemes, where each node aggregates its neighbors' feature vectors to calculate its updated feature vector [10, 19] while the overall graph representation is then derived through pooling [33–35]. One example is Graph Convolutional Networks (GCNs) [36], promising outcomes in graph and node classification tasks. GraphSAGE [18] adopts diverse strategies to tackle GCNs, by learning a function that generates embeddings by sampling and aggregating features from the node's local neighborhood. Moreover, Graph Attention Networks (GATs) introduce a novel method to address limitations of prior approaches reliant on graph convolution or its approximations by employing a masked self-attention layer [37–39], offering a straightforward correction to the sequence of GAT operations. GNNs have found widespread applications such as social network analysis, bioinformatics, drug discovery, recommendation systems, natural language processing, and computer vision.
These methods can be used to resolve graph isomorphism problems. GCN [36] provides an effective framework for learning the structure and attribute information of graphs. But it is limited by its fixed convolution kernel size and cannot capture long-range dependencies. Another example is Graph Isomorphism Network (GIN) [10] that demonstrates strong ability to distinguish most non isomorphic graphs while maintaining good generalization performance. But, its computational cost may be high when dealing with very large graphs or complex graph structures. GraphSAGE [18] is another GNN variant that focuses on using sampling and aggregation methods to process large-scale graph data. GraphSAGE allows for efficient node representation learning on incomplete or large-scale graphs, but its sampling strategy may result in information loss, especially in complex or sparse graph structures. GATs [37–39] introduces attention mechanism to weight the information of node neighbors, which enables the model to focus on the most important neighboring nodes. GATs can learn more refined and dynamic node representations, however, it has a high computational complexity in calculating attention coefficients for each pair of nodes.
In addition, numerous studies have focused on subgraph matching problems, thereby enhancing the application [14, 40] and performance of GNNs [22]. One example is DMPNN [40] which employs specific edge-to-vertex transformations and leverages the isomorphism properties in the edge-to-vertex dual graph to asynchronously improve substructure representation learning for subgraph isomorphism counting and matching, as well as unsupervised node classification. Another is GSN [22], which explicitly encodes structural roles as part of the message-passing process to capture richer topological properties. By selecting different substructures, one can build the model with various inductive biases tailored to the graph distribution at hand. In contrast, Count-GNN [22] introduces a novel approach that utilizes edge-centric aggregation to encode fine-grained structural information, which is theoretically more expressive than traditional node-centric aggregation. Additionally, Count-GNN incorporates query-conditioned graph modulation to adapt structure matching to different queries from the graph perspective.
Compared to traditional GNNs, the aforementioned models enhance feature extraction by encoding structural roles as features derived from specific substructures. However, due to the difficulty of subgraph isomorphism problems in the worst case, it requires exploring efficient algorithms such as pruning to eliminate unnecessary search branches and approximation algorithms to quickly obtain near-optimal solutions, to accelerate the matching process. Nonetheless, the time and memory demands associated with feature extraction cannot be overlooked, which limits the applicability of these methods to large network graphs.
3. Proposed framework
3.1. Overall framework
We demonstrate the implementation framework for studying graph isomorphism problems using graph neural networks in figure 3. The framework consists of three parts. We firstly partition large graphs that cannot be processed by the neural network at once by using algorithm 1, and obtain the corresponding subgraph lists. And then, a lightweight graph neural network (LGNN) (upper part of figure 3) is used for feature extraction transformation to obtain the injective transformation of the network graph. Finally, the isomorphism results of the subgraph list can be further analyzed to obtain network graph similarity, subgraph isomorphism, and graph isomorphism.
Figure 3. Schematic network model for graph isomorphism consisting of three blocks of graph partition, LGNN and output.
Download figure:
Standard image High-resolution imageAlgorithm 1 |
---|
Input: Graph: ![]() |
Output: Ω: Subgraphs List |
1: Initialize: st = 0, cur = 0 |
2: for d in Dord do: |
3: ![]() |
4: if ![]() |
5: ![]() |
6: ![]() |
7: ![]() |
8: end if |
9: end for |
3.2. Graph partition
We design a linear-complexity graph partition algorithm to reduce the complexity of GI. The subgraphs obtained from structural partition of isomorphic graphs are isomorphic, while nonisomorphic graphs have a higher probability to obtain different subgraphs. There are two primary reasons why the likelihood of obtaining different subgraphs from non-isomorphic graphs is greater. First, the inherent diversity in nonisomorphic graphs contributes to this probability. Since these graphs possess distinct structural features, the subgraphs extracted from them are more likely to exhibit different structures. Second, the independence of subgraphs plays a crucial role. As the differences between nonisomorphic graphs increase, the likelihood of extracting the same subgraph from both diminishes. This principle generally holds true for sets of graphs with varying structures, as the internal structural differences lead to a wider variety of subgraphs present within each graph. Notably, even when two non-isomorphic graphs share the same node degree sequence (i.e. each node has the same degree), significant structural differences may still exist, leading to the presence of different types of subgraphs within them.
In algorithm 1, we begin by sorting the nodes in the network graph based on their connectivity to derive Nodes and Edges, which represent the connections in the graph. Subsequently, we create a degree dictionary structured as . Each (key, value) pair in
signifies nodes with a specific degree of connectivity. To simplify the process, we define the number of nodes with a particular degree of connectivity as
. These nodes are then segmented to form a list of subgraphs denoted as Ω. Starting from the node with the highest degree, we progressively add nodes until reaching the minimum required number of nodes in the subgraph. Nodes at the cut-off degree in the current subgraph are all included to prevent errors caused by random node truncation at that degree. The current subgraph
is composed of all nodes within it and their corresponding edges from the original graph. The limit on the number of nodes k may not be a fixed value; instead, it can be defined as a proportion of the total number of nodes in the original graph, such as one-third. This often reflects a trade-off between the accuracy and efficiency. While cutting off original edge connections to isolate a subgraph can lead to misjudgments in analysis, partitioning a large graph into smaller subgraphs can significantly accelerate computation time.
The key of this classification method lies in the principles of Preferred Attachment and Assortativity. Nodes with high degrees tend to connect with other high-degree nodes, while low-degree nodes tend to connect with other low-degree nodes. Dividing subgraphs based on the maximum degree can minimize edge cuts, reducing the probability of misclassification due to isomorphism. A higher threshold for the number of nodes in each subgraph enhances the accuracy of the overall network graph assessment. By disregarding node and edge characteristics, the time complexity of algorithm 1 depends primarily on the sorting algorithm, with a proper sorting algorithm achieving linear time complexity.
3.3. LGNN
LGNN updates the feature vectors of each node to learn the network structure and features of other nodes around. The representation of node v in the mth hidden layer Npooling is given by

where N(v) denotes the set of all nodes in graph except for the node v,
denotes the combining function used by the node v in the mth and
th layers, which can be a concatenation or simple operation. Moreover, denote
as the aggregation function used by the node v in the mth layer. We choose simple summation instead of excessive redundant operations to ensure the injectivity and efficiency of the aggregation and combination functions as shown in figure 4.
Figure 4. Diagram of Mx layer in LGNN.
Download figure:
Standard image High-resolution imageNote that equation (1) requires more layers to obtain sufficient depth of expression when facing large network graphs, which is a limitation on both time and memory. So, we introduce an AntiWeightConv (AWConv) layer (M defaults to 1) after NPooling Layer to obtain a new node representation as (see figure 4)

where σ is a monotonically non-decreasing activation function, γ is an intensity moderating factor, default to 0.1, denotes the aggregation function of node in the u neighborhood, and
is the antisymmetric weight matrix. The inverse weight matrix ensures the long-term dependency relationship between graph network in propagation and nodes, and prevent gradient explosion or disappearance.
Our model does not necessitate a deep architecture beyond A-DGNs [41]. However, the large-scale nodes can still impact the interdependencies among nodes, particularly in scenarios with a high density of neighboring nodes, where the influence of the nodes themselves will be excessively squeezed.
For the graph level representation, the graph level readout function GPooling is defined by

where R is a simple permutation invariant function, such as the summation, or a graph level pooling function [27, 42]. We rank the expression ability of sum, mean, and max aggregators on multiple sets [10], and select sum aggregators that can capture complete multiple sets. In each update module, a full graph representation will be obtained. As the number of iterations increases, the node representation corresponding to the structure become more refined and global. The iterative information from all depths (N defaults to 3) of the model will be used by using an architecture similar to skip connection.
LGNN uses an isomorphism discriminator module named I-D to make judgments on the output of the model, which is defined by

where r is the embedded representation of a network graph after it being processed by LGNN, Δ is a positive small number, i.e. if
, 0 otherwise. Different from previous graph classifications that only required processing a single network graph [10], LGNN can distinguish the embedding relationship between two network graphs and perform backpropagation based on isomorphic labels. The embedding results from GNN are differentiable for the calculation of isomorphism loss. LGNN is then regarded as an injective transformation of a graph, performing different operations after distinguishing the unique representations of two graphs.
4. Experiments
Small and medium datasets. We use four social network datasets (I-M, R-B, R-M, and CLAB) [43], as shown in table 1. We use benchmark isomorphism analysis methods to obtain isomorphic pairs in the dataset. In order to evaluate isomorphic tasks, we have added new attributes named as Isgraphs, which includes isomorphic relationships and isomorphic pairs in datasets.
Table 1. Features of small and medium datasets.
Datasets | I-M | CLAB | R-B | R-M |
---|---|---|---|---|
graphs | 5000 | 1500 | 2000 | 5000 |
Avg nodes | 74.5 | 13.0 | 429.6 | 508.5 |
Isgraphs | 33 284 | 145 192 | 2006 | 5013 |
Large datasets. We randomly generate five large network graph datasets, as shown in table 2. For the design of isomorphic network graphs, we adopt a random shuffling method, which randomly shuffles but does not damage the structure of the network. For the non-isomorphic network graphs, we perform some small perturbations of a given network, by randomly replacing certain edge connections or reducing a few nodes or edges to ensure the resulting network graph is not isomorphic. We evaluate four levels of network graphs, where Lx: () represents the average number of nodes V and edges E in the dataset Lx. There are L1: (E4, E5), L2: (E4, E6), L3: (E5, E6), L4: (E6, E7), and supplementary dataset L5: (E3, E5) The isomorphism task on these large datasets is a new attempt compared to the previous GNNs.
Table 2. Features of large datasets.
Datasets | L1 | L2 | L3 | L4 |
---|---|---|---|---|
graphs | 200 | 200 | 200 | 200 |
Avg nodes (104) | 1 | 1 | 10 | 100 |
Avg node_degrees | 10 | 100 | 10 | 10 |
Preprocessing and baseline. In the label generation phase, where the real dataset size is limited, we merge the Weisfeiler–Lehman (WL) testing and the VF2 method to extract isomorphic labels from the real dataset. The recognition rates obtained using these methods on the real dataset serve as benchmarks. However, when handling large network graphs in synthetic datasets, the WL testing and VF2 methods may exhibit high time complexity.
Our network architecture is designed to effectively handle large network graphs while accurately discerning the structures of smaller networks. This capability allows for scalability and robust performance across varying graph sizes. By comparing our network with traditional Graph Neural Networks (GNNs), we aim to showcase the advantages and improvements our model offers in terms of efficiency and accuracy in graph structure identification.
Settings and parameters. For small and medium datasets, we first identify all isomorphic relationships within the dataset using traditional isomorphism testing methods. Given the non-uniform distribution of these relationships, we select the I-M dataset containing the highest number of isomorphic connections and ensure an ample representation of isomorphic relationships through hierarchical sampling during both training and testing phases. By transferring the trained weights from the I-M dataset to other datasets, we can mitigate or reduce the substantial training time required for model parameter optimization. Notably, applying the parameters derived from the I-M dataset to other datasets yields promising results.
Our methodology incorporates three GNN layers, comprising the input layer, with batch normalization implemented on each hidden layer. We employ the Adam optimizer with an initial learning rate of 0.0001, reducing the learning rate by a factor of 0.5 every 50 epochs. The hyperparameters remain consistent across all datasets, with hidden units set to a size of 64, a minibatch size of 128, and a dropout ratio of 0.5. All experiments are executed on a personal computer leveraging an NVIDIA GeForce RTX 3050 Ti Laptop GPU.
Evaluation. We acknowledged the inherent data imbalance within the dataset and tackled this issue. To evaluate the effectiveness of our approach, we employed recognition accuracy and F1 Score as key metrics. To mitigate the impact of data distribution imbalances, we modified the loss function for the Siamese network by replacing the comparative loss function with the average absolute error loss function post the passage through an isomorphic discriminator. This modification streamlines calculations and eliminates the dependency on margin values often associated with comparative loss functions.
5. Results
We evaluated the present model on the small (I-M [43]), medium (R-B, R-M, and CLAB [43]) and large datasets. In order to evaluate isomorphic tasks, we added new attributes of the isomorphic relationships and isomorphic pairs to all the datasets of I-M, R-B, R-M, and CLAB [43]. We validated that the present model is not only suitable for large-scale network graph isomorphism task, but also maintains excellent performance in graph classification and node classification tasks.
5.1. Small and medium-size datasets
Model convergence. Figure 5(a) demonstrates the efficacy of our model's recognition capabilities for network structures. By utilizing a single discriminator in the Siamese network structure [44], our test model achieved convergence within a remarkably short duration of only 7 epochs, where the two network outputs are concatenated and subsequently processed by a linear layer discriminator (L-D),
Figure 5. Experimental performances on the small, medium, and large-scale network graphs. On small and medium-size datasets, evaluate training accuracy in I-M (a), average training time (b) and identification isomorphism rate, which verified that some models are not suitable for graph isomorphism tasks (c). On large-size datasets, we presented the relationship between the parameter quantity and recognition rate of various neural network models on the L2 dataset (d). The recognition rate (e) and time (f) of the remaining models on large network graph datasets. In (f), the time used by each model is represented in logarithmic scale to enhance contrast.
Download figure:
Standard image High-resolution imageFurthermore, upon introducing the isomorphism discriminator (I-D) with a predefined structure, our model exhibited exceptional performance by attaining a 100% accuracy rate across all graph pairs within the I-M dataset [43]. This achievement underscores the robust recognition capabilities of our model when tasked with identifying intricate network structures.
Training time. Figure 5(b) shows the average training time of the present model. On the I-M dataset, LGNN costs one half the time of GIN [10] and SAGE [18], and even 1/5 of GCN [36]. As the dataset increases, it only takes 1/100 to 1/10 of the time of other models on the R-B, R-M, and CLAB.
Recognition rate. Figure 5(c) shows superior performance of the present model in terms of isomorphism recognition rates across all four datasets compared to existing models such as GIN and GIUNet [12] within the framework [10], or GCN [36] in recognition accuracy on all datasets. Specifically, our model exhibits a 2% improvement over GCN on the I-M dataset and achieves performance enhancements over GIUNet, GIN, and GCN on the CLAB dataset by varying margins. The disparities in recognition rates observed in GATs [37, 38] and SAGE [38] may stem from the distinct weighting mechanisms employed for aggregating neighboring nodes within their architectures.
From these results, we exclude GATs and SAGE models in further experiments due to their performance discrepancies in the isomorphism recognition task. Our model's robust performance against baseline models underscores its efficacy and superiority in graph structure identification across diverse datasets.
5.2. Large datasets
Due to device limitations, we obtained up to L4 level datasets in experiments. Combining with Algorithm 1, the present model shows good performance on network graphs of various scales, related to its ability to recognize structures and generalizations.
Model parameters. Figure 5(d) showcases the relationship between parameter quantity and recognition rate for various neural network models on the L2 dataset. Our model stands out by considering both parameter quantity and recognition rate metrics, outperforming other models. Despite GIN potentially approaching our model's accuracy levels when employing 7 layers, the former significantly exceeds our model in terms of parameter count by almost 10k, as indicated in figure 5(d). On the other hand, GCN achieves a 21% accuracy rate with 9 layers; however, continued increases in layer depth result in complete unrecognizability, possibly attributed to excessive smoothness phenomena [45]. In the case of GATs, their multi-head mechanism necessitates a larger parameter count, with even a 3-layer network requiring 80k parameters. In contrast, our model achieves full detection of L2 isomorphism while maintaining a lower parameter count, highlighting its efficiency and effectiveness in comparison to these competing architectures.
Isomorphism performance. Table 3 shows that the present model has the shortest time on all datasets, requiring only about one-third of the time of other methods, especially on the L2 dataset, where accuracy and time exceed those of other methods. Figures 5(e) and (f) provide the more intuitive display of the model's performances. As shown in figure 5(e), GIN and GIUNet exhibit a sharp decline (by 6% and 33% respectively) in performance when dealing with dense L2 dataset (100 average degree of dataset). Instead, our model can maintain a stable level. In figure 5(f), as the size of the network graph increases from L1 to L4, the time complexity calculated by our model is approximately linear.
Table 3. Evaluation of recognition rate (%) and time (s) for large-scale network graphs. The short line '-' represents that the model cannot handle the current scale of the network graph.
Datasets | Accuracy (%) | Time (s) | ||||||
---|---|---|---|---|---|---|---|---|
L1 | L2 | L3 | L4 | L1 | L2 | L3 | L4 | |
GCN [36] | 0 | 0 | 0 | - | 3.34 | 28.91 | 42.64 | - |
GIN [10] | 100 | 94 | 100 | - | 3.51 | 33.05 | 43.01 | - |
GIUnet [12] | 100 | 67 | - | - | 3.02 | 28.46 | - | - |
LGNN | 100 | 100 | 100 | 100 | 1.05 | 12 | 22 | 297 |
5.3. Additional performances
We used multiple metrics to evaluate the performance of the model on the dataset, such as recall, precision, F1 score (as a percentage), and accuracy (1-error). We present the performance of each model on I-M and CLA in respective tables 4 and 5.
Table 4. Evaluation performances (%) on the I-M dataset. Bold numbers are the best performances.
LGNN | GIN | GIUNet | GCN | SAGE | GAT | GATv2 | |
---|---|---|---|---|---|---|---|
recall | 97.4 | 97.39 | 97.4 | 97.39 | 97.4 | 97.4 | 97.19 |
precision | 100 | 100 | 100 | 100 | 6.52 | 6.52 | 30.15 |
F1 | 98.68 | 98.68 | 98.68 | 98.68 | 12.22 | 12.22 | 46.02 |
1-err | 99.83 | 99.83 | 99.83 | 99.83 | 9.78 | 9.78 | 85.29 |
Table 5. Evaluation performances (%) on the CLA dataset. Bold numbers are the best performances.
LGNN | GIN | GIUNet | GCN | SAGE | GAT | GATv2 | |
---|---|---|---|---|---|---|---|
recall | 99.64 | 97.67 | 99.38 | 99.62 | 99.66 | 100 | 46.68 |
precision | 100 | 100 | 100 | 99.98 | 0.13 | 0.13 | 1.74 |
F1 | 99.82 | 98.82 | 99.69 | 99.80 | 26 | 26 | 33.6 |
1-err | 99.99 | 99.99 | 99.99 | 99.99 | 0.45 | 0.13 | 96.44 |
The effectiveness of our model is denoted by bold numbers, which appear to indicate superior performance in several key aspects. Specifically, on the I-M dataset, our model outperforms others in recall, precision, F1 score, and 1-error evaluations. This underscores its comprehensive superiority in capturing various metrics of model performance on this dataset.
While on the CLAB dataset, SAGE and GAT models exhibit higher recall rates, there are concerns regarding their tendency to misclassify a substantial number of non-isomorphic network graphs as isomorphic. In contrast, our model has improved the accuracy and consistency on the CLAB dataset, showcasing a balanced and robust performance that minimizes misclassifications and ensures reliable identification of graph structures.
We conducted a comparison with models incorporating different pooling layers (pooling ratio of 0.1) on an isomorphic test dataset (EXPWL1) to demonstrate the simplicity and effectiveness of our model.
The detailed results presented in table 6 highlight the remarkable performance of the present model without the need for additional pooling operations. It not only boasts the shortest processing time but also attains the highest accuracy in testing graph isomorphism, achieving an impressive recognition rate of 95.3% across the entire dataset.
Table 6. Recognition rates (%) comparison for different pooling methods with increasing layers. Bold numbers are the best recognition rates.
Pooling | No-pool | Top-k [46] | ASAPool [34] | SAGPool [35] | Rand-Dense | Rand-Sparse |
---|---|---|---|---|---|---|
Test Acc | 95.3±1.3 | 50.1±8.3 | 72.5±4.1 | 52.8±12.5 | 85.7±3.3 | 62.3±2.3 |
Moreover, the incorporation of common pooling operations only marginally enhances performance on the isomorphism task. This suggests that additional pooling operations are not necessary for optimal performance in graph isomorphism tasks, underscoring the efficiency and effectiveness of the present model in accurately identifying graph structures without the need for cumbersome additional operations.
We further compared the accuracy of our partitioning algorithm with other model methods to verify that partitioning methods can increase the reliability of judgments.
The analysis conducted on the enhancement effect of the partition algorithm based on GraphSAGE, GAT, and GCN models on the I-M and L1 datasets reveals promising outcomes. By utilizing algorithm 1 to augment the model results, significant improvements in accuracy (see table 7) were observed across different models and datasets: (1) GCN's accuracy on the I-M dataset improved from 98.68% to 99.99%, while achieving 98% accuracy on the L1 dataset. (2) GraphSAGE exhibited an increase in accuracy from 12.22% to 17.86% on the I-M dataset. (3) GAT's accuracy on the I-M dataset saw an improvement from 12.22% to 12.77%. (4) GATv2 achieved a recognition rate of 33% on the L1 dataset with the enhancement from the partition algorithm.
Table 7. Accuracy (%) of combining partition algorithm with other model methods.
Model | GCN | GraphSAGE | GAT | GATv2 |
---|---|---|---|---|
I-M | 99.9(+1.3) | 17.8(+5.6) | 12.7(+0.5) | — |
L1 | 98 | 0 | 0 | 33 |
Note that although partitioning was applied to the L1 dataset, GraphSAGE and GAT did not show improvement initially due to limitations in analyzing isomorphism of larger network graphs. However, adjusting the threshold of the partitioning algorithm on the L1 dataset to 30 nodes led to GraphSAGE achieving a recognition rate of 39%.
These results highlight the effectiveness and rationality of algorithm 1 in tackling graph isomorphism challenges and enhancing the performance of neural network models in analyzing complex network structures. By leveraging the partition algorithm, improvements in accuracy were observed across different models and datasets, showcasing the potential of this approach in boosting the capabilities of graph analysis models.
5.4. Graph classification and node classification
We finally evaluated the model for two downstream tasks: graph classification and node classification in tables 8 and 9 respectively.
Table 8. Accuracy (%) evaluations in graph classification tasks. Bold numbers are the best accuracy.
Datasets | MUTAG | PROTEINS | PTC | NCI1 | IMDB-B | IMDB-M | RDT-B | RDT-M5K | COLLAB |
---|---|---|---|---|---|---|---|---|---|
WL_subtree [47] | 90.4 | 75.0 | 59.9 | 86.0 | 73.8 | 50.9 | 81.0 | 52.5 | 78.9 |
DCNN [48] | 67.0 | 61.3 | 56.6 | 62.6 | 49.1 | 33.5 | — | — | 52.1 |
DGCNN [42] | 85.8 | 75.5 | 58.6 | 74.4 | 70.0 | 47.8 | — | — | 73.7 |
AWL [49] | 87.9 | — | — | — | 74.5 | 51.5 | 87.9 | 54.7 | 73.9 |
GIN [10] | 84.5 | 72.2 | 55.6 | 79.1 | 71.2 | 48.8 | 92.4 | 55.1 | 80.2 |
GCN [36] | 85.6 | 76.0 | 64.2 | 80.2 | 74.0 | 51.9 | 50.0 | — | 79.0 |
GAT [37] | 84.4 | 70.0 | 56.2 | 74.9 | 68.8 | 47.6 | 84.3 | 50.0 | 73.9 |
GraphSAGE [18] | 85.1 | 75.9 | 63.9 | 77.7 | 72.3 | 50.9 | — | — | — |
LGNN | 90.0 | 76.2 | 85.7 | 82.0 | 74.1 | 52.2 | 90.0 | 55.1 | 80.6 |
Table 9. Accuracy (%) evaluation of graph neural network models in node classification tasks. Bold numbers are the best accuracy.
Cora | Citeseer | Pubmed | Arxiv | |
---|---|---|---|---|
XGraphBoost [50] | 60.5 ± 3.0 | 50.5 ± 3.4 | 61.9 ± 2.2 | 65.8 ± 1.9 |
BGNN [51] | 71.2 ± 5.0 | 69.1 ± 3.9 | 59.9 ± 0.1 | 67.0 ± 0.1 |
GAT [37] | 83.0 ± 0.6 | 70.0 ± 1.5 | 79.1 ± 0.7 | 73.6 ± 0.1 |
GCN [36] | 81.0 ± 0.8 | 72.1 ± 0.3 | 79.0 ± 0.8 | 71.7 ± 0.2 |
GraphSAGE [18] | 81.4 ± 0.7 | 73.4 ± 0.8 | 78.4 ± 0.4 | 71.7 ± 0.2 |
GIN [10] | 80.0 ± 1.2 | 75.1 ± 1.9 | 75.3 ± 0.9 | 73.8 ± 1.4 |
LGNN | 82.9 ± 1.5 | 76.1 ± 2.0 | 77.6 ± 0.6 | 74.3 ± 0.8 |
The baseline for graph classification in table 8 includes the following three different classes: (1) WL subtree kernel [47], where C-SVM [53] is used as the classifier; (2) Deep learning architecture including diffusion convolutional neural network (DCNN) [48], patch san [54], and deep graph CNN (DGCNN) [42]; (3) Anonymous Walk Embedding (AWL) [49]. The present model performs similarly to classical network models and their variants in graph classification tasks, especially with impressive accuracy on the PTC dataset (see figure 6). Our model's accuracy on the PTC dataset is over 20% higher than the benchmark, 25% higher than GIN, 20% higher than GCNs, and 25% higher than GATs.
Figure 6. Visualization of two representative graphs and classify accuracy on the PTC dataset. PTC is a collection of 344 chemical compounds represented as graphs, which report the carcinogenicity for rats. There are 19 node labels for each node. The inspiration for visual examples comes from PTC source [52].
Download figure:
Standard image High-resolution imageIn the node classification task, we use three citation graph tasks, i.e. Cora, Citeseer and Pubmed from Planetoid [55] and Arixv [56]. We compared the present model in table 9 with other popular GNNs and graph kernels, including Graph Convolutional Network (GCN) [36], GraphHomomorphic Network (GIN) [10], Graph Attention Network (GAT) [37], GraphSAGE [18]. We also compared two methods that combine GNN and dt: BGNN [51] and XGraphBoost [50]. Our model performs similarly to the optimal model in the node classification task mentioned above.
6. Conclusions
The problem of graph isomorphism has emerged in many important applications of scientific learning. We proposed a lightweight graph network model to resolve this problem for super large graphs. The simulations have demonstrated high identification performance with reasonable time complexity. While the existed network methods cannot provide a proof-refined supremacy beyond any classical algorithms to resolve the GI problem, further computational improvements may be realized by exploiting the deep learning in specific applications. Various potential applications should be interesting. One is to complete community detection and impact analysis in order to reveal hidden relationships and patterns in social networks. Another is to accelerate the discovery of new drug variants and specific structural materials.
Acknowledgment
This work was supported by the National Natural Science Foundation of China (Nos. 62172341 and 12204386), Sichuan Natural Science Foundation (Nos. 2023NSFSC0447, 2024NSFSC1375 and 2024NSFSC1365), and Interdisciplinary Research of Southwest Jiaotong University China (No. 2682022KJ004).
Data availability statement
No new data were created or analyzed in this study.