/** * Structural Representativeness Metrics * * Compares sampled subgraphs against ground truth between-graphs * to measure how well expansion strategies preserve graph structure. */ /** * Result of structural representativeness comparison. */ export interface StructuralRepresentativenessResult { /** Coverage: |Sampled ∩ Ground Truth| / |Ground Truth| */ coverage: number; /** Precision: |Sampled ∩ Ground Truth| / |Sampled| */ precision: number; /** F1 score: 2 * (precision * coverage) / (precision + coverage) */ f1Score: number; /** KL divergence of degree distributions */ degreeKL: number; /** Jensen-Shannon divergence (symmetric) */ degreeJS: number; /** Spearman correlation of betweenness centrality rankings */ betweennessCorrelation: number; /** Fraction of ground truth communities with at least one sampled node */ communityCoverage: number; /** Number of nodes in intersection */ intersectionSize: number; /** Number of nodes in sampled but not in ground truth */ falsePositives: number; /** Number of nodes in ground truth but not in sampled */ falseNegatives: number; } /** * Compute set overlap metrics between sampled and ground truth node sets. * * @param sampledNodes - Nodes discovered by expansion method * @param groundTruthNodes - Nodes in ground truth between-graph * @returns Coverage, precision, and F1 score */ export declare const computeSetOverlap: (sampledNodes: Set, groundTruthNodes: Set) => { coverage: number; precision: number; f1Score: number; intersection: number; }; /** * Compute Spearman rank correlation between two rankings. * * @param ranking1 - First ranking (node ID -> rank) * @param ranking2 - Second ranking (node ID -> rank) * @param commonNodes - Set of nodes to compare (intersection) * @returns Spearman correlation coefficient in [-1, 1] */ export declare const spearmanRankCorrelation: (ranking1: Map, ranking2: Map, commonNodes: Set) => number; /** * Convert degree map to betweenness-like ranking. * * Since computing true betweenness centrality is expensive, * we use degree as a proxy (highly correlated in most networks). * * @param degrees - Map from node ID to degree * @returns Map from node ID to rank (1 = highest degree) */ export declare const degreeToRanking: (degrees: Map) => Map; /** * Compute community coverage. * * @param sampledNodes - Nodes discovered by expansion * @param communities - Array of community node sets * @returns Fraction of communities with at least one sampled node */ export declare const computeCommunityCoverage: (sampledNodes: Set, communities: Array>) => number; /** * Compute comprehensive structural representativeness metrics. * * @param sampledNodes - Nodes discovered by expansion method * @param groundTruthNodes - Nodes in ground truth between-graph * @param sampledDegrees - Degrees of sampled nodes * @param groundTruthDegrees - Degrees of ground truth nodes * @param communities - Optional community partition for coverage metric * @returns Complete representativeness metrics */ export declare const computeStructuralRepresentativeness: (sampledNodes: Set, groundTruthNodes: Set, sampledDegrees: Map, groundTruthDegrees: Map, communities?: Array>) => StructuralRepresentativenessResult; /** * Aggregate representativeness results across multiple seed pairs. * * @param results - Array of individual representativeness results * @returns Averaged metrics */ export declare const aggregateRepresentativenessResults: (results: StructuralRepresentativenessResult[]) => StructuralRepresentativenessResult; //# sourceMappingURL=structural-representativeness.d.ts.map