---
title: Similarity Connection Graph Overview
url: https://www.emergentmind.com/topics/similarity-connection-graph
type: topic
---

# Similarity Connection Graph Overview

Similarity connection graph denotes a graph or graph-derived structure in which connectivity is used to encode similarity. Across the literature, the underlying objects vary: vertices may be datapoints in nearest-neighbor search, samples inducing a graph of neural representations, nodes or edges inside a structured object, or whole graphs compared through affinity, alignment, or learned correspondence. The common objective is to transform similarity into a connection pattern that preserves structural information more faithfully than raw overlap counts or isolated embeddings [1304.4657][2205.15083][2111.11165].

## 1. Conceptual scope and semantic variants

In nearest-neighbor search, a similarity graph is a directed graph whose vertices are datapoints from a database and whose edges represent neighbor relations used for greedy or beam-style traversal at query time [1911.12122]. In this setting, the graph is an index structure: search quality depends on how well the edge set preserves navigable proximity.

In graph comparison, the connection graph may instead be implicit in a similarity function between two graphs. DeltaCon considers two graphs \(G_1(V,E_1)\) and \(G_2(V,E_2)\) on the same node set and measures how similarly information propagates through their connectivity, thereby defining similarity through node-to-node affinities rather than direct edge overlap [1304.4657]. Approximate-isomorphism formulations treat similarity as the minimum discrepancy between adjacency matrices under vertex permutation, again making correspondence structure central [1802.08509].

In neural representation analysis, Graph-Based Similarity constructs an explicit weighted undirected graph \(\mathcal{G}_i=(\mathcal{V},\mathcal{E})\) for each layer, where each node corresponds to an input sample and each edge weight is the cosine similarity between two samples’ hidden-layer features [2111.11165]. The similarity connection graph is therefore not the original data graph but a representation graph induced by a model.

A further usage appears in relation-aware and graph-matching systems. The edge-similarity-aware GNN uses the isostericity matrix as a guiding “meta-graph” over edge types, while SEGMN constructs an assignment graph whose nodes are cross-graph node pairs and whose edges encode simultaneous adjacency in both input graphs [2109.09432][2411.03624]. This suggests that “similarity connection graph” is best understood as a family of constructions rather than a single canonical object.

## 2. Formal similarity functions, distances, and invariances

A central formalization is approximate graph isomorphism via Frobenius mismatch. For graphs \(G\) and \(H\) of the same order,
$$
\mathrm{dist}(G,H):=\min_{\pi}\|A_G^\pi-A_H\|_F,
$$
where \(A_G^\pi\) is the adjacency matrix of \(G\) after permutation \(\pi\) and \(\|\cdot\|_F\) is the Frobenius norm [1802.08509]. For simple graphs, \(\mathrm{dist}(G,H)^2\) equals twice the number of edge mismatches in the best alignment.

The matrix-norm framework generalizes this idea by defining
$$
\text{dist}_{\| \cdot \|}(G, H) = \min_{\pi} \|A_G^\pi - A_H\|,
$$
with different norms emphasizing different aspects of mismatch. Entrywise norms such as the Frobenius norm capture global disagreement, while operator norms such as the spectral norm and the \(\ell_1/\ell_\infty\) operator norms quantify local worst-case mismatch per vertex [2207.00090].

DeltaCon replaces direct mismatch with affinity comparison. For each graph, it computes
$$
\mathbf{S} = [\mathbf{I} + \epsilon^2 \mathbf{D} - \epsilon \mathbf{A}]^{-1},
$$
then compares the resulting affinity matrices by the Root Euclidean Distance,
$$
d = \sqrt{ \sum_{i=1}^{n} \sum_{j=1}^{n} \left( \sqrt{ S_{1,ij} } - \sqrt{ S_{2,ij} } \right)^2 },
$$
and scales the result into
$$
sim(G_1, G_2) = \frac{1}{1 + d}.
$$
Its design is tied to explicit axioms—Identity, Symmetry, and the Zero Property—and to desirable properties such as Edge Importance, Weight Awareness, Edge Submodularity, and Focus Awareness [1304.4657].

A statistical alternative summarizes each graph by the empirical distribution of all-pairs Jaccard distances
$$
\zeta_{ij} = 1 - \frac{|a_i \cap a_j|}{|a_i \cup a_j|},
$$
then compares graphs through distributional distances such as the Kolmogorov–Smirnov statistic and Wasserstein distance [2206.10074]. This formulation aims to detect similarity in connectivity structure rather than in graph size, degree counts, or density.

For learned representation graphs, Graph-Based Similarity defines layer similarity as
$$
s_{ij} = \frac{1}{N} \sum_{k=1}^{N} \frac{a_{i,k} \cdot a_{j,k}}{\|a_{i,k}\|_2 \cdot \|a_{j,k}\|_2},
$$
where \(a_{i,k}\) is the \(k\)-th adjacency row of the graph induced by layer \(i\) [2111.11165]. The method is proved invariant to orthogonal transformation and isotropic scaling, but not invariant to general invertible linear transformation.

## 3. Construction mechanisms: affinity, diffusion, optimization, and induction

Similarity connection graphs are constructed by markedly different mechanisms. One line computes affinities analytically; another diffuses similarity recursively; a third learns adjacency by direct optimization; a fourth induces a graph from non-graph representations.

Dynamic Structural Similarity defines a recursive edge-centered similarity for an undirected, unweighted graph:
$$
DSS_{t+1}(u, v) = \frac{\displaystyle\sum_{x \in N[u] \cap N[v]} (DSS_t(u, x) + DSS_t(v, x))}{\sqrt{\left(\sum_{x \in N(u)} DSS_t(u, x)\right) \cdot \left(\sum_{y \in N(v)} DSS_t(v, y)\right)}},
$$
with initialization \(DSS_0(u,v)=1\) on edges and \(0\) otherwise [1805.01419]. The update is performed only for connected pairs, yielding an edge-weighted similarity structure that captures information beyond the immediate neighborhood.

The reinforcement-learning formulation treats the adjacency matrix itself as the optimization target. Each candidate edge is modeled as an independent Bernoulli random variable \(b_i \sim Bern(p_i)\), giving
$$
P(G)=\prod_i p_i^{b_i}(1-p_i)^{1-b_i},
$$
and the objective is
$$
P^*(G) = \arg\max_{P(G)} \mathbb{E}_{q \sim p(q)} \mathbb{E}_{G \sim P(G)} [R(G, q)].
$$
The reward
$$
R(T) = I[\mathcal{T}] \cdot \max(\text{DCS}_\text{max} - \text{DCS}, 1)
$$
explicitly trades recall against distance computations, and the final deterministic graph is obtained by thresholding learned probabilities at \(0.5\) [1911.12122].

A different construction embeds a graph into a fixed-dimensional covariance space. For adjacency matrix \(A\), the representation \(C^A\) is the sample covariance matrix of normalized power-iteration vectors \(A^i e\), and the similarity between two graphs is the Bhattacharya similarity between \(C^A\) and \(C^B\) [1404.4644]. This representation is symmetric positive semidefinite and a graph invariant.

| Paradigm | Core construction | Representative source |
|---|---|---|
| Affinity comparison | Node-pair or node-group influence matrix | DeltaCon [1304.4657] |
| Dynamic diffusion | Fixed-point updates over connected pairs | DSS [1805.01419] |
| Adjacency optimization | Bernoulli edge probabilities learned by RL | NNS graph refinement [1911.12122] |
| Induced representation graph | Samples as nodes, cosine similarities as edges | GBS [2111.11165] |
| Covariance embedding | Graph mapped to \(C^A\), then compared | Covariance space [1404.4644] |

These mechanisms differ in whether similarity is treated as an intrinsic property of a given graph, a relation between two graphs, or a learnable index structure optimized for a downstream task.

## 4. Neural architectures for graph–graph similarity learning

Neural graph similarity learning shifted the focus from explicit combinatorial matching to end-to-end learned correspondence. Early convolutional set-matching methods generate node embeddings with GCNs, compute node-node similarity matrices
$$
\mathbf{S} = \mathrm{RES}_M(\widetilde{\mathbf{H}_1} \widetilde{\mathbf{H}_2}^{T}),
$$
and treat these matrices as images processed by CNNs. GraphSim emphasizes direct matching between sets of node embeddings rather than fixed-dimensional graph embeddings, while GSimCNN adopts the same general strategy for predicting normalized GED-derived similarity scores [1809.04440][1810.10866].

Hierarchical and partition-based models address graph size. HGMN organizes each graph into successively more compact graphs by hierarchical clustering, aligns nodes at each stage with earth mover distance, forms correlation matrices
$$
\mathbf{C} = \mathbf{H}_1 \mathbf{H}_2^{\top},
$$
and feeds the multi-stage matrices to a CNN [2006.16551]. PSimGNN partitions each graph into subgraphs, computes coarse-grained subgraph similarities and fine-grained node-level comparisons on selected subgraph pairs, then integrates both levels into a final score [2005.08008]. CoSimGNN further introduces the “embedding-coarsening-matching” framework, performing adaptive pooling before fine-grained inter-graph attention on coarsened graphs [2005.07115].

Interaction-centric models make cross-graph structure explicit. MGMN combines a node-graph matching network with a siamese GNN so that each node attends to the other whole graph while graph-level interaction is learned in parallel [2007.04395]. CGMN is self-supervised: it generates two augmented views for each graph, applies cross-view interaction to strengthen consistency of node representations across views, applies cross-graph interaction to identify node differences between different graphs, pools node features, and computes graph similarity via an MLP or cosine similarity [2205.15083].

Recent methods strengthen structural bias further. SEGMN produces dual embeddings by concatenating node features with aggregated adjacent-edge representations and then rectifies cross-graph node-pair similarity through assignment graph convolution [2411.03624]. Graph fusion merges the node sequences of two graphs into a single fused graph, applies global attention by Transformer or Performer, splits the result back, and computes node-level and graph-level similarities from the jointly encoded representations [2502.18291]. For heterogeneous graphs, HeGMN uses a heterogeneous graph isomorphism network and restricts both graph-level and node-level matching to type-aligned comparisons, thereby reducing noise interference and computational overhead [2503.08739].

## 5. Representation-level, edge-type, and assignment similarity structures

Some similarity connection graphs are not built to compare two original graphs directly, but to impose relational structure on representations or relation types.

Graph-Based Similarity constructs a graph from hidden-layer outputs by setting
$$
e_{nm} = \frac{F_{i|n} \cdot F_{i|m}^T}{\| F_{i|n} \|_2 \cdot \| F_{i|m} \|_2},
$$
optionally retaining only the top \(k\) most similar neighbors for each node [2111.11165]. Because the graph is explicit, the method supports motif analysis; the reported triangle motif ratio is higher in deeper layers, linking clustering in representation space to functional behavior such as classification and stitching.

Edge-similarity-aware GNNs operate at the level of relation types. Standard relational message passing uses a matrix \(W_r\) per relation \(r\), but the proposed layer constrains transformed messages so that similar edge types induce similar messages. With a shared propagation matrix \(W\), the difference reduces to
$$
\| \alpha_{r_1} W h_u - \alpha_{r_2} W h_u \|
= |\alpha_{r_1} - \alpha_{r_2}| \cdot \|W h_u\|,
$$
and the regularization loss encourages \(|\alpha_{r_1} - \alpha_{r_2}|\) to follow the isostericity prior \(Iso(r_1,r_2)\) [2109.09432]. The multi-head extension is motivated by the observation that the similarity prior may not be representable in one dimension.

Assignment graphs provide a third structure. In SEGMN, each node of the assignment graph is a cross-graph node pair \((v_1^i,v_2^a)\), and an edge is added between \((v_1^i,v_2^a)\) and \((v_1^j,v_2^b)\) if \((v_1^i,v_1^j)\) is an edge in the first graph and \((v_2^a,v_2^b)\) is an edge in the second [2411.03624]. The initial feature of an assignment-graph node is its similarity score, and vanilla GCN propagation on this meta-graph updates each node-pair similarity by aggregating messages from structurally relevant neighboring pairs.

A plausible implication is that similarity connection graphs function at several semantic levels: sample-sample, relation-relation, node-pair–node-pair, and graph-graph. Their role is not merely to store similarity values, but to make those values interact through an auxiliary topology.

## 6. Applications, empirical behavior, and computational limits

The application range is broad. Graph similarity learning is described as relevant to visual tracking, graph classification, and collaborative filtering [2205.15083]. DeltaCon was applied to brain connectivity graphs, where pairwise similarity supported clustering of 114 human connectomes into groups corresponding to high and low creativity, and to temporal anomaly detection in the Enron who-emails-whom graph, where sharp drops in similarity matched major known events in the company timeline [1304.4657]. In neural interpretability, Graph-Based Similarity identifies corresponding layers across models and reveals divergent hidden-layer behavior for adversarial samples [2111.11165]. In RNA 2.5D graphs, edge-similarity-aware message passing was evaluated on protein-binding site prediction, small-molecule binding, and chemical modification prediction [2109.09432].

Empirical results in the neural literature are consistently framed against GED regression, binary similarity detection, or retrieval-style ranking. CGMN reports superiority to state-of-the-art methods on eight real-world datasets and shows that removing either cross-view or cross-graph interaction degrades performance [2205.15083]. HGMN, MGMN, GraphSim, GSimCNN, PSimGNN, CoSimGNN, SEGMN, GFM, and HeGMN are all reported to outperform contemporary baselines on their target benchmarks under metrics such as MSE, AUC, Spearman’s \(\rho\), Kendall’s \(\tau\), or precision at \(k\) [2006.16551][2007.04395][1810.10866][2005.07115][2411.03624][2502.18291][2503.08739]. At the same time, one of the clearest negative results is that incorporating an edge-similarity prior in RNA graphs did not consistently enhance empirical performance, despite its theoretical appeal [2109.09432].

The main limitation is computational hardness. Exact GED and closely related similarity problems are NP-hard, and approximate-isomorphism formulations based on adjacency alignment remain NP-hard even for trees [1802.08509]. The broader family of matrix-norm similarity measures is also NP-hard and strongly inapproximable even for very restricted classes such as bounded-degree trees [2207.00090]. This complexity barrier explains the prevalence of relaxations, learned surrogates, coarsening, hierarchical matching, and task-specific similarity objectives.

Alternative algorithmic routes do exist. The quantum walk inspired algorithm compares unlabeled graphs by the evolution of coined quantum walks with phase-marked reference nodes and has polynomial complexity \(O(n^9)\); it is reported to distinguish strongly regular graphs with the same parameters [1902.11105]. DeltaCon offers linear time and space in the number of edges through node-to-group affinities for large graphs and was demonstrated on graphs with up to 67 million edges [1304.4657]. These results indicate that scalability is achievable when the similarity notion is constrained appropriately, but no single construction resolves the full generality of graph similarity.

In summary, the similarity connection graph is best understood as a structural principle: similarity is encoded as connectivity, then analyzed, optimized, or learned with methods ranging from affinity matrices and fixed-point diffusion to assignment graphs, fused supergraphs, and type-aligned heterogeneous matching. The literature shows both the expressive power of this principle and the persistent tension between structural fidelity, invariance, and computational tractability.

Source: https://www.emergentmind.com/topics/similarity-connection-graph