Interface SimilarityGraph

Represents a compact, fully connected, weighted graph (scores for connections between all nodes) Stores only the upper triangular part of the adjacency matrix to avoid duplication. Built using buildSimilarityGraph

interface SimilarityGraph {
    edgeScores: number[][];
    nodeCount: number;
}

Properties

edgeScores: number[][]

A dense array-based structure storing similarity scores.

  • edgeScores[i][j] contains the similarity score for vectors (i, i + j + 1).
  • Only upper-triangular elements are stored to save space.
nodeCount: number

Number of nodes (vectors) in the graph.