Pairwise k-Medoids Projection
Partitions arbitrary S(a, b) ∈ [0, 1] similarity kernels via PAM k-Medoids and QAP mesh embedding.
- Stage 02: Clustering & Projection
- Built-In Preset
- 2 min read
- requiresTags: false
- Updated 2026-11-16
Key Takeaways
- Use when items have neither tags nor fixed-length vectors—only a pairwise similarity function S(a, b) ∈ [0, 1].
- Ideal for string edit distances, Gower trait kernels, AST/graph kernels, SQL join overlap, or biological sequence alignment.
Visual Mechanism
Factory Signature
@simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 02 Overview →createSimilarityClusteringStrategy<TItem, TTagMeta>(options: SimilarityClusteringOptions<TItem>): SimplexClusteringStrategy<TItem, TTagMeta>Options & Defaults
(a: TItem, b: TItem) => number
Symmetric domain similarity score clamped to [0, 1].
readonly SubspaceZoomFeature<TItem>[] | undefined
Optional boolean, categorical, or numeric domain traits used to synthesize base-rate-aware, collision-free defaultLabels across all K medoid clusters.
number | undefined
Preferred number of medoids K.
'simplex-projection' | 'top-1'
Barycentric weighting across adjacent medoids on the planar mesh.
number
Number of top medoid/member items retained for cluster labeling.
Partitioning Around Medoids (PAM) on 60° Meshes
Pairwise k-Medoids Projection builds the symmetric N × N similarity matrix, selects K real domain items as cluster medoids via deterministic farthest-first initialization plus PAM swap refinement, embeds inter-medoid similarity onto the 60° mesh via QAP annealing, and projects every item onto its closest planar medoid triangle. Supplying features (or deriveLabel) turns medoid neighborhoods into concise, pairwise-distinct taxonomic or domain badges rather than raw exemplar IDs.
Usage Example
import {
SimplexTopicGraph,
createSimilarityClusteringStrategy,
} from '@simplex-viz/react';
const kernelClustering = createSimilarityClusteringStrategy<Protein>({
getSimilarity: (a, b) => computeBlastAlignmentScore(a, b),
clusterCount: 6,
});
<SimplexTopicGraph items={proteins} clusteringStrategy={kernelClustering} />;