import { Graph } from '../graph/graph'; import { LabelPropagationResult } from '../types/clustering-types'; import { Edge, Node } from '../types/graph'; import { WeightFunction } from '../types/weight-function'; /** * Label Propagation clustering algorithm. * * Fast semi-supervised clustering algorithm that propagates labels through * the network based on neighbor voting. Nodes iteratively adopt the most * frequent label among their neighbors. * @template N - Node type * @template E - Edge type * @param graph - Input graph (directed or undirected) * @param options - Optional configuration * @param options.weightFn - Weight function for edges (default: all edges weight 1.0) * @param options.maxIterations - Maximum iterations (default: 100) * @param options.seed - Random seed for reproducibility (default: Date.now()) * @returns Result containing clusters or error * @example * ```typescript * const graph = new Graph(true); * // ... add nodes and edges ... * * const result = labelPropagation(graph); * if (result.ok) { * console.log(`Found ${result.value.clusters.length} clusters`); * console.log(`Converged: ${result.value.metadata.converged}`); * console.log(`Iterations: ${result.value.metadata.iterations}`); * } * ``` */ export declare const labelPropagation: (graph: Graph, options?: { weightFn?: WeightFunction; maxIterations?: number; seed?: number; }) => LabelPropagationResult; //# sourceMappingURL=label-propagation.d.ts.map