UNPKG

@graphty/algorithms

Version:

Graph algorithms library for browser environments implemented in TypeScript

49 lines 1.69 kB
import type { Graph } from "../core/graph.js"; import type { NodeId } from "../types/index.js"; /** * Configuration options for the SynC (Synergistic Deep Graph Clustering) algorithm */ export interface SynCConfig { /** Number of clusters to find */ numClusters: number; /** Maximum number of iterations for convergence */ maxIterations?: number; /** Convergence tolerance */ tolerance?: number; /** Random seed for reproducibility */ seed?: number; /** Learning rate for optimization */ learningRate?: number; /** Regularization parameter */ lambda?: number; } /** * Result of the SynC clustering algorithm */ export interface SynCResult { /** Cluster assignments for each node */ clusters: Map<NodeId, number>; /** Final loss value */ loss: number; /** Number of iterations performed */ iterations: number; /** Node embeddings learned by the algorithm */ embeddings: Map<NodeId, number[]>; /** Whether the algorithm converged */ converged: boolean; } /** * Synergistic Deep Graph Clustering (SynC) Algorithm * * This algorithm combines representation learning with structure augmentation * for improved clustering performance on graphs. It jointly optimizes node * embeddings and cluster assignments while preserving graph structure. * * Based on: "Synergistic Deep Graph Clustering" (arXiv:2406.15797, June 2024) * * @param graph - Input graph to cluster * @param config - Configuration options * @returns Clustering result with assignments and embeddings */ export declare function syncClustering(graph: Graph, config: SynCConfig): SynCResult; //# sourceMappingURL=sync.d.ts.map