/** * Degree Distribution Metrics * * Compares degree distributions between sampled subgraphs and ground truth graphs. * Used to measure structural representativeness of sampling methods. */ /** * Compute degree distribution as a normalized histogram. * * @param degrees - Array of degree values * @returns Map from degree to probability (sum = 1) */ export declare const computeDegreeDistribution: (degrees: number[]) => Map; /** * Compute KL divergence between two distributions. * * KL(P || Q) = Σ P(x) * log(P(x) / Q(x)) * * Uses Laplace smoothing to handle zero probabilities. * * @param p - True distribution (what we want to approximate) * @param q - Approximate distribution (what we sampled) * @param smoothing - Laplace smoothing constant (default: 1e-10) * @returns KL divergence (non-negative, 0 = identical distributions) */ export declare const klDivergence: (p: Map, q: Map, smoothing?: number) => number; /** * Compute Jensen-Shannon divergence (symmetric version of KL). * * JS(P, Q) = 0.5 * KL(P || M) + 0.5 * KL(Q || M) * where M = 0.5 * (P + Q) * * @param p - First distribution * @param q - Second distribution * @returns JS divergence in [0, log(2)] ≈ [0, 0.693] */ export declare const jsDivergence: (p: Map, q: Map) => number; /** * Compute Earth Mover's Distance (Wasserstein-1) for degree distributions. * * EMD measures the minimum "work" to transform one distribution into another. * For 1D distributions, this equals the integral of the absolute difference * between cumulative distribution functions. * * @param p - First distribution * @param q - Second distribution * @returns EMD (non-negative) */ export declare const earthMoversDistance: (p: Map, q: Map) => number; /** * Degree distribution comparison metrics. */ export interface DegreeDistributionMetrics { /** KL divergence from ground truth to sampled */ klDivergence: number; /** Jensen-Shannon divergence (symmetric) */ jsDivergence: number; /** Earth Mover's Distance */ emd: number; /** Mean degree of sampled */ sampledMeanDegree: number; /** Mean degree of ground truth */ groundTruthMeanDegree: number; /** Standard deviation of sampled degrees */ sampledStdDegree: number; /** Standard deviation of ground truth degrees */ groundTruthStdDegree: number; /** Max degree in sampled */ sampledMaxDegree: number; /** Max degree in ground truth */ groundTruthMaxDegree: number; } /** * Compute comprehensive degree distribution comparison metrics. * * @param sampledDegrees - Degree values from sampled subgraph * @param groundTruthDegrees - Degree values from ground truth graph * @returns Complete comparison metrics */ export declare const compareDegreeDistributions: (sampledDegrees: number[], groundTruthDegrees: number[]) => DegreeDistributionMetrics; /** * Compute degree distribution from a graph's node degrees. * * @param nodeDegrees - Map from node ID to degree * @returns Normalized degree distribution */ export declare const degreeDistributionFromMap: (nodeDegrees: Map) => Map; /** * Compute degree histogram bucket counts (for visualization). * * @param degrees - Array of degree values * @returns Map from bucket label to count */ export declare const computeDegreeHistogram: (degrees: number[]) => Map; //# sourceMappingURL=degree-distribution.d.ts.map