AI Glossary / Graphs and symbolic AI / Intermediate

Similarity graph

Definition

A similarity graph represents data items as nodes and selected similarity relationships as edges. An edge indicates that two items meet a chosen similarity rule; its weight may express the strength of that relationship. The graph depends on how items are represented, how similarity is measured, and which connections are retained.

What it means

The word “similar” needs an operational meaning. Documents might be compared using text embeddings, products using selected attributes, and images using learned visual features. Different representations can produce different graphs for exactly the same collection of items.
The graph makes those comparisons available to algorithms that work with relationships, such as clustering or label propagation. It does not establish that linked items are interchangeable or that one caused another. In the common undirected formulation, an edge represents a symmetric relationship. Nearest-neighbor selection can initially be asymmetric, so the rule for converting it into an undirected graph must be stated.

How it works

First choose a feature representation and a similarity or distance measure. Then choose a connection rule. A distance-threshold graph connects items close enough under a specified threshold. A nearest-neighbor graph retains selected neighbors of each item. A fully connected weighted graph retains all pairs and lets weights express relative similarity.
For nearest-neighbor graphs, one undirected rule connects a pair if either item selects the other; a mutual rule requires both selections. These can produce different connectivity. Finally, inspect the graph for isolated nodes, overly broad connections, and sensitivity to feature scaling. Downstream results inherit these construction choices.

Three practical examples

  • A document library can connect articles with similar content representations to support exploratory grouping.
  • A product catalog can link items with comparable attributes, creating candidates for recommendation or manual comparison.
  • A learning exercise can propagate labels across a graph when nearby items are expected to share labels, while checking that this assumption fits the data.

Think of it this way

Think of pinning cards on a board and drawing lines between cards that meet a stated comparison rule. The lines help reveal groups. The analogy is limited because a visual impression of closeness on a board is not the underlying metric, and a graph edge does not explain why the chosen features should matter.

Worked example

Consider an original example with four items represented by one numeric feature: A = 0, B = 1, C = 3, and D = 7. Use absolute distance and connect distinct items when their distance is at most 2.
The six pair distances are AB = 1, AC = 3, AD = 7, BC = 2, BD = 6, and CD = 4. Only AB and BC qualify. The graph has one connected component {A, B, C} and isolated node D. A and C belong to the same component even though their distance of 3 exceeds the direct-edge threshold. Connectivity therefore does not mean that every pair within a component passes the similarity rule.
Now build a one-nearest-neighbor graph on the same values. A selects B, B selects A, C selects B, and D selects C; all selections are unique. Under the either-direction rule, the undirected edges are AB, BC, and CD, so all four items become connected. Under the mutual rule, only AB remains, leaving C and D isolated.
The data and distance measure did not change, but the graph changed substantially. If a clustering result differs between these versions, it may reflect the graph-building rule rather than new evidence about the items themselves.

Illustrative case study

In a fictional case, Quill Archive builds a similarity graph of internal training notes. A dense cluster appears to mix unrelated topics. Editors inspect several edges and discover that a repeated administrative template dominates the text representation.
They revise preprocessing and compare graphs before and after removing the boilerplate from the representation. The underlying documents remain available for human review. The team evaluates whether the revised connections better support its browsing task instead of assuming that a more attractive network diagram is more accurate. This describes an illustrative workflow, not measured organizational gains.

Common misconceptions and mistakes

Similarity is not generally transitive: A resembling B and B resembling C does not require A to resemble C. A connected component is therefore different from a group in which every pair is directly similar.
More edges are not always better. Very dense graphs can blur distinctions, while overly sparse graphs can isolate relevant items. Similarity weights are not automatically probabilities. A score of 0.8 may be useful for ranking without meaning an 80% chance that two records describe the same entity. Labels should not be allowed to leak into evaluation through graph construction.

Business use

For business applications, define what a useful edge means before selecting thresholds or models. Review representative linked pairs, missed pairs, and isolated items with people who understand the collection.
Record the feature pipeline, model version, distance measure, threshold or neighbor count, and symmetrization rule. When a new embedding model is introduced, rebuild or revalidate the relationships rather than assuming that an old threshold retains its meaning. Judge the graph through the browsing, grouping, or learning task it is meant to support.

People also ask

Is a similarity graph always unweighted?

No. Edges can carry similarity strengths as weights.

Does a graph connection prove two records are duplicates?

No. That depends on the comparison rule and additional evidence.

Is it the same as a probabilistic similarity network?

No. That name also refers to a distinct Bayesian-network construction method.

Check your understanding

Why are A and C connected through B but not joined by an edge in the threshold example?

Answer: AB and BC each pass the threshold, while AC does not. A multi-edge path is a different condition from direct similarity.

Related terms

  • Graph clustering
  • Spectral clustering
  • Label Propagation
  • Embedding
  • nearest-neighbour graph
  • distance metric
  • adjacency matrix
  • connected component

Learn next

Raise the distance threshold from 2 to 4. The edges become AB, AC, BC, and CD, and all four nodes are connected. Explain why D's connection to C does not make D directly similar to A under this threshold.

More in Graphs and symbolic AI

  • Shortest Paths - Shortest paths are routes through a graph that minimize a defined total cost between specified nodes.
  • Sideways move - A sideways move is a local-search step from one candidate state to a neighboring state with the same evaluation value.
  • Significance test - A significance test evaluates how compatible observed data are with a specified null hypothesis and statistical model.
  • Similarity networks - In probabilistic AI, similarity networks are collections of local Bayesian networks constructed to distinguish among overlapping subsets of hypotheses.
  • Similarity Search - Similarity search retrieves items that are close to a query under a specified comparison measure.
  • Simple Paths - A simple path is a sequence of connected graph nodes in which no node appears more than once. In a directed graph, each step must follow the edge direction.

Sources

Sources: Jung and colleagues, The Aalto Dictionary of Machine Learning, similarity graph entry: https://aaltodictionaryofml.github.io/ADictML_Main.pdf . Ulrike von Luxburg, A Tutorial on Spectral Clustering, similarity-graph construction: https://www.cs.cmu.edu/~aarti/Class/10701/readings/Luxburg06_TR.pdf .

Previous: Similarity Next: Similarity learning

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer