import { Graph } from '../graph/graph'; import { Edge, Node } from '../types/graph'; /** * Calculate conductance for a cluster/community. * * Conductance formula: * φ(S) = |cut(S)| / min(vol(S), vol(V\S)) * * Where: * - cut(S) = number of edges crossing the boundary of S * - vol(S) = sum of degrees of nodes in S * - V\S = complement of S (nodes not in S) * * Range: [0.0, 1.0] * - Lower values indicate better cluster quality (fewer boundary edges) * - φ < 0.1 typically indicates strong cluster cohesion * - φ > 0.5 indicates weak cluster structure * @template N - Node type * @template E - Edge type * @param graph - Input graph * @param clusterNodes - Set of nodes in the cluster * @returns Conductance score in range [0.0, 1.0] * @example * ```typescript * const graph = new Graph(false); * // ... build graph ... * const cluster = new Set(['A', 'B', 'C']); * const conductance = calculateConductance(graph, cluster); * console.log(`Conductance: ${conductance.toFixed(3)}`); // e.g., "Conductance: 0.125" * ``` */ export declare const calculateConductance: (graph: Graph, clusterNodes: Set) => number; /** * Calculate average conductance across multiple clusters. * @template N - Node type * @template E - Edge type * @param graph - Input graph * @param clusters - Array of node sets representing clusters * @returns Average conductance score * @example * ```typescript * const clusters = [ * new Set(['A', 'B', 'C']), * new Set(['D', 'E', 'F']), * new Set(['G', 'H', 'I']) * ]; * const avgConductance = calculateAverageConductance(graph, clusters); * ``` */ export declare const calculateAverageConductance: (graph: Graph, clusters: Set[]) => number; /** * Calculate weighted average conductance (weighted by cluster size). * * Larger clusters have more influence on the average. * @template N - Node type * @template E - Edge type * @param graph - Input graph * @param clusters - Array of node sets representing clusters * @returns Weighted average conductance score * @example * ```typescript * const clusters = [ * new Set(['A', 'B', 'C']), // size 3 * new Set(['D', 'E']), // size 2 * new Set(['F', 'G', 'H', 'I']) // size 4 * ]; * const weightedAvg = calculateWeightedAverageConductance(graph, clusters); * ``` */ export declare const calculateWeightedAverageConductance: (graph: Graph, clusters: Set[]) => number; //# sourceMappingURL=conductance.d.ts.map