Skip to content

Menu

WorksComputer Science

Structure Meets Attributes: A Sparse Graph Kernel Built from Neighborhood Pairs and Paths

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_qwesyux8. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

Graph learning methods often require extensive tuning, while incorporating continuous node attributes into graph kernels can be computationally expensive. To tackle these issues we introduce the Neighborhood Subgraph Pairwise Path Kernel (NSPPK), which maps graphs with continuous node attributes into high-dimensional sparse feature vectors. NSPPK encodes graph structure through hashed pairs of rooted subgraphs augmented with shortest-path connectors, and incorporates continuous attributes through structure-dependent aggregation. This avoids attribute discretization and allows graph similarities to be computed as inner products between explicit feature vectors. Graph vectorization is deterministic, requires no training, and can be performed independently across graphs in parallel. With fixed structural parameters and bounded local adjacency sizes, its computational complexity is linear in the number of nodes. We examine the kernel's discriminative properties and sensitivity to structural and attribute perturbations. Across six graph classification benchmarks, NSPPK achieves the best average accuracy rank among the evaluated graph kernels, without dataset-specific structural parameter tuning. Used as a vectorization method with XGBoost, it achieves higher mean classification accuracy than the evaluated neural baselines on five of the six datasets. Further experiments on QM9 and MolPCBA assess vectorization efficiency and applicability to larger molecular datasets. These results show that explicit sparse graph kernels can provide an effective alternative to learned graph embeddings for attributed graph classification.

Introduction

Graphs are a fundamental data structure for modeling relationships among entities, with applications in social network analysis [32], protein function prediction [3], molecular activity prediction [23], and recommender systems [56]. Nodes can carry categorical labels, such as atom types, and continuous attributes, such as spatial coordinates. A central challenge in graph learning is to represent both graph structure and node attributes in a form suitable for prediction and comparison.

Two widely used approaches to graph learning are graph kernels and graph neural networks (GNNs). Graph kernels measure similarity between graphs, typically by decomposing them into substructures and comparing their occurrences [1]. For example, the Weisfeiler–Lehman subtree kernel constructs graph representations by counting refined discrete node labels [38]. In contrast, GNNs learn node representations by iteratively aggregating and transforming information from neighboring nodes, which can then be pooled to obtain graph-level representations [51]. Both approaches are widely used in graph learning, but they differ in how graph representations are constructed and used.

For graph kernels, incorporating continuous node attributes alongside structural information presents an additional challenge. Several methods have been proposed to address this problem. Hash graph kernels adapt discrete-label kernels to continuous attributes by repeatedly mapping attribute values to discrete labels [27]. GraphHopper compares node attributes at corresponding positions along shortest paths [12]. Propagation kernels diffuse and quantize node attributes [31]. Wasserstein Weisfeiler–Lehman compares distributions of node representations by solving a transport problem for each graph pair [43]. These methods provide different ways of combining structural and attribute information, but their feature construction and comparison procedures can introduce additional computational costs.

Our goal is to construct a sparse, explicit feature representation that integrates graph structure and continuous node attributes, can be computed once per graph, and reused for graph similarity comparisons and downstream learning tasks.

We introduce the Neighborhood Subgraph Pairwise Path Kernel (NSPPK) for graphs with continuous node attributes. It builds on the Neighborhood Subgraph Pairwise Distance Kernel (NSPDK) [9], which counts pairs of rooted neighborhoods (subgraphs centered at individual nodes) using discrete labels and the shortest-path distance between their roots, called anchors. Matching neighborhoods and equal anchor distances can still leave differences in the structure of the connecting paths. NSPPK incorporates the union of all shortest paths between the anchors, with optional expansion to nearby vertices, as part of the structural pattern. It hashes this pattern and efficiently integrates the anchors’ real-valued attribute vectors in the corresponding feature bucket (Figure 1).

NSPPK construction for a node-attributed molecular graph

Figure 1. NSPPK hashes the rooted neighborhoods of an unordered anchor pair {u,v}\{u,v\}, its connector, and its distance d(u,v)d(u,v) to a bucket in a 2b2^b-dimensional vector. The three connector examples on the left show, from top to bottom, the omitted connector, the union of shortest paths, and the subgraph induced within one hop of that union. § 3.1 defines the connector notation. Each occurrence increments the chosen bucket in both anchor rows of the sparse matrix MGM_G (labeled FF in the illustration). For node attributes AA, the resulting graph vector is ϕθ(G,A)=vec⁡(ATMG)\phi_\theta(G,A)=\operatorname{vec}(A^\mathsf{T}M_G).

NSPPK maps each graph to a sparse feature vector, so graph similarity is computed as a dot product. Exact substructure matching can yield low similarity between distinct graphs [53]: as neighborhoods grow, more of their structure must match exactly, and high-degree nodes can make even small-radius neighborhoods large. NSPPK decomposes graph structure into hashed features over pairs of rooted neighborhoods at multiple radii, augmented with connectors formed from the unions of shortest paths between their anchor nodes. This creates overlapping, path-based local patterns, allowing similarities to accumulate from shared structure without requiring an entire large neighborhood to match. Under fixed limits on neighborhood radius, anchor-pair distance, and connector expansion, feature extraction scales linearly in the number of nodes when local adjacency sizes are uniformly bounded (§ 3.6). We examine how NSPPK similarities respond to structural and attribute perturbations (§ 5).

Empirical evaluation. We study graph similarity under perturbations, the runtime of feature extraction, and the usefulness of the representation for graph classification. With the same structural configuration across the classification benchmarks, NSPPK attains the best average rank among the evaluated graph kernels. With XGBoost, its sparse features also rank first on average in the comparison with graph neural network (GNN) baselines.

Related Work

Many graph kernels are formulated within the R-convolution framework [15], which decomposes structured objects into parts and aggregates kernel evaluations over those parts. Examples include kernels for parse trees [6], string and tree matching [46], and subpaths in unordered trees [19]. Cortes et al. (2004) show that Haussler’s convolution kernels for strings are special cases of rational kernels based on weighted finite-state transducers. In graphs, the choice of substructures determines both what the kernel can distinguish and the cost of comparing graphs. Representative examples count graphlets [37] or record discrete node labels refined by 1-WL [38].

NSPDK [9] counts occurrences of pairs of rooted neighborhoods, using the neighborhood radius and the shortest-path distance between the anchors to index the counts. The original experiments computed a Gram matrix of pairwise graph similarities. Later implementations store the counts in a sparse feature vector for each graph [30]. The original formulation uses discrete node and edge labels, so continuous node attributes must first be encoded as discrete labels. At a fixed radius, two anchor pairs with matching neighborhoods and equal distances contribute to the same feature even if one pair has more shortest paths than the other. NSPPK adds the union of those paths to the paired neighborhoods and sums the anchors’ real-valued attributes in each structural bucket.

Orsini et al. (2015) discuss NSPDK within their graph invariant kernel framework. Their attributed neighborhood kernel uses structural similarity between individual rooted neighborhoods to weight node attribute comparisons across graphs. Kriege et al. (2019) derive approximate explicit feature maps for GraphHopper and a graph invariant kernel with real-valued attributes. These maps allow graph similarities to be computed as dot products after feature extraction.

Random walk kernels compare label sequences along walks, and marginalized kernels average over possible walks [17, 13, 47]. These computations can be costly, and immediate edge reversals can yield redundant walks, a problem known as tottering [26]. Subgraph matching kernels compare attributes across compatible subgraph correspondences. Computing the kernel involves enumerating cliques in a product graph, so the cost grows with the number of admissible matches [23]. Propagation kernels diffuse node attributes and quantize the propagated values to build count features [31]. The learning-free #WLS method uses SimHash to sketch continuous node attributes and pools the sketches over successive neighborhoods to embed each graph [49]. The shortest-path kernel compares path lengths and endpoint information [2]. GraphHopper uses counts of occurrences at corresponding positions on equal-length shortest paths to weight cross-graph node attribute comparisons. Computing the kernel can therefore involve comparing attributes for all pairs of nodes across the two graphs [12]. Wasserstein WL compares distributions of node representations, and fused Gromov–Wasserstein incorporates both attributes and graph structure in the transport objective. Both solve a transport problem for each graph pair [43, 44]. Deep Graph Kernels learn latent representations of substructures [52]. Graph Neural Tangent Kernels derive a kernel from the infinite-width limit of a chosen GNN architecture [10].

Several recent kernels compare distributions of node or substructure representations. MMD-GK compares distributions of propagated node representations using maximum mean discrepancy. Direct evaluation of the discrepancy for a graph pair has a term quadratic in the node count, separate from feature propagation [40 {xref}]Theorem 3). Sliced Wasserstein Weisfeiler–Lehman (SWWL) represents each graph by quantiles of random projections of its propagated node features. The numbers of projections and quantiles determine the size of the feature vector and the resolution of the approximation [4]. The Distributional Shortest-Path (DSP) kernel learns node representations from shortest paths with a neural language model. It constructs an explicit graph vector by averaging partition-kernel features of the learned node representations using partitions formed across the dataset [55 {xref}]Section IV-B).

In NSPPK, the two rooted neighborhoods, their anchor distance, and the shortest-path connector jointly determine a structural bucket. Each bucket stores the sum of the real-valued attributes of its anchors, computed independently for each graph. The resulting sparse vectors can be compared by a dot product in time linear in their combined number of nonzero entries for sorted sparse indices (§ 3.6). Different sets of node attributes with the same sum contribute the same bucket values.

Method

An R-convolution kernel decomposes a structured object and sums kernel evaluations over its parts [15]. NSPDK decomposes a graph into pairs of equal-radius rooted neighborhoods whose anchors are at a prescribed shortest-path distance [9]. NSPPK can augment each pair with a connector. All shortest paths between the anchors contribute their vertices and edges to a single subgraph, which can be expanded to include nearby vertices. After hashing the structural pattern, NSPPK adds the real-valued attribute vectors of the two anchors to the corresponding feature bucket.

Core Objects and Notation

We assume standard graph-theoretic notation; for completeness, basic definitions (graph, degree, shortest-path distance, rr-hop neighborhoods) are collected in Appendix § 10. Here we introduce only the concepts that are specific to NSPPK. We write RR for the maximum anchor-neighborhood radius, DD for the maximum anchor-pair distance, and R′R' for the maximum connector radius, with R,R′∈N0R,R' \in\mathbb{N}_0 and D≥1D \ge1. We write Kmax⁡=max⁡v∈Vdeg⁡(v)K_{\max} = \max_{v \in V} \deg(v) for the maximum degree and τ\tau for an optional degree cutoff. We refer to (R,D,R′)(R,D,R') as the core structural hyperparameters of NSPPK; the hash width bb and degree cutoff τ\tau are implementation controls for the collision–memory and feature-size trade-offs.

Anchor pairs. We consider (unordered) anchor pairs {u,v}⊆V\{u,v\} \subseteq V with u≠vu \ne v and finite shortest-path distance d(u,v)≤Dd(u,v) \le D; disconnected pairs are ignored.

Union of shortest paths. Let U(u,v)U(u,v) contain exactly the vertices and edges that lie on at least one shortest path between uu and vv.

Connector (thickened path union). For a vertex set S⊆VS \subseteq V, let Nr′(S)N_{r'}(S) denote the induced subgraph on all vertices within shortest-path distance at most r′r' from SS, i.e., Nr′(S)=G[{x∈V:min⁡s∈Sd(x,s)≤r′}]N_{r'}(S) = G[\{x \in V : \min_{s \in S} d(x,s) \le r'\}].

Write C0(u,v)=U(u,v)C_0(u,v)=U(u,v). For r′>0r'>0, set Cr′(u,v)=Nr′(V(U(u,v)))C_{r'}(u,v)=N_{r'}(V(U(u,v))), the subgraph induced by vertices within r′r' hops of the path union.

NSPPK feature primitives. An NSPPK feature is defined by a pair of anchor neighborhoods (Nru(u),Nrv(v))(N_{r_u}(u),N_{r_v}(v)) whose centers are at shortest-path distance d(u,v)d(u,v), optionally augmented with a connector subgraph Cr′(u,v)C_{r'}(u,v). Features are parameterized by the tuple (ru,rv,d,r′)(r_u,r_v,d,r') and are invariant to permutations of vertices within each subgraph.

Augmented structural features

For each anchor pair, NSPPK enumerates endpoint radii ru,rv∈{0,…,R}r_u,r_v \in\{0,\ldots,R\} and connector radii r′∈{0,…,R′}∪{∅}r' \in\{0,\ldots,R'\}\cup\{\varnothing\}. The configuration includes the observed distance d=d(u,v)∈{1,…,D}d=d(u,v)\in\{1,\ldots,D\}. The sentinel r′=∅r'=\varnothing gives an endpoint-only feature.

From subgraphs to explicit features

NSPPK constructs an explicit feature representation for each graph independently by enumerating structural patterns associated with pairs of nodes. Each pattern comprises their rooted neighborhoods at specified radii, their shortest-path distance, and an optional shortest-path connector.

Each pattern is mapped to a deterministic feature bucket using permutation-invariant hashing. Let bb denote the hash width and B=2bB=2^b the number of available feature buckets. Since the hash space is finite, distinct patterns may collide; we distinguish these practical bucket indices from the idealized collision-free identifiers used in the analysis.

Let θ=(R,D,R′)\theta=(R,D,R') denote the structural parameters, with bb and the optional degree cutoff τ\tau treated as fixed implementation settings.

For a graph G=(V,E)G=(V,E) without continuous node attributes, the feature map ϕθ(G)∈N0B\phi_\theta(G)\in\mathbb{N}_0^B records the number of structural pattern occurrences in each bucket, counting each occurrence once per unordered node pair and structural configuration. The corresponding kernel is

κθ(G,G′)=ϕθ(G)⊤ϕθ(G′).\kappa_\theta(G,G')=\phi_\theta(G)^\top\phi_\theta(G').

For a node-attributed graph, let a:V→Rpa:V\to\mathbb{R}^p be the node attribute function and A∈R∣V∣×pA\in\mathbb{R}^{|V|\times p} its matrix representation, with row Av,:=a(v)⊤A_{v,:}=a(v)^\top. Rather than counting structural pattern occurrences, each feature bucket aggregates the attribute vectors of the two nodes associated with each occurrence. This defines the attributed feature map ϕθ(G,A)∈RpB\phi_\theta(G,A)\in\mathbb{R}^{pB}, detailed in Section 3.5.

For two attributed graphs (G,A)(G,A) and (G′,A′)(G',A') with the same attribute dimension and feature-extraction settings, the kernel is

κθ((G,A),(G′,A′))=ϕθ(G,A)⊤ϕθ(G′,A′).\kappa_\theta((G,A),(G',A'))=\phi_\theta(G,A)^\top\phi_\theta(G',A').

Both kernels are positive semidefinite by construction, as they are inner products between explicit feature vectors.

Feature Hashing Pipeline

NSPPK maps each subgraph pattern to a deterministic integer bucket in {0,…,2b−1}\{0,\ldots,2^b-1\} using permutation-invariant hash functions, where bb is the number of hash bits and B=2bB=2^b is the number of hash buckets. This mapping is not injective for finite bb. Hashes are computed incrementally with respect to neighborhood radius and graph distance, and are cached per node. As a result, all rooted neighborhood hashes are computed once and reused when forming neighborhood pairs and connector features, avoiding quadratic recomputation over node pairs of the neighborhood hashes. The conditions under which total feature extraction is near-linear are stated in Section 3.6.

The resulting bucket index provides constant-time indexing into the feature vector and avoids explicit subgraph isomorphism checks.

Base hash functions. For any element xx, hb(x)=sha256⁡(x) mod 2bh_b(x) = \operatorname{sha256}(x) \bmod2^b is the bb-bit base hash. From hbh_b we define: hseq(I)h_{\mathrm{seq}}(I): sequence hash of an ordered tuple; I=(x1,…,xs)I = (x_1,\ldots,x_s); hmulti(S)h_{\mathrm{multi}}(S): multiset hash of SS, computed after lexicographic sorting to ensure order invariance. Both compound hash functions return indices in {0,…,2b−1}\{0,\ldots,2^b-1\}. Collections passed to hmultih_{\mathrm{multi}} retain repeated items.

Node hash. For each node vv (labels and neighborhoods as in Section A), we define

η(v)=hseq([hb(ℓ(v)),hmulti({hseq([hb(ℓ(u)),hb(ℓ({v,u}))]):u∈N(v)})]).\eta(v) = h_{\mathrm{seq}}\left([h_b(\ell(v)),h_{\mathrm{multi}}(\{h_{\mathrm{seq}}([h_b(\ell(u)),h_b(\ell(\{v,u\}))]):u\in N(v)\})]\right).

Rooted graph hash. For radius rr, set σjv=hmulti({η(u):u∈Sj(v)})\sigma_j^v = h_{\mathrm{multi}}(\{\eta(u):u\in S_j(v)\}) with Sj(v)={u∣d(v,u)=j}S_j(v)=\{u\mid d(v,u)=j\} and ζr(v)=hseq([σ0v,σ1v,…,σrv])\zeta_r(v)=h_{\mathrm{seq}}([\sigma_0^v,\sigma_1^v,\ldots,\sigma_r^v]). These hashes are computed incrementally in rr and cached for each node.

Endpoint-pair code. Given cached rooted hashes, define the endpoint descriptor Er(x)=hseq([hb(r),ζr(x)])E_r(x)=h_{\mathrm{seq}}([h_b(r),\zeta_r(x)]). For nodes u,vu,v at distance dd, the unordered endpoint-pair code is

Ppairru,rv(u,v)=hmulti({Eru(u),Erv(v)}).P_{\mathrm{pair}}^{r_u,r_v}(u,v)=h_{\mathrm{multi}}(\{E_{r_u}(u),E_{r_v}(v)\}).

Including the radius in each endpoint descriptor makes this code invariant to exchanging (u,ru)(u,r_u) and (v,rv)(v,r_v), including when ru≠rvr_u\ne r_v.

Connector code. For r′≥0r'\ge0, let C=Cr′(u,v)C=C_{r'}(u,v) and H=max⁡(R,R′)H=\max(R,R'). For an anchor x∈{u,v}x\in\{u,v\}, form the shell signature

Sx(C)=hseq([hmulti({ζH(w):w∈V(C),dC(x,w)=j})]j=0d+r′),S_x(C)=h_{\mathrm{seq}}\left(\left[h_{\mathrm{multi}}\left(\{\zeta_H(w):w\in V(C),d_C(x,w)=j\}\right)\right]_{j=0}^{d+r'}\right),

where dCd_C is shortest-path distance within the connector. Thus the multisets are explicitly restricted to vertices of the thickened connector, rather than all vertices in GG at distance jj from an anchor. The connector code is

Qr′(u,v)=hseq([hb(r′),hmulti({Su(C),Sv(C)})]).Q_{r'}(u,v)=h_{\mathrm{seq}}([h_b(r'),h_{\mathrm{multi}}(\{S_u(C),S_v(C)\})]).

The multiset over the two anchor views makes the code invariant to exchanging uu and vv, while hb(r′)h_b(r') records the thickening radius. We use a reserved sentinel Q∅Q_{\varnothing} when the connector is omitted.

Joint feature and final vector. The bucket associated with one NSPPK configuration is the combined hash

Fru,rv,d,r′(u,v)=hseq([hb(d),Ppairru,rv(u,v),{Qr′(u,v),r′≥0,Q∅,r′=∅]).F_{r_u,r_v,d,r'}(u,v)=h_{\mathrm{seq}}\left([h_b(d),P_{\mathrm{pair}}^{r_u,r_v}(u,v),\begin{cases}Q_{r'}(u,v),&r'\ge0,\\Q_{\varnothing},&r'=\varnothing\end{cases}]\right).

The NSPPK vector ϕθ(G)\phi_\theta(G) is the histogram of these joint bucket values over all unordered anchor pairs and all enumerated (ru,rv,d,r′)(r_u,r_v,d,r') configurations. Pair and connector codes are therefore components of one feature, not independent histogram entries.

Node attribute integration

Because NSPPK features are extracted locally around anchor pairs, each node is incident to a well-defined subset of feature occurrences: those for which it is one of the two anchors. Continuous node attributes are integrated using this endpoint incidence; internal vertices of an endpoint neighborhood or connector do not contribute their attributes to that occurrence. Formally, for a graph with continuous node attributes A∈R∣V∣×pA\in\mathbb{R}^{|V|\times p}, let MG∈N0∣V∣×BM_G\in\mathbb{N}_0^{|V|\times B} denote the node-feature count matrix, where B=2bB=2^b. Its entries are defined operationally by

(MG)xj=∑{u,v},ru,rv,d,r′Fru,rv,d,r′(u,v)=j1{x∈{u,v}}.(M_G)_{xj}=\sum_{\substack{\{u,v\},r_u,r_v,d,r'\\F_{r_u,r_v,d,r'}(u,v)=j}}\mathbf{1}\{x\in\{u,v\}\}.

Thus an occurrence increments the row of each of its two distinct anchors, including repeated occurrences in the same bucket. We define the attributed NSPPK feature vector as

ϕθ(G,A)=vec⁡(ATMG)∈RpB.\phi_\theta(G,A)=\operatorname{vec}(A^{\mathsf T}M_G)\in\mathbb{R}^{pB}.

When attributes are not used, we write ϕθ(G)∈N0B\phi_\theta(G)\in\mathbb{N}_0^B for the corresponding structural feature histogram. Thus each feature index in the attributed vector stores the sum of attribute vectors of anchor endpoints of occurrences mapped to that bucket. Node weights can be incorporated by replacing AA with diag⁡(w)A\operatorname{diag}(w)A, and an analogous edge-feature incidence matrix would be needed for edge attributes.

The resulting attributed kernel is positive semidefinite because it is the ordinary inner product between explicit finite-dimensional vectors ϕθ(G,A)\phi_{\theta}(G,A). It is not invariant to arbitrary rescaling of the raw attributes: as with any linear kernel on continuous inputs, attribute dimensions with larger numerical scale can receive larger weight. In practice, attributes should therefore be standardized or otherwise normalized when their units are not directly comparable. The experiments below evaluate node attributes; edge attributes can be included by applying the same aggregation principle to edge-feature incidence matrices, but they are not the focus of the reported benchmarks.

We emphasize that NSPPK feature extraction is entirely deterministic and training-free; supervised learning is only performed by the downstream classifier.

Complexity Analysis

Let Bℓ(v)B_{\ell}(v) be the ℓ\ell-hop ball of vv and Eℓ(v)\mathcal{E}_{\ell}(v) the edges incident to that ball. With H=max⁡(R,R′)H=\max(R,R'), the truncated traversals for the rooted hashes and anchor enumeration cost

O(∑v∈V(∣BH(v)∣+∣EH(v)∣)+∑v∈V(∣BD(v)∣+∣ED(v)∣)).O\left(\sum_{v\in V}\left(\lvert B_H(v)\rvert+\lvert\mathcal{E}_H(v)\rvert\right)+\sum_{v\in V}\left(\lvert B_D(v)\rvert+\lvert\mathcal{E}_D(v)\rvert\right)\right).

Feature extraction also pays for sorting hash multisets, enumerating radius combinations, and constructing and hashing the connectors. Appendix § 11 accounts for these costs, including implementations that list all shortest paths. With fixed radii and uniformly bounded local adjacency sizes, each node and each eligible anchor pair contributes bounded structural work, so feature extraction scales linearly in ∣V∣\lvert V\rvert under those assumptions.

Sparse aggregation of pp attribute channels takes O(p nnz⁡(MG))O(p\,\operatorname{nnz}(M_G)) operations, plus any dense-output initialization. For two vectors xx and yy stored with sorted nonzero indices, the kernel dot product takes O(nnz⁡(x)+nnz⁡(y))O(\operatorname{nnz}(x)+\operatorname{nnz}(y)) time. This applies to the attributed kernel with x=ϕθ(G,A)x=\phi_{\theta}(G,A) and y=ϕθ(G′,A′)y=\phi_{\theta}(G',A').

Balancing Feature Size and Hash Collisions

The encoding allocates 2b2^b feature coordinates at hash width bb. We measured test ROC–AUC for a random forest trained on 1,300 molecular graphs from PubChem AID 463230, a plasma platelet-activating factor acetylhydrolase inhibition assay (The Scripps Research Institute Molecular Screening Center, n.d.). The experiment omits continuous node attributes. Figure 2(a) shows ROC–AUC rising from about 0.60 at 2 bits to 0.81 at 14 bits and remaining at about 0.81 through 20 bits. The plotted collision probability is about 0.10 at 14 bits. On the preprocessed QM9 collection, vectorization time rose from 312 seconds at 11 bits to 2,285 seconds at 12 bits in the reported environment (Appendix § 14).

Hash-width sensitivity plots showing ROC–AUC and collision probability versus number of bits, and NSPPK vectorization time versus number of bits on the QM9 dataset

Figure 2. (a) Test ROC–AUC and collision probability by hash width. (b) NSPPK vectorization time on QM9 vs. number of hash bits. Figure 2: Hash-width sensitivity on two molecular graph collections. The left panel reports the PubChem classification experiment. The right panel reports QM9 vectorization time.

Isomorphism Invariance and Structural Discrimination

A fundamental property of graph kernels is invariance under graph isomorphism. Two graphs G=(VG,EG)G = (V_G, E_G) and G′=(VG′,EG′)G' = (V_{G'}, E_{G'}) are isomorphic, denoted G≅G′G \cong G', if there exists a bijection f:VG→VG′f: V_G \to V_{G'} that preserves adjacency and, for labeled graphs, node and edge labels.

An isomorphism-invariant feature map satisfies

G≅G′⟹ϕθ(G)=ϕθ(G′).G \cong G' \quad\Longrightarrow\quad\phi_\theta(G) = \phi_\theta(G').

The converse does not generally hold: non-isomorphic graphs may be mapped to identical feature vectors. The discriminative power of a graph representation therefore depends on the structural differences it can distinguish.

NSPPK is isomorphism-invariant by construction. Rooted neighborhood descriptors, shortest-path distances, and connector signatures are preserved under graph isomorphism. Their permutation-invariant hashing and aggregation ensure that the resulting feature vector is independent of vertex ordering.

We examine the structural discrimination of NSPPK relative to the one-dimensional Weisfeiler–Lehman (1-WL) test and bounded-radius NSPDK. In the following examples, node and edge labels are constant, continuous node attributes are omitted, and structural feature identifiers are treated as collision-free.

Comparison with message passing. The discriminative power of many graph kernels and graph neural networks is related to the 1-WL test ([38, 28]). In particular, standard message-passing GNNs are at most as discriminative as 1-WL ([51]), while the WL subtree kernel constructs graph representations from the colors generated during its iterative refinement.

Figure 3(a) illustrates two non-isomorphic graphs that are indistinguishable by 1-WL: a six-cycle C6C_6 and two disjoint triangles K3⊔K3K_3 \sqcup K_3. Both graphs contain six vertices of degree two, resulting in identical color histograms at every refinement iteration.

Structural discrimination by NSPPK and 1-WL

Figure 3. Structural discrimination by NSPPK and 1-WL. (a) A six-cycle C6C_6 and two disjoint triangles K3⊔K3K_3 \sqcup K_3, distinguished by NSPPK for D≥2D \ge2 but not by 1-WL. (b) A bow-tie graph and a 2×32 \times3 ladder, distinguished by both methods. Colors are used solely to differentiate the drawings; node and edge labels are constant in the comparisons.

NSPPK distinguishes these graphs for D≥2D \ge2, since pairs of nodes at shortest-path distance two occur in the six-cycle but not in the two disjoint triangles. This distinction follows from the inclusion of pairwise distances in the structural representation and does not require connector features.

Figure 3(b) illustrates a case in which both 1-WL and NSPPK distinguish the graphs. The bow-tie graph and the ladder have different degree distributions and different numbers of node pairs at distance one.

Comparison with bounded-radius NSPDK. Although shortest-path distances provide information about the separation between nodes, they do not characterize the structure of the paths connecting them. Consequently, node pairs with identical rooted neighborhoods and equal distances may contribute identical NSPDK features despite differences in their connecting subgraphs.

NSPPK extends this representation by incorporating shortest-path connectors into the structural feature encoding. We illustrate the additional discriminative capacity of these connectors through a pair of graphs that cannot be distinguished by bounded-radius NSPDK.

Let ϕR,DNSPDK\phi_{R,D}^{\mathrm{NSPDK}} denote the NSPDK feature map with maximum neighborhood radius RR and maximum pairwise distance DD [9].

Consider the two graphs in Figure 4. Graph GG is a pentagonal prism, while G′G' is obtained from K5,5K_{5,5} by deleting a four-cycle and a vertex-disjoint six-cycle. Both graphs are 3-regular and triangle-free, with ten vertices and fifteen edges. They therefore have identical rooted neighborhood types at radii zero and one. Furthermore, each graph contains fifteen unordered node pairs at distance one and twenty at distance two.

Figure 4. Connector-based discrimination beyond bounded-radius NSPDK. (a) Pentagonal prism GG. (b) Graph G′G' obtained by deleting disjoint four- and six-cycles from K5,5K_{5,5}. Both graphs have identical NSPDK representations for R=1R = 1 and D=2D = 2. Filled vertices indicate selected node pairs at distance two, and blue edges indicate their shortest-path unions C0(u,v)C_0(u,v), containing two shortest paths in (a) and three in (b).

For R=1R = 1 and D=2D = 2, these properties result in identical bounded-radius NSPDK representations.

Despite their identical bounded-radius NSPDK representations, the two graphs differ in the organization of their shortest paths. In GG, any pair of nodes at distance two has at most two common neighbors. In G′G', the two vertices in each bipartition that belonged to the deleted four-cycle share three common neighbors.

With R′=0R' = 0, NSPPK includes the union of all shortest paths between each eligible pair of nodes. For the selected pairs in Figure 4, the first distance shell within the connector contains two vertices in GG and three in G′G'.

The connector signature defined in § 3.4 preserves this multiplicity through its multiset construction. Consequently, at ru=rv=1r_u = r_v = 1, a joint structural feature occurs in G′G' that does not occur in GG.

Under collision-free structural encoding, the two feature maps therefore satisfy

ϕ1,2NSPDK(G)=ϕ1,2NSPDK(G′),ϕ(1,2,0)(G)≠ϕ(1,2,0)(G′).\phi_{1,2}^{\mathrm{NSPDK}}(G) = \phi_{1,2}^{\mathrm{NSPDK}}(G'), \qquad\phi_{(1,2,0)}(G) \ne\phi_{(1,2,0)}(G').

This example establishes that shortest-path connectors can increase structural discrimination beyond bounded-radius NSPDK. Whereas pairwise distances describe the separation between nodes, connector signatures encode additional information about the structure connecting them. The result demonstrates additional discriminative capacity for the specified structural parameters, rather than completeness as a graph isomorphism test or general dominance over other graph representation methods.

Diagonal Dominance and Robustness Analysis

A normalized Gram matrix is nearly diagonal when off-diagonal similarities are near zero. Exact matching can give low feature overlap; Yanardag & Vishwanathan [52] discuss this issue for graph substructure features.

We start from a prototype graph with 200 nodes and generate a sequence of 50 perturbations in each of four regimes: node deletion, edge removal, Gaussian noise on five-dimensional node attributes, and a combination of the three. The structural perturbations preserve connectivity. We compare NSPPK with a randomly initialized GIN architecture [51], GraphCL [57], InfoGraph [39], GraphHopper [12], and the Propagation Kernel [31]. Appendix § 13.§ 2 lists the configurations.

To separate feature-vector direction from changes in feature-vector norm, all similarities in this analysis use the normalized Gram matrix

K^ij=KijKiiKjj\widehat{K}_{ij} = \frac{K_{ij}}{\sqrt{K_{ii}K_{jj}}}

with zero similarity assigned if either diagonal term is zero. Raw feature norms are not used as a robustness score.

Figure 5(a) shows similarities to the first, middle, and last graphs in each sequence. The first-instance NSPPK curve generally declines across the four regimes. Under Gaussian noise, the GraphHopper and Propagation Kernel similarities to the first instance fall much more sharply.

Figure 5. Unified robustness analysis of graph similarity methods under perturbations. (a) Similarity to the first, middle, and last graphs in each perturbation sequence. (b) Normalized pairwise similarity matrices, showing off-diagonal coupling and smoothness patterns. (c) Correlation between kernel similarity and spectral similarity (Spearman ρ\rho). (d) Entropy of the normalized singular-value distribution.

Figure 5(b) shows the normalized pairwise similarities among the perturbed graphs. Under Gaussian noise, GraphHopper and the attribute Propagation Kernel retain high similarity to each graph itself but assign little similarity to other graphs. Their matrices therefore have bright diagonals and faint off-diagonal entries, indicating weak similarity across distinct instances. The neural methods retain stronger similarities between different graphs, producing smoother matrices in these experiments.

Figure 5(c) reports Spearman correlations with Laplacian spectral similarity for node deletion, edge removal, and combined perturbations. NSPPK obtains ρ=0.96\rho= 0.96, 0.940.94, and 0.960.96, respectively. For the combined regime the Propagation Kernel obtains 0.240.24 and GraphHopper obtains 0.970.97.

Finally, we report the entropy of the singular-value distribution of K^\hat{K}. If sis_i are its singular values and pi=si/∑jsjp_i = s_i/\sum_j s_j, then Ξsvd=−∑i:pi>0pilog⁡pi\Xi_{\mathrm{svd}} = -\sum_{i:p_i>0} p_i \log p_i and exp⁡(Ξsvd)\exp(\Xi_{\mathrm{svd}}) is the corresponding effective rank (Figure 5(d)). For a nonzero N×NN \times N matrix, 0≤Ξsvd≤log⁡N0 \le\Xi_{\mathrm{svd}} \le\log N. Entropy is zero for a rank-one matrix and log⁡N\log N for the identity. Under Gaussian noise, the Propagation Kernel has high entropy (3.913.91) and a nearly diagonal heatmap. In this case, a flat spectrum accompanies near-zero similarities between distinct graphs.

Across the tested sequences, NSPPK generally assigned higher similarity to graphs closer together in a sequence. Under Gaussian attribute noise, it retained substantial similarity between distinct graphs. Under combined perturbations, its ordering of graph pairs by similarity closely followed the ordering given by Laplacian spectral similarity.

Experiments

Small-Scale Datasets

We evaluate six node-attributed graph classification benchmarks from TUDataset [29]. ENZYMES and PROTEINS_full are protein datasets [3]. BZR, COX2, and DHFR are molecular activity datasets [41], and SYNTHETICnew is a synthetic benchmark used by Morris et al. [27].

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAvg Rank
SMTIMEOUTTIMEOUT83.96±3.8583.96 \pm3.8578.81±4.4978.81 \pm4.49TIMEOUTTIMEOUT15.50
SPTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUT18.67
ML50.33±9.0050.33 \pm9.0078.57±4.2178.57 \pm4.2182.96±5.2482.96 \pm5.2477.53±5.5377.53 \pm5.5336.33±4.3336.33 \pm4.3372.06±3.6072.06 \pm3.6011.75
PK54.33±10.1154.33 \pm10.1160.98±0.4860.98 \pm0.4878.77±1.0178.77 \pm1.0178.16±8.0778.16 \pm8.0720.67±2.7020.67 \pm2.7059.70±0.1659.70 \pm0.1614.42
HSPPK_WL60.33±6.7460.33 \pm6.7477.38±5.4477.38 \pm5.4485.67±3.4685.67 \pm3.4680.30±4.6780.30 \pm4.6760.17±6.2660.17 \pm6.2672.96±4.8472.96 \pm4.846.58
HSPPK_SP57.00±7.8157.00 \pm7.8177.40±3.8577.40 \pm3.8584.49±5.0484.49 \pm5.0480.31±5.7080.31 \pm5.7058.50±5.5558.50 \pm5.5568.55±5.2468.55 \pm5.248.33
GH77.33±7.4277.33 \pm7.4278.19±5.4778.19 \pm5.4785.94±5.1785.94 \pm5.1778.98±2.9578.98 \pm2.9566.50±6.1766.50 \pm6.1772.06±3.6472.06 \pm3.645.25
NP99.00±2.13\mathbf{99.00 \pm2.13}80.42±4.5780.42 \pm4.5786.18±5.5386.18 \pm5.5378.16±4.4778.16 \pm4.4743.00±5.7643.00 \pm5.7664.62±5.1364.62 \pm5.137.42
linearFGW-RAW62.00±8.4662.00 \pm8.4660.85±3.7560.85 \pm3.7576.34±5.6876.34 \pm5.6877.93±3.6877.93 \pm3.6856.67±7.0756.67 \pm7.0769.47±0.9169.47 \pm0.9112.17
linearFGW-WL172.33±8.7072.33 \pm8.7059.94±4.1159.94 \pm4.1178.52±3.9978.52 \pm3.9972.13±7.4072.13 \pm7.4047.00±4.7047.00 \pm4.7059.66±0.3859.66 \pm0.3814.50
linearFGW-WL271.33±7.4871.33 \pm7.4857.82±5.4857.82 \pm5.4878.51±2.9878.51 \pm2.9875.16±3.3475.16 \pm3.3441.00±7.5741.00 \pm7.5759.75±0.4359.75 \pm0.4314.67
WL (disc.)88.33±5.6388.33 \pm5.6377.26±5.8177.26 \pm5.8183.71±4.8383.71 \pm4.8377.10±5.5977.10 \pm5.5950.67±7.0350.67 \pm7.0371.16±4.0371.16 \pm4.0310.08
WLOA85.33±5.6285.33 \pm5.6275.00±3.2375.00 \pm3.2384.20±4.4784.20 \pm4.4774.54±5.4074.54 \pm5.4066.33±5.2166.33 \pm5.2171.16±1.9771.16 \pm1.979.08
WWL58.33±7.7858.33 \pm7.7877.12±3.5877.12 \pm3.5886.45±4.5086.45 \pm4.5079.03±3.8479.03 \pm3.8473.67±5.26\mathbf{73.67 \pm5.26}77.18±5.27\mathbf{77.18 \pm5.27}5.33
SWWL55.33±12.3155.33 \pm12.3177.64±5.5177.64 \pm5.5184.92±3.1084.92 \pm3.1081.39±5.24\mathbf{81.39 \pm5.24}64.83±6.0364.83 \pm6.0374.21±3.1574.21 \pm3.155.92
MMD-GK55.33±6.0055.33 \pm6.0078.58±4.1078.58 \pm4.1084.19±5.0184.19 \pm5.0177.32±4.9977.32 \pm4.9949.33±4.4249.33 \pm4.4270.98±3.9570.98 \pm3.9510.58
NSPPK (disc.)96.33±3.1496.33 \pm3.1482.93±5.5682.93 \pm5.5685.70±3.9085.70 \pm3.9080.30±4.1580.30 \pm4.1552.67±4.6752.67 \pm4.6772.87±1.5172.87 \pm1.514.92
NSPPK (ours)99.00±1.52\mathbf{99.00 \pm1.52}82.95±4.57\mathbf{82.95 \pm4.57}87.17±3.58\mathbf{87.17 \pm3.58}81.16±2.3081.16 \pm2.3060.50±5.3860.50 \pm5.3874.66±3.8174.66 \pm3.812.08\mathbf{2.08}
Attributes only54.33±9.5554.33 \pm9.5560.98±4.8060.98 \pm4.8078.77±1.0178.77 \pm1.0178.16±8.0778.16 \pm8.0755.67±5.3855.67 \pm5.3862.80±2.5262.80 \pm2.5212.75

Table 1. Classification accuracy (%) with node attributes (+) and average rank.

Note: TIMEOUT denotes a run exceeding 24 hours for one fold and is assigned the tied worst rank on that dataset. Avg Rank is computed across all six datasets (lower is better); “Attributes only” participates like any other method.

Kernel baselines. We compare Subgraph Matching (SM) [23], Shortest Path (SP) (Borgwardt & Kriegel, 2005), Multiscale Laplacian (ML) [22], Propagation Kernel (PK) [31], GraphHopper (GH) [12], and Neighborhood Preserving Kernel (NP) [36]. HSPPK-SP and HSPPK-WL denote hash graph kernels with Shortest Path and Weisfeiler–Lehman Subtree base kernels, respectively [27]. We also include the Weisfeiler–Lehman Subtree kernel (WL) [38] with discretized inputs, Weisfeiler–Lehman Optimal Assignment (WLOA) [24], Wasserstein Weisfeiler–Lehman (WWL) [43], Sliced Wasserstein Weisfeiler–Lehman (SWWL) [4], Maximum Mean Discrepancy Graph Kernel (MMD-GK) [40], and the Neighborhood Subgraph Pairwise Distance Kernel (NSPDK) [9], including a discretized variant. For Linear Fused Gromov–Wasserstein (linearFGW) [33], RAW uses the input node features. WL1 and WL2 use node features after one and two rounds of Weisfeiler–Lehman neighborhood aggregation, respectively. All kernels use support vector machine classifiers (LIBSVM [5]).

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAvg Rank
DGCNN46.67±5.6346.67 \pm5.6368.77±5.5268.77 \pm5.5279.40±3.3279.40 \pm3.3277.15±0.0677.15 \pm0.0633.33±9.3733.33 \pm9.3773.86±3.5673.86 \pm3.568.83
GraphSAGE76.67±7.7076.67 \pm7.7076.46±4.1376.46 \pm4.1383.70±4.4483.70 \pm4.4480.93±0.0780.93 \pm0.0765.00±5.7365.00 \pm5.7375.02±3.2975.02 \pm3.294.42
InfoGraph65.00±16.0565.00 \pm16.0573.01±6.0373.01 \pm6.0379.01±3.4279.01 \pm3.4277.77±14.2077.77 \pm14.2053.33±7.8453.33 \pm7.8466.37±6.2566.37 \pm6.258.08
GIN83.67±5.9283.67 \pm5.9276.85±7.2376.85 \pm7.2384.17±6.1484.17 \pm6.1481.80±6.1481.80 \pm6.1468.30±5.4368.30 \pm5.4362.10±5.2662.10 \pm5.264.25
GraphCL67.00±9.4867.00 \pm9.4880.34±6.9580.34 \pm6.9584.17±3.6284.17 \pm3.6280.34±6.9580.34 \pm6.9548.17±6.9348.17 \pm6.9375.82±2.7375.82 \pm2.734.25
GNN64.67±7.9264.67 \pm7.9276.59±6.9776.59 \pm6.9785.66±4.6085.66 \pm4.6079.92±7.0879.92 \pm7.0865.17±8.4165.17 \pm8.4166.57±6.1066.57 \pm6.105.00
FNP53.33±11.1653.33 \pm11.1670.76±3.9970.76 \pm3.9979.49±3.9479.49 \pm3.9478.22±7.0178.22 \pm7.0132.17±12.9832.17 \pm12.9870.17±3.1570.17 \pm3.158.25
PNA55.67±20.6655.67 \pm20.6661.50±5.4261.50 \pm5.4279.01±4.3379.01 \pm4.3378.22±7.0278.22 \pm7.0220.83±7.1220.83 \pm7.1275.11±3.6075.11 \pm3.608.17
PDF97.67±2.6097.67 \pm2.6077.37±4.5077.37 \pm4.5083.68±3.8183.68 \pm3.8182.23±7.0082.23 \pm7.0065.00±4.6565.00 \pm4.6572.14±4.4872.14 \pm4.483.75
NSPPK feat. (XGBoost)98.67±2.2198.67 \pm2.2183.74±4.1483.74 \pm4.1488.66±2.8988.66 \pm2.8982.90±4.3982.90 \pm4.3960.17±6.3060.17 \pm6.3077.37±4.8077.37 \pm4.801.67
Attributes only54.33±9.5554.33 \pm9.5560.98±4.8060.98 \pm4.8078.77±1.0178.77 \pm1.0178.16±8.0778.16 \pm8.0755.67±5.3855.67 \pm5.3862.80±2.5262.80 \pm2.529.33

Table 2. Classification accuracy (%) with node attributes in the neural-baseline comparison. Ranks use the displayed mean accuracies, with ties assigned the average rank.

Neural baselines: DGCNN [58], GraphSAGE [14], InfoGraph [39], GIN [51], GraphCL [57], Attentive FP (labeled FNP in the experiments) [50], PNA [7], and PDF [54].

Protocol. Following the separation of model selection and assessment in Errica et al. [11], we use 10 outer folds and set aside 10% of each training fold for validation. We report three comparison tracks separately. In the kernel comparison, each method produces a Gram matrix and is evaluated with LIBSVM; the SVM parameter CC and baseline-specific hyperparameters are selected on the validation split. In the explicit-feature comparison, NSPPK produces sparse feature vectors that are passed to standard downstream classifiers, primarily XGBoost, with the classifier settings selected on validation data. In the neural comparison, GNN baselines are trained with early stopping and validation-based model selection. We also test (i) attributes only, where graphs are represented by summed node attributes, and (ii) structure only, where attributes are removed (Appendix § 18).

NSPPK configuration. Unless stated otherwise, NSPPK uses the same structural configuration across all small datasets (R=1R=1, D=4D=4, c=1c=1, hash bits b=16b=16, degree cutoff τ=8\tau=8 when thresholding is enabled). Thus NSPPK is not tuned separately per dataset in the main small-scale experiments, although the method does expose these structural and implementation hyperparameters.

Runtime. The small-dataset runs used a Slurm-managed cluster with Intel Xeon Gold 5317 processors and 64 GB of RAM. Each processor has 12 physical cores and 24 hardware threads. Kernel runs used one CPU core, and GNN runs used CPU multithreading. We report a timeout when a kernel fold exceeds 24 hours. Runtime comparisons use the settings of each track.

Results. NSPPK has the best average rank in the attributed kernel comparison (2.08). It leads on DHFR and BZR and ties NP on SYNTHETICnew. NSPPK with XGBoost has the best average rank in the comparison with neural baselines (1.67) and the highest mean accuracy on five of the six datasets. The attributes-only control scores below NSPPK on all six datasets. Appendix § 17.§ 1 reports the statistical comparisons of accuracy ranks.

Runtime. Table 3 and Table 4 report runtimes with attributes. In the single-core kernel comparison, NSPPK averages 21.45 seconds and GraphHopper averages 803.06 seconds. In the neural comparison, GraphCL and

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAverageRank
SMTIMEOUTTIMEOUT12274.00 s25927.96 sTIMEOUTTIMEOUT19100.98 s17.00
ML1777.93 s1361.75 s849.20 s1155.49 s1295.99 s3628.70 s1678.18 s15.83
PK1.81 s2.82 s0.79 s1.13 s3.14 s4.48 s2.36 s1.33
HSPPK_WL49.54 s51.49 s8.63 s16.38 s25.20 s89.90 s40.19 s10.50
HSPPK_SP249.75 s63.10 s16.52 s29.22 s28.35 s119.32 s84.38 s12.17
GH242.05 s318.80 s112.43 s132.63 s365.25 s3647.21 s803.06 s15.00
NP41.57 s217.54 s42.32 s69.80 s17.69 s49.58 s73.08 s11.67
linearFGW-RAW6.82 s22.14 s6.63 s9.84 s8.73 s69.67 s20.64 s6.50
linearFGW-WL16.94 s22.58 s5.89 s10.75 s8.29 s67.19 s20.27 s6.50
linearFGW-WL25.95 s25.23 s7.02 s10.92 s10.26 s71.63 s21.84 s7.50
WL (disc.)12.33 s0.21 s4.00 s14.00 s9.00 s20.00 s9.92 s5.83
WLOA0.99 s10.49 s0.83 s3.27 s4.24 s12.67 s5.42 s3.08
WWL29.96 s105.03 s14.71 s40.89 s32.54 s134.95 s59.68 s11.67
SWWL3.52 s6.71 s3.16 s3.84 s5.03 s10.92 s5.53 s3.50
NSPDK (disc.)6.50 s10.49 s4.69 s2.64 s3.18 s6.13 s5.61 s3.58
MMD-GK38.07 s156.26 s40.48 s57.43 s86.43 s305.15 s113.97 s13.00
NSPPK (ours)34.81 s36.19 s12.75 s12.75 s26.45 s5.73 s21.45 s8.33

Table 3. Kernel runtimes (seconds) with node attributes (lower is better).

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAverageRank
DGCNN443.59 s2956.95 s304.88 s704.74 s948.88 s1512.29 s1145.22 s9.83
GraphSAGE139.94 s101.76 s175.30 s118.97 s317.84 s394.02 s207.97 s7.33
InfoGraph39.25 s163.79 s40.40 s111.40 s59.95 s85.72 s83.42 s5.33
GIN474.24 s1066.25 s302.44 s579.86 s369.06 s742.46 s589.05 s9.17
GraphCL11.33 s5.11 s4.10 s5.11 s15.51 s20.04 s10.20 s1.17
GNN165.92 s242.21 s100.28 s153.89 s207.18 s371.30 s206.80 s7.50
FNP49.97 s71.08 s18.72 s22.23 s60.51 s57.51 s46.67 s4.50
PNA16.67 s27.45 s4.38 s3.86 s17.33 s22.14 s15.30 s1.83
PDF20.59 s57.84 s21.10 s20.13 s61.43 s76.70 s42.96 s4.17
NSPPK feat. (XGB)39.35 s33.10 s19.38 s20.62 s39.54 s131.96 s47.32 s4.17

Table 4. Runtimes (seconds) with node attributes in the neural-baseline comparison. The final columns average the displayed times and their within-dataset ranks. Faster runs receive lower ranks.

PNA report lower mean runtimes than NSPPK with XGBoost. Appendix § 17 plots accuracy against runtime for each dataset and across all six datasets.

Parallel scalability. NSPPK feature extraction operates independently over graphs. On the preprocessed QM9 collection, vectorization drops from over one hour on one core to under ten minutes on 112 logical cores (Figure 7 in Appendix § 15).

Vectorization time by logical CPU core count on the preprocessed QM9 collection

Figure 7. Vectorization time by logical CPU core count on the preprocessed QM9 collection (log–log scale).

Larger-Scale Dataset Experiment

We evaluate the 95th ogbg-molpcba task, which predicts activity in a cell-based screen for human TDP1 inhibitors conducted in the presence of camptothecin (PubChem AID 686979) using balanced subsets of approximately 78k graphs. Appendix § 20.§ 1 gives the full protocol and runtime decomposition. Against neural and scalable kernel baselines, NSPPK shows strong sample efficiency and reaches the Pareto frontier for most configurations (Figure 6). Table 20 reports end-to-end time separately and includes both feature extraction and training.

Four-panel comparison of accuracy, runtime, Pareto frequency, and accuracy distribution

Figure 6. Task 95 results on ogbg-molpcba. (a) Mean test ROC–AUC versus mean training time. (b) Training time by training size. (c) Pareto frequency based on ROC–AUC and training time. (d) Test ROC–AUC by training size.

MethodMean Test APMean Test AUCMean ExtractionMean TrainingMean Total
NSPPK-XGBoost-Dense0.7550.77051.0 s67.2 s118.2 s
FNP0.7500.7660.0 s506.0 s506.0 s
NSPPK-XGBoost-Sparse0.7440.75953.5 s22.4 s75.9 s
NSPDK0.7320.74633.8 s91.6 s125.4 s
NSPPK-RandomForest-Sparse0.7290.74153.5 s10.9 s64.4 s
NSPPK-LogReg-Sparse0.7280.74053.5 s550.3 s603.8 s
PDF0.7160.7260.0 s887.2 s887.2 s
WL0.7120.722112.3 s390.0 s502.3 s
SWWL0.7000.7147.3 s0.9 s8.2 s
GNN0.6960.7240.0 s298.6 s298.6 s
GAT0.6950.7240.0 s316.9 s316.9 s
PNA0.6950.7220.0 s468.2 s468.2 s
GIN0.6950.7230.0 s214.8 s214.8 s

Table 20. Mean predictive performance and runtime on ogbg-molpcba (task 95), averaged over learning-curve training sizes and five random seeds. Extraction and training times are reported separately when feature construction is a distinct preprocessing stage.

Ablation Analysis

We ablate distance features, the union-of-shortest-paths connector, and high-degree thresholding under a fixed configuration (R=1R = 1, D=4D = 4, c=1c = 1, b=16b = 16, τ=8\tau= 8) with a random forest classifier. The full model is best or tied-best on most benchmarks (Table 5); removing distance or connector features generally reduces accuracy, whereas thresholding has a dataset-dependent effect. Full protocol details are given in Appendix § 13.§ 1.

SettingENZYMESBZRPROTEINS_fullDHFRSYNTHETICnewCOX2
No Distance57.17 ± 6.9985.69 ± 5.5276.37 ± 3.8580.17 ± 4.3598.33 ± 2.2481.16 ± 2.45
No Path52.83 ± 6.2886.98 ± 3.7276.10 ± 4.1176.85 ± 2.5898.67 ± 1.6380.73 ± 2.30
No Threshold55.50 ± 4.4887.42 ± 2.2575.92 ± 5.0583.34 ± 3.1099.00 ± 1.5381.81 ± 3.78
Full NSPPK57.83 ± 5.4387.90 ± 3.5676.20 ± 3.7482.95 ± 4.5799.00 ± 1.5382.46 ± 3.74

Table 5. Component ablation on six benchmarks. Results are mean test accuracy (%) ± standard deviation over 10 folds; settings and classifier details are given in Appendix § 13.§ 1.

Appendix § 21 further shows comparable accuracy across several classifiers, only 1–2 percentage-point variation across the COX2 structural-parameter sweeps, and the measured runtime increase on dense graphs. These results reduce, but do not eliminate, sensitivity to classifier choice and structural tuning within the evaluated settings. To examine the computational behavior of NSPPK beyond sparse graph structures, we additionally measure feature extraction time on Erdős–Rényi graphs with a fixed number of nodes and increasing expected average degree. This experiment investigates the effect of graph density on vectorization cost and complements the theoretical complexity analysis. Experimental settings and results are provided in Appendix L.

Conclusion

In this work, we introduced the Neighborhood Subgraph Pairwise Path Kernel (NSPPK), a deterministic graph kernel that maps graphs with continuous node attributes into high-dimensional sparse feature vectors. Its core structural behavior is controlled by just three integer parameters. The method combines structural feature hashing with the direct aggregation of continuous node attributes, producing explicit representations that can be computed once per graph and reused across learning tasks. In our experiments, a single structural configuration performed competitively across all six graph classification benchmarks, without dataset-specific structural parameter tuning.

NSPPK also supports efficient, parallel graph vectorization. Feature extraction is independent across graphs, making it straightforward to distribute across processors and well suited to rapid experiments on large collections of sparse graphs. In the QM9 experiment, vectorization time fell from over an hour on one core to under ten minutes on 112 logical cores. Theoretical analysis establishes linear scaling in the number of nodes when structural parameters are fixed and local adjacency sizes are bounded. Shortest-path connectors also distinguish graph structures that bounded-radius NSPDK cannot distinguish, while perturbation experiments show that NSPPK retains informative similarities under structural and attribute modifications.

Across six graph classification benchmarks, NSPPK achieves the best average accuracy rank among the evaluated graph kernels. Combined with XGBoost, its explicit features achieve the highest mean accuracy on five of the six datasets in the neural-baseline comparison. Ablation results support the contribution of distance and connector features. The MolPCBA case study extends the evaluation to larger training sets and shows how NSPPK performs as the amount of training data grows.

Limitations and future work. The computational cost of NSPPK depends on graph connectivity and the extent of the extracted structural patterns. Although the method is particularly well suited to datasets comprising small, sparse graphs, increasing graph density or local connectivity can substantially increase the number of eligible node pairs and the cost of constructing structural features. As demonstrated by the density sensitivity experiment, this can lead to considerable increases in vectorization time.

Overall, NSPPK demonstrates that deterministic graph vectorization can achieve competitive predictive performance without requiring trainable graph encoders. Its explicit feature representation supports both kernel-based learning and conventional machine learning algorithms, providing a practical alternative to learned graph embeddings, particularly for collections of sparse attributed graphs.

Code availability. The implementation corresponding to the experiments reported in this paper is available in the NSPPK v1.3.6 release (https://github.com/fabriziocosta/NSPPK/releases/tag/v1.3.6). Later releases include additional functionality beyond the version used for this paper.

Acknowledgments. For the purpose of open access, the authors have applied a Creative Commons Attribution (CC BY) license to any Author Accepted Manuscript version arising from this submission.

Appendix

Definitions

A graph here is a finite, simple, undirected, unweighted graph G=(V,E)G=(V,E), where E⊆{{u,v}⊆V:u≠v}E \subseteq\{\{u,v\}\subseteq V:u\ne v\}.

A labeled graph is a graph G=(V,E)G=(V,E) equipped with a labeling function ℓ:V∪E→Σ\ell:V\cup E\to\Sigma that assigns each vertex and edge a label from a discrete alphabet Σ\Sigma. A node-attributed graph is a graph G=(V,E)G=(V,E) equipped with an attribute function a:V→Rpa:V\to\mathbb{R}^{p}, assigning each vertex a pp-dimensional real-valued attribute vector. Equivalently, the node attributes can be represented by a matrix A∈R∣V∣×pA\in\mathbb{R}^{|V|\times p}, whose rows correspond to vertices, with Av,:=a(v)⊤A_{v,:}=a(v)^\top. We denote the resulting attributed graph by (G,A)(G,A).

For a vertex v∈Vv\in V, the degree of vv is the number of edges incident to it,

deg⁡(v)=∣{u∈V∣{v,u}∈E}∣,\deg(v)=|\{u\in V\mid\{v,u\}\in E\}|,

and its (immediate) neighborhood is N(v)={u∈V∣{v,u}∈E}N(v)=\{u\in V\mid\{v,u\}\in E\}. A degree cutoff parameter τ\tau may be used as an implementation heuristic to suppress expanded rooted hashes at high-degree centers; unless traversal pruning is explicitly applied, this does not by itself change the worst-case BFS cost.

A path in GG is a sequence of distinct vertices (v1,v2,…,vk)(v_1,v_2,\ldots,v_k) such that {vi,vi+1}∈E\{v_i,v_{i+1}\}\in E for all 1≤i<k1\le i<k. The length of the path is the number of edges in the sequence, i.e., k−1k-1.

A shortest path from vv to uu is a path with the smallest possible length among all paths connecting vv and uu. The distance between vv and uu, denoted d(v,u)d(v,u), is the length of a shortest path between them; if no path exists, d(v,u)d(v,u) is defined to be infinite.

The union of shortest paths between vertices vv and uu, denoted U(v,u)U(v,u), is the subgraph consisting of all vertices and edges that belong to at least one shortest path from vv to uu (i.e., the union over all equally-short paths).

The rr-hop neighborhood Nr(v)N_r(v) is the subgraph induced by {u∈V:d(v,u)≤r}\{u\in V:d(v,u)\le r\}, rooted at vv. For a set S⊆VS\subseteq V, Nr(S)N_r(S) is induced by the vertices at distance at most rr from SS.

Anchors and connector subgraph. For an unordered pair of distinct anchors with d(u,v)≤Dd(u,v)\le D, define C0(u,v)=U(u,v)C_0(u,v)=U(u,v) as the path union, and Cr′(u,v)=Nr′(V(U(u,v)))C_{r'}(u,v)=N_{r'}(V(U(u,v))) for r′>0r'>0. Disconnected pairs are excluded.

Notation summary. Unless otherwise specified, we denote by ∣V∣|V| and ∣E∣|E| the numbers of vertices and edges, respectively; Kmax⁡=max⁡v∈Vdeg⁡(v)K_{\max}=\max_{v\in V}\deg(v) is the maximum degree and τ\tau an optional degree cutoff. Distances are d(u,v)d(u,v), Nr(v)N_r(v) is the rr-hop neighborhood of vv, U(u,v)U(u,v) the union of all shortest u↔vu\leftrightarrow v paths, and Cr′(u,v)C_{r'}(u,v) the connector of radius r′r'. Lowercase rr, dd, r′r' denote per-feature radii and distances, while uppercase RR, DD, R′R' are their maximal values. The resulting feature vector for a graph GG under parameters θ=(R,D,R′)\theta=(R,D,R') is ϕθ(G)\phi_\theta(G).

Computational and Space Complexity Analysis

Let n=∣V∣n=|V|, m=∣E∣m=|E|, H=max⁡(R,R′)H=\max(R,R'), and B=2bB=2^b. Use Bℓ(v)\mathcal{B}_{\ell}(v) and Eℓ(v)\mathcal{E}_{\ell}(v) as in § 3.6. Then PD(G)=12∑v∈V(∣BD(v)∣−1)P_D(G)=\frac{1}{2}\sum_{v\in V}(|\mathcal{B}_D(v)|-1) is the number of unordered pairs of distinct vertices within distance DD.

Structural feature extraction

The rooted-hash and anchor-enumeration traversals take, respectively,

TH=O(∑v(∣BH(v)∣+∣EH(v)∣)),TD=O(∑v(∣BD(v)∣+∣ED(v)∣)).T_H=O\left(\sum_v\left(|\mathcal{B}_H(v)|+|\mathcal{E}_H(v)|\right)\right),\qquad T_D=O\left(\sum_v\left(|\mathcal{B}_D(v)|+|\mathcal{E}_D(v)|\right)\right).

These terms count vertex visits and adjacency scans. They exclude sorting neighbor multisets and BFS shells and assembling their hash inputs. Write TsortT_{\mathrm{sort}} for that additional rooted-hash work, including base node hashes. A degree cutoff that suppresses expanded hashes without pruning traversal can reduce hashing work while leaving the traversal bound intact.

With LL connector choices, including the omitted connector, each node pair contributes at most (R+1)2L(R+1)^2L structural configurations. At fixed hash width, combining the cached descriptors and updating the feature counts requires O((R+1)2LPD(G))O((R+1)^2LP_D(G)) operations. Let TconnT_{\mathrm{conn}} denote the computational cost of constructing the connectors and computing their structural hashes. Because r′=0r'=0 uses the path union, its cost is included whenever that connector is enabled. The combined bound is

O(TH+TD+Tsort+(R+1)2LPD(G)+Tconn).O(T_H+T_D+T_{\mathrm{sort}}+(R+1)^2LP_D(G)+T_{\mathrm{conn}}).

For fixed structural parameters, fixed hash width, and bounded maximum node degree, the number and size of the extracted local structural patterns are bounded independently of the graph size. Consequently, structural feature extraction has O(n)O(n) time complexity, provided connector construction is restricted to the corresponding local neighborhoods.

Without a bound on the maximum degree, PD(G)P_D(G) can reach Θ(n2)\Theta(n^2), and the computational cost increases with graph connectivity.

Attribute integration and kernel evaluation

Accumulating A⊤MGA^\top M_G by nonzero entries of MGM_G takes O(p nnz⁡(MG))O(p\,\operatorname{nnz}(M_G)) arithmetic operations, with a further O(pB)O(pB) cost if the entire output is initialized densely. Multiplication with a dense n×Bn \times B count matrix takes O(pnB)O(pnB) arithmetic operations using the standard matrix product. With sorted sparse indices, kernel evaluation is linear in the combined number of nonzeros of the two compared vectors, structural or attributed.

Space complexity

Cached hashes occupy O(n(H+1))O(n(H+1)) entries. In addition to the input graph, a serial BFS uses O(n)O(n) working entries. If ToccT_{\mathrm{occ}} is the number of emitted structural occurrences, the structural histogram has at most min⁡(B,Tocc)\min(B,T_{\mathrm{occ}}) nonzeros and MGM_G has at most min⁡(nB,2Tocc)\min(nB,2T_{\mathrm{occ}}) nonzeros. The attributed output has at most pmin⁡(B,Tocc)p\min(B,T_{\mathrm{occ}}) stored nonzeros, or pBpB entries if dense.

Datasets

The six small graph-classification benchmarks are publicly available in TUDataset (Kersting et al., [18]; Morris et al., [29]). Their nodes carry discrete labels, continuous attributes, or both.

BZR consists of 405 chemical compounds represented as graphs, where nodes correspond to atoms and edges to chemical bonds. The binary labels derive from measured benzodiazepine receptor activity (Sutherland et al., [41]).

COX2 contains 467 molecules represented as graphs, labeled according to their activity against cyclooxygenase-2 (COX-2) (Sutherland et al., [41]).

ENZYMES consists of 600 protein tertiary structures from the BRENDA database. Each protein belongs to one of six top-level enzyme commission (EC) classes, and the task is to predict the correct class Borgwardt et al. [3].

PROTEINS_full represents proteins as graphs, where vertices correspond to secondary structure elements. Edges connect vertices that are adjacent in the amino acid sequence or in 3D space. The classification task is to distinguish enzymes from non-enzymes Borgwardt et al. [3].

SYNTHETICnew consists of 300 synthetic graphs in two classes, with 100 vertices per graph and a continuous node attribute. The classes differ in the amount of topological and attribute perturbation. The original SYNTHETIC generator is described by Feragen et al. [12]; Morris et al. [27] use the SYNTHETICnew variant.

DHFR contains 756 molecules represented as graphs, labeled according to their activity against the dihydrofolate reductase (DHFR) enzyme Sutherland et al. [41].

Dataset#Graphs#Classes / TasksAvg. ∣V∣|V|Avg. ∣E∣|E|Avg. deg.Max deg.Attr. dim.
BZR405235.7538.362.1543
COX2467241.2343.452.1143
ENZYMES600632.6362.143.86918
PROTEINS_full1113239.0672.823.742529
SYNTHETICnew3002100.00196.253.9391
DHFR756242.4344.542.1053
ogbg-molpcba437,92912825.9628.102.1649

Table 6. Graph classification dataset statistics. The nine MolPCBA node feature channels are categorical encodings.

Hyperparameters Used for Model Selection in the Graph Classification Task

For some kernels, only a subset of the hyperparameters was optimized, while the rest of the hyperparameters were kept fixed.

ModelLayersConvs per layerBatch sizeLearning rateHidden unitsEpochs
DGCNN2,3,41161e−432, 641000
GINsee hidden units132, 1281e−232 (5 layers), 64 (5 layers), 64 (2 layers), 32 (3 layers)1000
GraphSAGE3, 51161e−2, 1e−3, 1e−432, 641000
InfoGraph3, 5–16, 321e−2, 1e−332, 64, 128100
GNN3, 51161e−2, 1e−3, 1e−432, 641000
GraphCL2, 31321e−364, 128200
FNP2, 3, 41321e−332, 641000
PNA2, 3, 41321e−332, 641000
PDF2, 31325e−464, 129300

Table 7. Neural hyperparameters used for model selection: architecture and search ranges.

ModelL2DropoutPatience (loss, acc)OptimizerSchedulerDense dimEmbed. dimNeighbors Aggregation
DGCNN–0.5500, 500Adam–128–mean, max, sum
GIN–0, 0.5500, 500AdamStepLR (step 50, γ=0.5)––sum
GraphSAGE–0500, 500Adam–––mean, max, sum
InfoGraph0, 1e−40, 0.1, 0.3500, 500AdamReduceLROnPlateau (γ=0.5)––sum
GNN–0, 0.5500, 500AdamStepLR (step 50, γ=0.5)––mean, max, sum
GraphCL–0500, 500Adam–––mean, max, sum
FNP–0.0, 0.2, 0.5500, 500Adam–––sum
PNA–0500, 500Adam–––max
PDF1e−20500, 500AdamStepLR (step 50, γ=0.5)––mean

Table 8. Neural hyperparameters used for model selection: optimization and regularization.

KernelFixedValidation-tuned
SMk=3k = 3–
SP––
MLγ=0.01\gamma= 0.01, η=0.01\eta= 0.01, p^=10\hat{p} = 10lmax⁡∈{0,…,5}l_{\max} \in\{0,\ldots,5\}, c~∈{50,100,200,300}\tilde{c} \in\{50,100,200,300\}
PKw=10w = 10T∈{1,…,6}T \in\{1,\ldots,6\}
HSPPK-WLIterations =20= 20h∈{0,…,5}h \in\{0,\ldots,5\}
HSPPK-SPIterations =20= 20h∈{0,…,5}h \in\{0,\ldots,5\}
GH–Linear kernel / Gaussian kernel
linearFGW-RAWRBF kernel, γ=0.1\gamma= 0.1α∈{0.1,0.5,0.9}\alpha\in\{0.1,0.5,0.9\}, GWB layers =5= 5, OT layers ∈{3,5}\in\{3,5\}, Iter ∈{1,2,3}\in\{1,2,3\}, γkernel∈{0.01,0.1,1.0}\gamma_{\mathrm{kernel}} \in\{0.01,0.1,1.0\}
linearFGW-WL1RBF kernel, γ=0.1\gamma= 0.1same as above
linearFGW-WL2RBF kernel, γ=0.1\gamma= 0.1same as above
WL (disc)–Iterations ∈{0,…,5}\in\{0,\ldots,5\}
WLOA–Iterations ∈{0,…,5}\in\{0,\ldots,5\}
WWL–Iterations ∈{0,…,7}\in\{0,\ldots,7\}, Sinkhorn ∈{False,True}\in\{\text{False},\text{True}\}, γ∈{0.01,0.1,1,10}\gamma\in\{0.01,0.1,1,10\}
SWWLProjections=16=16, Quantiles=9=9, Step=1=1Iterations ∈{0,…,7}\in\{0,\ldots,7\}, γ∈{0.01,0.1,1,10}\gamma\in\{0.01,0.1,1,10\}
MMD-GKBandwidths ={1.0,10.0}= \{1.0,10.0\}, γdist=1.0\gamma_{\mathrm{dist}} = 1.0GCN smoothing layers ∈{1,2,3}\in\{1,2,3\}; SVM C∈{10e:e∈{−7,−5,−3,−1,0,1,2,3,5,7}}C \in\{10^e:e \in\{-7,-5,-3,-1,0,1,2,3,5,7\}\}
NP–Iterations ∈{0,…,5}\in\{0,\ldots,5\}, Linear / Gaussian kernel
NSPDKR=1R = 1, D=4D = 4–
NSPDK (disc)R=1R = 1, D=4D = 4–
NSPPKR=1R = 1, D=4D = 4, c=1c = 1, degree cutoff τ=8\tau= 8, hash bits b=16b = 16

Table 9. Hyperparameters used in the kernels for model selection in the graph classification task.

Ablation and Sensitivity Experiment Details

Table 10 summarizes the classifier and implementation settings for the ablation in § 7 and the sensitivity experiments in Appendix § 21. These experiments use explicit NSPPK feature vectors rather than Gram matrices.

ExperimentNSPPK settingClassifier and evaluation details
Component ablationR=1R = 1, D=4D = 4, c=1c = 1, b=16b = 16; τ=8\tau= 8 when thresholding is enabledRandom forest classifier with fixed hyperparameters across all ablation configurations, random seed 42, and parallel training. Accuracy is reported over 10 folds.
Classifier sensitivityR=1R = 1, D=4D = 4, c=1c = 1, b=11b = 11; no degree cutoffStratified 10-fold outer cross-validation. The evaluated classifiers are XGBoost, extra-trees, random forest, logistic regression, linear support-vector classification, and ridge classification. Hyperparameters are selected on the training portion of each outer fold using the grids shown below.
Hyperparameter sensitivity on COX2R,R′∈{0,…,6}R,R' \in\{0,\ldots,6\}, D∈{1,…,6}D \in\{1,\ldots,6\}; b=11b = 11XGBoost classifier with fixed seed 42 and degree cutoff τ=3\tau= 3. The sweep varies one parameter at a time from the reference setting (R,D,c)=(1,4,1)(R,D,c) = (1,4,1).
Density sensitivityR=1R = 1, D=4D = 4, c=1c = 1, b=11b = 11; no node attributesFeature-extraction-only runtime experiment on Erdős–Rényi graphs with n=300n = 300 and varying expected average degree.

Table 10. Protocol details for the NSPPK ablation and sensitivity experiments.

ClassifierGrid or fixed configuration
XGBoostNumber of trees ∈{300,800}\in\{300, 800\}, maximum depth ∈{3,6}\in\{3, 6\}, learning rate ∈{0.03,0.1}\in\{0.03, 0.1\}, subsampling rate ∈{0.8,1.0}\in\{0.8, 1.0\}, histogram tree method, seed 42, and parallel fitting over all available CPU cores.
Extra-trees500 trees, maximum depth ∈{None,4,8}\in\{\mathrm{None}, 4, 8\}, maximum features ∈{⋅,log⁡2(⋅)}\in\{\sqrt{\cdot}, \log_{2}(\cdot)\}, seed 42, and parallel fitting over all available CPU cores.
Random forest500 trees, maximum depth ∈{None,4,8}\in\{\mathrm{None}, 4, 8\}, maximum features ∈{⋅,log⁡2(⋅)}\in\{\sqrt{\cdot}, \log_{2}(\cdot)\}, seed 42, and parallel fitting over all available CPU cores.
Logistic regressionC∈{0.01,0.1,1,10,100}C \in\{0.01, 0.1, 1, 10, 100\}, liblinear solver, maximum 5000 iterations, and seed 42.
Linear support-vector classifierC∈{0.01,0.1,1,10,100}C \in\{0.01, 0.1, 1, 10, 100\}, maximum 10000 iterations, and seed 42.
Ridge classifierα∈{0.1,1,10,100}\alpha\in\{0.1, 1, 10, 100\} and seed 42.

Table 11. Classifier grids used in the classifier-sensitivity experiment.

Robustness Study Hyperparameters

Table 12 summarizes the configurations used for the diagonal dominance / robustness experiments. Neural baselines (GIN-Random, GraphCL, InfoGraph) were run with a common lightweight setup, while classical kernels (GraphHopper, Propagation Kernel) followed their standard definitions. NSPPK used b=12b = 12, with the same structural radii and degree cutoff as in the main experiments. For every method, we normalize the Gram matrix as K^ij=Kij/KiiKjj\hat{K}_{ij} = K_{ij}/\sqrt{K_{ii}K_{jj}} before constructing the similarity curves, heatmaps, and singular-spectrum entropy. The heatmaps provide the direct diagnostic of off-diagonal coupling; entropy is reported separately as an effective-rank diagnostic.

MethodConfiguration
NSPPKR=1R = 1, D=4D = 4, c=1c = 1, τ=8\tau= 8, b=12b = 12
GIN-Random3 layers GIN, hidden dim=32, MLP layers=2, pooling=sum, epochs=200, lr=0.01, seed=42, orthogonal init, no supervision
GraphCLSame GIN backbone as above, contrastive pretraining with augmentations, 200 epochs, lr=0.01
InfoGraphSame GIN backbone as above, maximizing mutual information, 200 epochs, lr=0.01
GraphHopperShortest-path kernel, weight decay w=10−5w = 10^{-5}, tmax⁡∈{1,2,3,4,5}t_{\max} \in\{1, 2, 3, 4, 5\}
Propagation KernelAttribute propagation with M=L1M = L1 distance, 5 iterations

Table 12. Hyperparameters for robustness / diagonal dominance analysis.

The neural robustness setup includes 50,000 graphs with 50 to 250 nodes. GraphCL and InfoGraph use their respective pretraining objectives.

Hash-width experiment on QM9

Our preprocessed collection contains about 112,000 of the 133,885 QM9 molecules [35], represented as graphs with continuous node attributes. Vectorization took 282–312 seconds at 2–11 bits and 2,285–2,958 seconds at 12–14 bits, when we observed memory swapping (Figure 2b). The 15-bit run failed during memory allocation.

Scalability of NSPPK Vectorization

We used 12-bit hashing with R=1R = 1, D=4D = 4, and c=1c = 1 for the preprocessed QM9 collection of about 112,000 graphs. The machine had two Intel Xeon Gold 6330 processors with 28 physical cores each, for 112 logical CPUs across two NUMA nodes. The log–log plot in Figure 7 shows diminishing reductions in wall-clock time as the number of workers increases. At 112 logical CPUs, vectorization takes under 10 minutes.

Additional Experiments on Citation Networks

To evaluate NSPPK outside the molecular benchmarks, we additionally tested it on three widely used citation network datasets with fundamentally different structural properties: Cora, CiteSeer, and PubMed. These graphs exhibit higher-degree outliers, broader graph diameters, and citation-style connectivity patterns, in contrast to the small and sparse molecular graphs considered elsewhere in this paper.

Dataset#Nodes#EdgesAvg Deg.Max Deg.Encoding Time (s)
Cora2,7085,2783.901680.7897
CiteSeer3,3274,5522.74990.7447
PubMed19,71744,3244.501710.8747

Table 13. Citation network sizes and NSPPK encoding times (80/20 split, seed 42).

We compared NSPPK against a set of commonly used graph neural network architectures for node classification: GCN [20], GAT [45], GraphSAGE [14], GIN [51], SGC [48], APPNP [21], and a feature-only MLP.

All GNN models were trained directly on the original citation graphs using the same 80/20 train–test split as NSPPK. For GCN, GIN, GraphSAGE, and GAT, we used two-layer architectures with a hidden dimension of 64, ReLU activations, and dropout applied between layers. GAT employed eight attention heads in the first layer. APPNP was implemented as a two-layer MLP followed by personalized PageRank propagation with K=10K=10 steps and teleport probability α=0.1\alpha=0.1. SGC used a single linear classifier with K=2K=2 propagation steps. The MLP baseline consisted of a two-layer feed-forward network operating solely on node features, without using graph structure.

All models were trained using the Adam optimizer (learning rate 0.01, weight decay 5×10−45 \times10^{-4}) for 200 epochs. Model selection relied solely on the fixed training split, without tuning hyperparameters per dataset. Performance is reported on the held-out test nodes in terms of macro-averaged ROC–AUC (one-vs-rest).

For NSPPK, we followed a standard node classification setup with an 80/20 train–test split and a fixed random seed of 42. All three citation networks used a common configuration: R=1R = 1, D=4D = 4, c=0c = 0, and 11-bit hashing. Continuous node attributes were projected to 24 dimensions using SVD. Discrete node labels were obtained by applying kk-means clustering with k=5k = 5 to the node attributes. Continuous node attributes were separately reduced to 24 dimensions using singular value decomposition (SVD).

DatasetGraphSAGEGATAPPNPGCNSGCNSPPK+XGBMLPGIN
CiteSeer0.94220.94540.93100.92570.94320.92530.92470.9084
Cora0.98460.98740.98840.98400.98740.96360.95020.9669
PubMed0.97590.96150.96220.96590.93960.96860.97140.9663

Table 14. Test ROC–AUC (macro, one-vs-rest) on citation networks with an 80/20 node classification split.

NSPPK with XGBoost attains macro ROC–AUC of 0.9253 on CiteSeer, 0.9636 on Cora, and 0.9686 on PubMed. GraphSAGE records the highest PubMed score (0.9759).

Further Visualization: Accuracy–Time Trade-off

The aggregate panel in Figure 8 places NSPPK on the plotted frontier. The kernel and neural runtimes in this figure use the hardware settings described in § 6.1.

Figure 8. Accuracy–time trade-off (log time). Markers: green star = NSPPK, blue circle = other kernels, orange square = neural nets. Dashed line = Pareto front.

Statistical comparison of accuracy ranks

We apply a Friedman test to the mean accuracies displayed in Tables 1 and 2, treating each of the six datasets as a block and averaging tied ranks within each block. The analysis excludes the attributes-only control and any method that timed out on at least one dataset. The omnibus pp-values are 3.35×10−53.35 \times10^{-5} for the 16 kernel methods and 2.16×10−42.16 \times10^{-4} for the 10 pipelines in the neural-baseline comparison.

We follow each omnibus test with Conover pairwise comparisons and apply Holm adjustment across all pairs within that comparison. At the 0.05 level, NSPPK ranks significantly ahead of ML, PK, the three linearFGW variants, and MMD-GK in the kernel comparison. With XGBoost, it ranks significantly ahead of DGCNN, InfoGraph, FNP, and PNA in the neural-baseline comparison. Figure 9 shows the average ranks and the groups from the adjusted pairwise tests.

Figure 9. Average accuracy ranks across six datasets. Lower ranks are better. A crossbar links a group with no significant pairwise differences at the 0.05 level after Holm adjustment of the Conover tests.

Additional Results: No-Attribute Setting

Tables 15 and 16 report kernel and neural network accuracy, respectively, when node attributes are removed. This comparison isolates the contribution of structural features under the reported protocol. NSPPK has an average rank of 5.00 in the kernel comparison and 3.33 in the comparison with neural baselines.

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAvg Rank
SMTIMEOUTTIMEOUT79.02±1.1079.02 \pm1.1078.16±0.8178.16 \pm0.81TIMEOUTTIMEOUT15.50
SPTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUT18.67
ML67.22±9.5167.22 \pm9.5179.90±1.3679.90 \pm1.3686.63±3.8186.63 \pm3.8177.95±4.6377.95 \pm4.6333.66±5.3133.66 \pm5.3172.80±3.8072.80 \pm3.805.67
PK61.33±7.3361.33 \pm7.3360.98±0.4860.98 \pm0.4878.77±1.0178.77 \pm1.0178.16±8.0778.16 \pm8.0718.33±5.2218.33 \pm5.2258.48±4.2958.48 \pm4.2912.17
HSPPK_WL50.00±0.0050.00 \pm0.0057.56±6.6757.56 \pm6.6780.26±3.0280.26 \pm3.0272.41±17.0672.41 \pm17.0616.50±2.7316.50 \pm2.7363.80±5.7663.80 \pm5.7615.17
HSPPK_SP58.00±7.1858.00 \pm7.1864.42±4.0564.42 \pm4.0576.26±9.3976.26 \pm9.3977.31±4.7077.31 \pm4.7021.00±5.9221.00 \pm5.9246.20±4.7046.20 \pm4.7013.17
GH59.33±9.2859.33 \pm9.2874.08±4.2774.08 \pm4.2781.25±2.4081.25 \pm2.4077.30±3.1477.30 \pm3.1425.17±3.9825.17 \pm3.9871.61±4.3271.61 \pm4.328.50
NP97.00±3.1597.00 \pm3.1580.43±4.0180.43 \pm4.0184.16±5.6584.16 \pm5.6580.29±3.4280.29 \pm3.4236.70±0.5336.70 \pm0.5369.99±3.8869.99 \pm3.884.50
linearFGW-RAW57.33±6.2957.33 \pm6.2954.90±4.7754.90 \pm4.7780.52±3.7680.52 \pm3.7676.24±4.7476.24 \pm4.7423.00±4.8823.00 \pm4.8871.35±4.5671.35 \pm4.5611.67
linearFGW-WL156.00±11.7256.00 \pm11.7263.90±3.9763.90 \pm3.9780.99±5.2480.99 \pm5.2476.45±1.8676.45 \pm1.8624.50±4.7824.50 \pm4.7870.17±4.8170.17 \pm4.8111.00
linearFGW-WL248.67±7.3348.67 \pm7.3359.12±6.4159.12 \pm6.4179.48±5.4879.48 \pm5.4874.74±5.1274.74 \pm5.1222.33±5.5922.33 \pm5.5969.54±3.1269.54 \pm3.1214.00
WL (disc.)79.00±12.3979.00 \pm12.3980.56±5.2980.56 \pm5.2987.90±3.9287.90 \pm3.9278.17±3.4878.17 \pm3.4840.17±7.5440.17 \pm7.5469.00±4.0869.00 \pm4.084.67
WLOA81.00±6.1681.00 \pm6.1680.96±3.9080.96 \pm3.9083.71±8.3683.71 \pm8.3678.16±2.7578.16 \pm2.7542.67±4.8442.67 \pm4.8474.49±3.5374.49 \pm3.534.00
WWL50.00±0.0050.00 \pm0.0060.98±0.4760.98 \pm0.4778.77±1.0178.77 \pm1.0178.16±0.8078.16 \pm0.8016.67±0.0016.67 \pm0.0059.57±0.1759.57 \pm0.1713.17
SWWL50.0±0.0050.0 \pm0.0060.98±0.4860.98 \pm0.4878.77±1.0178.77 \pm1.0178.16±0.8078.16 \pm0.8016.67±0.0016.67 \pm0.0059.57±0.1759.57 \pm0.1713.17
NSPDK95.33±3.7295.33 \pm3.7282.94±5.7082.94 \pm5.7085.68±4.0485.68 \pm4.0477.09±3.8477.09 \pm3.8435.67±9.2235.67 \pm9.2271.33±3.0671.33 \pm3.065.50
NSPDK (disc.)95.33±3.7295.33 \pm3.7282.94±5.7082.94 \pm5.7085.68±4.0485.68 \pm4.0477.09±3.8477.09 \pm3.8435.67±9.2235.67 \pm9.2271.33±3.0671.33 \pm3.065.50
MMD-GK84.33±6.1684.33 \pm6.1675.66±5.4875.66 \pm5.4884.44±3.9884.44 \pm3.9876.03±3.9476.03 \pm3.9430.33±4.4630.33 \pm4.4669.09±3.0169.09 \pm3.019.00
NSPPK (ours)98.00±3.9398.00 \pm3.9380.18±5.5880.18 \pm5.5887.65±4.5487.65 \pm4.5477.73±3.9677.73 \pm3.9633.17±5.8033.17 \pm5.8071.34±4.0671.34 \pm4.065.00

Table 15. Classification accuracy (%) without node attributes (-) with Avg Rank. Note: TIMEOUT denotes a run exceeding 24 hours for one fold and is assigned the tied worst rank on that dataset. Avg Rank is computed across all six datasets; lower is better.

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAvg Rank
DGCNN44.67 ± 6.8661.50 ± 4.9381.98 ± 2.2078.22 ± 0.0726.80 ± 7.0973.22 ± 3.486.83
GraphSAGE43.33 ± 5.5878.06 ± 6.2583.70 ± 5.5980.30 ± 0.0348.17 ± 7.5874.93 ± 2.824.92
InfoGraph67.33 ± 21.5471.53 ± 8.5175.05 ± 15.0469.02 ± 0.2053.33 ± 4.7963.07 ± 4.696.50
GIN53.00 ± 9.7179.91 ± 7.9173.95 ± 3.3079.91 ± 0.0842.67 ± 7.6865.77 ± 5.026.00
GraphCL50.00 ± 8.6980.16 ± 2.5179.99 ± 3.6281.38 ± 3.7937.50 ± 5.1271.43 ± 3.925.25
GNN43.33 ± 5.5882.67 ± 4.9684.66 ± 4.6081.60 ± 5.5448.50 ± 5.8071.79 ± 3.613.75
FNP50.00 ± 8.6960.85 ± 4.6381.73 ± 3.5278.22 ± 3.9435.83 ± 7.7972.41 ± 3.706.83
PNA46.00 ± 7.7260.98 ± 4.4678.76 ± 4.3378.22 ± 7.0118.83 ± 7.0770.62 ± 3.698.33
PDF50.00 ± 8.6978.83 ± 4.2184.43 ± 4.6381.38 ± 3.7952.00 ± 5.2674.75 ± 2.283.25
NSPPK feat. (XGBoost)91.00 ± 4.7378.44 ± 1.2789.60 ± 3.2982.76 ± 4.2541.83 ± 5.5571.60 ± 3.153.33

Table 16. Classification accuracy (%) without node attributes in the neural-baseline comparison. Ranks use the displayed mean accuracies, with ties assigned the average rank.

Additional Runtimes: No-Attribute Setting

Tables 18 and 17 report computation times for kernels and neural networks without node attributes. In this setting, NSPPK’s average runtime rank is reported alongside its predictive rank so that the runtime–accuracy trade-off can be assessed from the two tables without assuming that either ranking transfers to other datasets.

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAverageRank
DGCNN428.69 s575.14 s571.26 s237.85 s887.36 s1611.41 s718.62 s9.83
GraphSAGE124.81 s109.79 s126.21 s140.69 s248.03 s395.38 s190.82 s7.50
InfoGraph65.27 s185.02 s100.00 s87.92 s144.01 s241.47 s137.28 s6.33
GIN388.95 s392.46 s358.57 s392.46 s440.30 s884.01 s476.12 s9.17
GraphCL3.58 s13.53 s4.23 s5.42 s13.28 s17.61 s9.61 s2.00
GNN81.93 s255.75 s28.95 s122.86 s247.42 s403.82 s190.12 s7.00
FNP7.69 s92.75 s63.45 s15.82 s70.24 s38.84 s48.13 s4.33
PNA3.32 s19.04 s3.83 s2.80 s8.59 s23.63 s10.20 s1.67
PDF13.12 s75.36 s17.80 s23.45 s63.85 s67.34 s43.49 s4.33
NSPPK feat. (XGB)32.91 s10.07 s4.28 s6.25 s7.43 s60.64 s20.26 s2.83

Table 17. Runtimes (seconds) without node attributes in the neural-baseline comparison. The final columns average the displayed times and their within-dataset ranks. Faster runs receive lower ranks.

MethodSYNTHETICnewDHFRBZRCOX2ENZYMESPROTEINS_fullAverageRank
SMTIMEOUTTIMEOUT11853.30 s25478.50 sTIMEOUTTIMEOUT18665.90 s18.00
SPTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUTTIMEOUT
ML978.86 s1300.05 s158.40 s1509.62 s1792.43 s5661.68 s1900.17 s17.00
PK0.59 s0.66 s0.23 s0.33 s0.78 s2.11 s0.78 s2.00
HSPPK_WL38.74 s29.97 s8.76 s11.30 s19.83 s76.69 s30.88 s11.00
HSPPK_SP285.63 s137.62 s188.33 s25.21 s31.37 s121.37 s103.26 s13.33
GH178.47 s322.97 s99.82 s132.87 s365.25 s791.82 s315.20 s15.83
NP66.93 s279.77 s44.90 s97.51 s69.69 s240.32 s133.19 s14.50
linearFGW-RAW6.21 s19.98 s6.17 s8.75 s12.91 s76.17 s21.70 s8.67
linearFGW-WL17.00 s20.01 s6.24 s10.22 s8.51 s52.96 s17.49 s8.67
linearFGW-WL26.17 s25.21 s5.21 s11.27 s11.82 s74.40 s22.35 s8.50
WL (disc.)0.14 s0.25 s0.05 s0.12 s0.13 s0.34 s0.17 s1.00
WLOA0.96 s5.08 s0.95 s1.37 s3.32 s8.19 s3.31 s4.17
WWLA13.19 s79.33 s11.17 s29.40 s24.10 s90.97 s41.36 s12.00
SWWL3.51 s5.87 s2.74 s3.35 s4.43 s9.91 s4.97 s5.50
NSPDK5.78 s4.26 s3.07 s2.81 s2.24 s3.11 s3.54 s4.33
NSPDK (disc.)5.78 s4.26 s3.07 s2.81 s2.24 s3.11 s3.54 s4.33
MDD-GK43.03 s150.76 s36.84 s51.87 s79.31 s333.70 s115.92 s14.17
NSPPK (ours)11.31 s34.55 s6.09 s6.09 s5.58 s4.72 s11.39 s8.00

Table 18. Runtime (seconds) without node attributes (lower is better).

Large-Scale Experiment: MolPCBA Learning Curves and Efficiency

The Open Graph Benchmark dataset ogbg-molpcba contains 437,929 molecular graphs and 128 binary prediction targets with missing labels (Hu et al., [16]).

Implementation Details for Task 95 Experiments

We evaluate task 95 of ogbg-molpcba, which contains 48,853 positive labels, 260,115 negative labels, and 128,961 missing labels. A balanced cohort of 97,706 graphs is constructed by retaining all positive examples and randomly sampling an equal number of negative examples. Balanced training subsets ranged from 50 to 78,164 examples. The learning-curve results summarize five runs at each of 13 training sizes. We report average precision (AP) and ROC–AUC.

NSPPK Configuration. For all NSPPK experiments we fixed the parameters across the task:

R=1,D=4,c=1,b=16.R = 1,\quad D = 4,\quad c = 1,\quad b = 16.

Both sparse and dense representations were evaluated. Sparse mode stores only nonzero entries, while dense mode expands the full vectors; their measured training-time differences are reported below.

Downstream Classifiers. The exact settings for the classifier paired with NSPPK features are given in Table 19.

ClassifierFeaturesConfiguration
Logistic RegressionSparsesaga, max_iter=1000, L2L_2, njobs=64n_{\mathrm{jobs}} = 64
Random ForestSparse500 trees, depth=5, njobs=64n_{\mathrm{jobs}} = 64, seed=42
XGBoostDense1000 trees, depth=6, LR=0.03, subsample=0.8, colsample=0.8
XGBoostSparse1000 trees, depth=6, LR=0.03, subsample=0.8, colsample=0.8, hist backend

Table 19. Classifiers used with NSPPK features on ogbg-molpcba (task 95).

End-to-End Efficiency Accounting. Table 20 separates feature construction and vectorization from downstream training on task 95. Values are averaged over training sizes and five random seeds per size. For kernel methods and NSPPK pipelines, extraction denotes separately measured feature construction and vectorization time. For the neural baselines, graph processing is included in training time.

SWWL and NSPDK have lower mean extraction times than sparse NSPPK. Among the NSPPK pairings, sparse random forest has the lowest mean total time (64.4 s), and dense XGBoost has the highest mean test AP (0.755).

Neural Baselines. Table 21 gives the experimental configurations and cites the corresponding methods.

ModelMain hyperparametersMethod reference
PNA2 layers, dim 64→32, batch 64/256, LR=0.001, AdamCorso et al. [7]
PDF (Basis-DGL)8 layers, dim 384, batch 64/256, LR=5e-4, AdamWYang et al. [54]
GAT2 layers, 64→32, 4/1 heads, LR=0.001, AdamVeličković et al. [45]
Attentive FP (FNP)4 layers, dim 64, dropout=0.2, LR=0.001, AdamXiong et al. [50]
GIN2 layers, dim 64→32, LR=0.001, AdamXu et al. [51]
GCN (OGB baseline)2 layers, dim 64→32, LR=0.001, AdamHu et al. [16]
WLIterations = 5Shervashidze et al. [38]
SWWLIterations = 3, Projections = 16, Quantiles = 9Carpintero Perez et al. [4]
NSPDKRadius=1, Distance=4, hash bits bb = 16Costa & De Grave [9]

Table 21. Neural and kernel baseline configurations for task 95.

Training and evaluation splits. The balanced dataset is partitioned using a stratified random split into 78,164 training, 9,771 validation, and 9,771 test graphs. At each training-set size, equal numbers of positive and negative examples are sampled from the training partition.

The neural baselines are trained using binary cross-entropy with logits. Unless otherwise specified, all experiments are conducted on CPUs.

Additional Sensitivity Results

Classifier Sensitivity

We hold the attributed NSPPK representation fixed and vary the downstream classifier. All classifiers use R=1R = 1, D=4D = 4, c=1c = 1, 11 hash bits, and no degree cutoff. XGBoost has the highest mean accuracy across the six datasets, with ExtraTrees and Random Forest within 0.32 percentage points. Logistic regression leads on ENZYMES, and ExtraTrees leads or ties on BZR and SYNTHETICnew (Table 22).

ClassifierENZYMESBZRPROTEINS_fullDHFRSYNTHETICnewCOX2Average
XGBoost51.33 ± 4.3687.43 ± 3.0776.73 ± 3.7283.47 ± 4.0697.67 ± 2.2581.60 ± 4.4879.71
ExtraTrees52.67 ± 6.1087.66 ± 4.1974.13 ± 4.0981.48 ± 3.0099.67 ± 1.0580.94 ± 4.3279.43
Random Forest50.67 ± 7.7986.65 ± 4.3175.84 ± 4.1182.14 ± 3.7599.67 ± 1.0581.38 ± 3.2879.39
Logistic Regression54.83 ± 5.8585.43 ± 3.3771.61 ± 4.4580.42 ± 4.6198.33 ± 2.3681.38 ± 2.5778.67
Linear SVM52.17 ± 7.1285.92 ± 3.3268.55 ± 5.5178.97 ± 5.1498.00 ± 2.8178.18 ± 4.3676.96
Ridge Classifier43.17 ± 6.4080.98 ± 7.6457.14 ± 6.1876.72 ± 3.0996.00 ± 3.4479.23 ± 5.3372.21

Table 22. Classifier sensitivity for the fixed attributed NSPPK representation. All rows use R=1R = 1, D=4D = 4, c=1c = 1, b=11b = 11, and no degree cutoff. Results are mean test accuracy (%) ± standard deviation over stratified 10-fold outer cross-validation.

Hyperparameter Sensitivity

We study how predictive performance varies with the anchor radius RR, maximum pairwise distance DD, and maximum connector radius R′R'. On the COX2 dataset, we perform a stratified 10-fold cross-validation experiment, varying one parameter at a time while keeping the other two fixed at (R,D,c)=(1,4,1)(R,D,c) = (1,4,1), using 11 hash bits and the COX2 degree cutoff τ=3\tau= 3. Table 23 reports the average accuracy and standard deviation. Across all three sweeps, accuracy remains very stable: performance fluctuates by only about 1–2 percentage points across the entire range. Within this COX2 experiment, fine-grained tuning of (R,D,c)(R,D,c) has little effect on mean accuracy.

ValueRadius RRDistance DDConnector cc
081.0±5.081.0 \pm5.0—81.0±5.081.0 \pm5.0
181.0±5.081.0 \pm5.081.0±5.081.0 \pm5.081.0±5.081.0 \pm5.0
280.0±3.080.0 \pm3.080.0±4.080.0 \pm4.079.0±3.079.0 \pm3.0
380.0±5.080.0 \pm5.080.0±5.080.0 \pm5.080.0±3.080.0 \pm3.0
480.0±3.080.0 \pm3.081.0±5.081.0 \pm5.080.0±4.080.0 \pm4.0
580.0±3.080.0 \pm3.080.0±4.080.0 \pm4.079.0±4.079.0 \pm4.0
679.0±3.079.0 \pm3.080.0±4.080.0 \pm4.080.0±4.080.0 \pm4.0

Table 23. Hyperparameter sensitivity for attributed NSPPK on COX2. Each column varies one structural parameter while fixing the others at (R,D,c)=(1,4,1)(R, D, c) = (1, 4, 1), with b=11b = 11 and τ=3\tau= 3. Results are mean test accuracy (%) ±\pm standard deviation over stratified 10-fold cross-validation. The reported distance sweep starts at D=1D = 1.

Density Sensitivity

We generated Erdős–Rényi graphs G(n,q)G(n, q) with n=300n = 300 and q=dˉ/(n−1)q = \bar{d}/(n - 1) for the target mean degree dˉ\bar{d}. All graphs use a single node label and no continuous attributes. Table 24 reports extraction time for R=1R = 1, D=4D = 4, c=1c = 1, and b=11b = 11. Runtime rises from 2.29 seconds at target degree 2 to 429.48 seconds at target degree 277. The increase flattens near the upper end of this fixed-size sweep.

Avg. Deg.Time (s)
22.29
2766.11
52102.40
77150.75
102202.39
127256.25
152308.38
177355.59
202388.98
227412.80
252425.54
277429.48

Table 24. Density sensitivity for NSPPK feature extraction on Erdős–Rényi graphs. All rows use n=300n = 300, R=1R = 1, D=4D = 4, c=1c = 1, and b=11b = 11. Runtime is reported in seconds.

References

  1. [1]Karsten Borgwardt, Elisabetta Ghisu, Felipe Llinares-López, Leslie O’Bray, and Bastian Rieck. Graph kernels: State-of-the-art and future challenges. Foundations and Trends in Machine Learning, 13(5–6):531–712, 2020. doi: 10.1561/2200000076. URL https://doi.org/10.1561/2200000076.
  2. [2]Karsten M. Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In Fifth IEEE International Conference on Data Mining (ICDM), pp. 74–81. IEEE, 2005. doi: 10.1109/ICDM.2005.132. URL https://www.research-collection.ethz.ch/entities/publication/9cc6d253-a45e-4eeb-b552-0f0da1ede570.DOI
  3. [3]Karsten M. Borgwardt, Cheng Soon Ong, Stefan Schönauer, S. V. N. Vishwanathan, Alex J. Smola, and Hans-Peter Kriegel. Protein function prediction via graph kernels. Bioinformatics, 21(Suppl. 1):i47–i56, 2005. doi: 10.1093/bioinformatics/bti1007. URL https://doi.org/10.1093/bioinformatics/bti1007.
  4. [4]Raphaël Carpintero Perez, Sébastien Da Veiga, Josselin Garnier, and Brian Staber. Gaussian process regression with sliced wasserstein weisfeiler–lehman graph kernels. In Proceedings of the International Conference on Artificial Intelligence and Statistics, volume 238 of Proceedings of Machine Learning Research, pp. 1297–1305, 2024. URL https://proceedings.mlr.press/v238/carpintero-perez24a.html.arxiv.org/abs/2402.03838
  5. [5]Chih-Chung Chang and Chih-Jen Lin. Libsvm: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2(3), 2011. doi: 10.1145/1961189.1961199. URL https://doi.org/10.1145/1961189.1961199.
  6. [6]Michael Collins and Nigel Duffy. Convolution kernels for natural language. In Advances in Neural Information Processing Systems, volume 14, pp. 625–632, 2001. URL https://papers.neurips.cc/paper_files/paper/2001/hash/bf424cb7b0dea050a42b9739eb261a3a-Abstract.html.
  7. [7]Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Veličković. Principal neighbourhood aggregation for graph nets. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pp. 13260–13271, 2020. URL https://arxiv.org/abs/2004.05718.
  8. [9]Fabrizio Costa and Kurt De Grave. Fast neighborhood subgraph pairwise distance kernel. In Proceedings of the 27th International Conference on Machine Learning (ICML), pp. 255–262, 2010. URL https://icml.cc/Conferences/2010/papers/347.pdf.
  9. [10]Simon S. Du, Kangcheng Hou, Barnabás Póczos, Ruslan Salakhutdinov, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In Advances in Neural Information Processing Systems (NeurIPS), volume 32, pp. 5723–5733, 2019. URL https://proceedings.neurips.cc/paper_files/paper/2019/hash/663fd3c5144fd10bd5ca6611a9a5b92d-Abstract.html.arxiv.org/abs/1905.13192
  10. [11]Federico Errica, Marco Podda, Davide Bacciu, and Alessio Micheli. A fair comparison of graph neural networks for graph classification. In International Conference on Learning Representations (ICLR), 2020. URL https://openreview.net/forum?id=HygDF6NFPB.arxiv.org/abs/1912.09893
  11. [12]Aasa Feragen, Niklas Kasenburg, Jens Petersen, Marleen de Bruijne, and Karsten Borgwardt. Scalable kernels for graphs with continuous attributes. In Advances in Neural Information Processing Systems, volume 26, 2013. URL https://papers.nips.cc/paper_files/paper/2013/hash/a2557a7b2e94197ff7677970b67041697-Abstract.html.
  12. [13]Thomas Gärtner, Peter Flach, and Stefan Wrobel. On graph kernels: Hardness results and efficient alternatives. In Learning Theory and Kernel Machines, volume 2777 of Lecture Notes in Computer Science, pp. 129–143. Springer, 2003. doi: 10.1007/978-3-540-45167-9_11. URL https://link.springer.com/chapter/10.1007/978-3-540-45167-9_11.
  13. [14]William L. Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, volume 30, pp. 1024–1034, 2017. URL https://arxiv.org/abs/1706.02216.
  14. [15]David Haussler. Convolution kernels on discrete structures. Technical Report UCSC-CRL-99-10, University of California, Santa Cruz, 1999. URL https://bpb-us-e1.wpmucdn.com/sites.ucsc.edu/dist/4/821/files/2018/12/Convolution-Kernels.pdf.
  15. [16]Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In Advances in Neural Information Processing Systems, volume 33, pp. 22118–22131, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/fb60d411a5c5b72b2e7d3527cfc84fd0-Abstract.html.arxiv.org/abs/2005.00687
  16. [17]Hisashi Kashima, Koji Tsuda, and Akihiro Inokuchi. Marginalized kernels between labeled graphs. In International Conference on Machine Learning (ICML), pp. 321–328, 2003. URL https://hkashima.github.io/publication/icml2003.pdf.
  17. [18]Kristian Kersting, Nils M. Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. URL https://chrsmrrs.github.io/datasets/. Dataset collection.
  18. [19]Daisuke Kimura and Hisashi Kashima. Fast computation of subpath kernel for trees. In International Conference on Machine Learning (ICML), 2012. URL https://arxiv.org/abs/1206.4642.
  19. [20]Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017. URL https://openreview.net/forum?id=SJU4ayYgl. arXiv:1609.02907.arxiv.org/abs/1609.02907
  20. [21]Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In International Conference on Learning Representations (ICLR), 2019. URL https://openreview.net/forum?id=H1gL–2A9Ym.
  21. [22]Risi Kondor and Horace Pan. The multiscale laplacian graph kernel. In Advances in Neural Information Processing Systems, volume 29, 2016. URL https://arxiv.org/abs/1603.06186.
  22. [23]Nils Kriege and Petra Mutzel. Subgraph matching kernels for attributed graphs. In International Conference on Machine Learning (ICML), pp. 291–298, 2012. URL https://arxiv.org/abs/1206.6483.
  23. [24]Nils M. Kriege, Pierre-Louis Giscard, and Richard C. Wilson. On valid optimal assignment kernels and applications to graph classification. In Advances in Neural Information Processing Systems, volume 29, 2016. URL https://proceedings.neurips.cc/paper/2016/hash/0efe32849d230d7f53049ddc4a4b0c60–Abstract.html.arxiv.org/abs/1606.01141
  24. [26]Pierre Mahé, Nobuhisa Ueda, Tatsuya Akutsu, Jean-Luc Perret, and Jean-Philippe Vert. Extensions of marginalized graph kernels. In International Conference on Machine Learning (ICML), pp. 552–559, 2004. doi: 10.1145/1015330.1015446. URL https://doi.org/10.1145/1015330.1015446.
  25. [27]Christopher Morris, Nils M. Kriege, Kristian Kersting, and Petra Mutzel. Faster kernels for graphs with continuous attributes via hashing. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pp. 1095–1100. IEEE, 2016. doi: 10.1109/ICDM.2016.0142. URL https://doi.org/10.1109/ICDM.2016.0142.
  26. [28]Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 4602–4609, 2019. doi: 10.1609/aaai.v33i01.33014602. URL https://doi.org/10.1609/aaai.v33i01.33014602.
  27. [29]Christopher Morris, Nils M Kriege, Fabian Bause, Kristian Kersting, Petra Mutzel, and Marion Neumann. Tudataset: A collection of benchmark datasets for learning with graphs. In ICML Workshop on Graph Representation Learning and Beyond (GRL+ 2020), 2020. URL https://arxiv.org/abs/2007.08663.
  28. [30]Nicolò Navarin and Fabrizio Costa. An efficient graph kernel method for non-coding RNA functional prediction. Bioinformatics, 33(17):2642–2650, 2017. doi: 10.1093/bioinformatics/btx295. URL https://doi.org/10.1093/bioinformatics/btx295.
  29. [31]Marion Neumann, Roman Garnett, Christian Bauckhage, and Kristian Kersting. Propagation kernels: Efficient graph kernels from propagated information. Machine Learning, 102(2):209–245, 2016. doi: 10.1007/s10994-015-5517-9. URL https://doi.org/10.1007/s10994-015-5517-9.
  30. [32]M. E. J. Newman. The structure and function of complex networks. SIAM Review, 45(2):167–256, 2003. doi: 10.1137/S003614450342480. URL https://doi.org/10.1137/S003614450342480.
  31. [33]Dai Hai Nguyen and Koji Tsuda. On a linear fused gromov–wasserstein distance for graph structured data. Pattern Recognition, 138:109351, 2023. doi: 10.1016/j.patcog.2023.109351. URL https://www.sciencedirect.com/science/article/pii/S0031320323000523.DOI
  32. [35]Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1:140022, 2014. doi: 10.1038/sdata.2014.22. URL https://doi.org/10.1038/sdata.2014.22.
  33. [36]Asif Salim, S. S. Shiju, and S. Sumitra. Neighborhood preserving kernels for attributed graphs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(1):828–840, 2023. doi: 10.1109/TPAMI.2022.3143806. URL https://doi.org/10.1109/TPAMI.2022.3143806.
  34. [37]Nino Shervashidze, S. V. N. Vishwanathan, Tobias H. Petri, Kurt Mehlhorn, and Karsten M. Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics (AISTATS), volume 5 of Proceedings of Machine Learning Research, pp. 488–495, 2009. URL https://proceedings.mlr.press/v5/shervashidze09a.html.
  35. [38]Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M. Borgwardt. Weisfeiler–lehman graph kernels. Journal of Machine Learning Research, 12:2539–2561, 2011. URL https://jmlr.org/papers/v12/shervashidze11a.html.
  36. [39]Fan-Yun Sun, Jordan Hoffmann, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In International Conference on Learning Representations (ICLR), 2020. URL https://openreview.net/forum?id=r1lfF2NYvH.arxiv.org/abs/1908.01000
  37. [40]Yan Sun and Jicong Fan. MMD graph kernel: Effective metric learning for graphs via maximum mean discrepancy. In International Conference on Learning Representations (ICLR), 2024. URL https://proceedings.iclr.cc/paper_files/paper/2024/hash/5fd68e1c262009f846733435d620d574-Abstract-Conference.html.
  38. [41]Jeffrey J. Sutherland, Lee A. O’Brien, and Donald F. Weaver. Spline-fitting with a genetic algorithm: A method for developing classification structure–activity relationships. Journal of Chemical Information and Computer Sciences, 43(6):1906–1915, 2003. doi: 10.1021/ci034143r. URL https://doi.org/10.1021/ci034143r.
  39. [43]Matteo Togninalli, Elisabetta Ghisu, Felipe Llinares-López, Bastian Rieck, and Karsten Borgwardt. Wasserstein weisfeiler-lehman graph kernels. In Advances in Neural Information Processing Systems (NeurIPS), volume 32, 2019. URL https://arxiv.org/abs/1906.01277.
  40. [44]Titouan Vayer, Laetitia Chapel, Rémi Flamary, Romain Tavenard, and Nicolas Courty. Optimal transport for structured data with application on graphs. In International Conference on Machine Learning (ICML), pp. 6275–6284, 2019. URL https://proceedings.mlr.press/v97/titouan19a.html.arxiv.org/abs/1805.09114
  41. [45]Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In ICLR, 2018. URL https://openreview.net/forum?id=rJXMpikCZ.arxiv.org/abs/1710.10903
  42. [46]S. V. N. Vishwanathan and Alexander J. Smola. Fast kernels for string and tree matching. In Advances in Neural Information Processing Systems, volume 15, pp. 585–592, 2002. URL https://proceedings.neurips.cc/paper/2002/hash/743394beff4b1282ba735e5e3723ed74-Abstract.html.
  43. [47]S. V. N. Vishwanathan, Nicol N. Schra udolph, Risi Kondor, and Karsten M. Borgwardt. Graph kernels. Journal of Machine Learning Research, 11:1201–1242, 2010. URL https://jmlr.org/papers/v11/vishwanathan10a.html.
  44. [48]Felix Wu, Amauri Henrique Souza, Tianyi Zhang, Chris Fifty, Tao Yu, and Kilian Q. Weinberger. Simplifying graph convolutional networks. In International Conference on Machine Learning (ICML), volume 97 of Proceedings of Machine Learning Research, pp. 6861–6871, 2019. URL https://proceedings.mlr.press/v97/wu19e.html.arxiv.org/abs/1902.07153
  45. [49]Wei Wu, Yan Peng, Ling Chen, Xuan Tan, Jiongrui Yang, Zhenzhong Wang, Fangfang Li, and Chuan Luo. Learning-free continuous-attribute graph embedding via locality-sensitive hashing. Knowledge-Based Systems, 349:116482, 2026. doi: 10.1016/j.knosys.2026.116482. URL https://doi.org/10.1016/j.knosys.2026.116482.
  46. [50]Zhaoping Xiong, Dingyan Wang, Xiaohong Liu, Feisheng Zhong, Xiaozhe Wan, Xutong Li, Zhaojun Li, Xiaomin Luo, Kaixian Chen, Hualiang Jiang, and Mingyue Zheng. Pushing the boundaries of molecular representation for drug discovery with the graph attention mechanism. Journal of Medicinal Chemistry, 63(16):8749–8760, 2020. doi: 10.1021/acs.jmedchem.9b00959. URL https://doi.org/10.1021/acs.jmedchem.9b00959.
  47. [51]Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019. URL https://openreview.net/forum?id=ryGs6iA5Km.arxiv.org/abs/1810.00826
  48. [52]Pinar Yanardag and S. V. N. Vishwanathan. Deep graph kernels. In Proceedings of the 21st ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1365–1374, New York, NY, USA, 2015a. ACM. doi: 10.1145/2783258.2783417. URL https://doi.org/10.1145/2783258.2783417.
  49. [53]Pinar Yanardag and S. V. N. Vishwanathan. A structural smoothing framework for robust graph comparison. In Advances in Neural Information Processing Systems, volume 28, pp. 2134–2142, 2015b. URL https://proceedings.neurips.cc/paper_files/paper/2015/hash/7810ccd41bf26faaa2c4e1f20db70a71-Abstract.html.
  50. [54]Mingqi Yang, Wenjie Feng, Yanming Shen, and Bryan Hooi. Towards better graph representation learning with parameterized decomposition & filtering. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 39234–39251, 2023. URL https://proceedings.mlr.press/v202/yang23c.html.arxiv.org/abs/2305.06102
  51. [55]Wei Ye, Wengang Guo, Shuhao Tang, Hao Tian, Xin Sun, Xiaofeng Cao, and Heng Tao Shen. Distributional shortest-path graph kernels. IEEE Transactions on Knowledge and Data Engineering, 37(11):6367–6378, 2025. doi: 10.1109/TKDE.2025.3606566. URL https://doi.org/10.1109/TKDE.2025.3606566.
  52. [56]Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L. Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 974–983, 2018. doi: 10.1145/3219819.3219890. URL https://doi.org/10.1145/3219819.3219890.
  53. [57]Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In Advances in Neural Information Processing Systems (NeurIPS), 2020. URL https://proceedings.neurips.cc/paper/2020/hash/3fe230348e9a12c13120749e3f9fa4cd-Abstract.html.arxiv.org/abs/2010.13902
  54. [58]Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, pp. 4438–4445, 2018. doi: 10.1609/aaai.v32i1.11782. URL https://doi.org/10.1609/aaai.v32i1.11782.

Machine contribution statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How machine contributions are recorded

Paper details

Citation

Cite
Published
Version
Latest

Data & code

Code, data, proofs and workflows the authors linked for testing, review and reproduction. These links are part of this work’s metadata and are released under the same license as the rest of that metadata. Valency doesn’t host the files; each keeps the license set where it’s hosted.

Contents

Pick where to look, or just type