import { ExpansionStats } from '../../algorithms/traversal/degree-prioritised-expansion.js'; import { BfsExpansionStats } from '../baselines/standard-bfs.js'; /** * Hub-avoidance metrics computed from degree distribution. */ export interface HubAvoidanceMetrics { /** Proportion of expanded nodes that are hubs (0-1, lower is better) */ hubTraversalRate: number; /** Distribution of expanded nodes across degree buckets */ degreeDistribution: Map; /** Ratio of peripheral nodes expanded to hub nodes expanded (higher is better) */ peripheralCoverageRatio: number; /** Total nodes expanded */ totalExpanded: number; /** Number of hub nodes expanded (degree >= hubThreshold) */ hubCount: number; /** Number of peripheral nodes expanded (degree <= peripheralThreshold) */ peripheralCount: number; } /** * Compute hub-avoidance metrics from expansion stats. * * The degree distribution map contains bucket counts like: * - "1-5": 150 (peripheral) * - "6-10": 80 (peripheral) * - "11-50": 60 * - "51-100": 30 * - "101-500": 15 (hub) * - "501-1000": 5 (hub) * - "1000+": 2 (hub) * * Hub-avoidance means: * - Low hub traversal rate (fewer nodes from "101-500", "501-1000", "1000+") * - High peripheral coverage ratio (more peripheral nodes relative to hubs) * * @param stats - Expansion stats containing degree distribution * @param hubThreshold - Minimum degree for hub classification (default: 100) * @param peripheralThreshold - Maximum degree for peripheral classification (default: 10) * @returns Hub-avoidance metrics */ export declare const calculateHubAvoidanceMetrics: (stats: BfsExpansionStats | ExpansionStats, hubThreshold?: number, peripheralThreshold?: number) => HubAvoidanceMetrics; /** * Convert hub-avoidance metrics to a plain object for serialisation. * * @param metrics - Hub-avoidance metrics * @returns Plain object with serialisable values */ export declare const hubAvoidanceMetricsToObject: (metrics: HubAvoidanceMetrics) => Record; /** * Format hub-avoidance metrics as percentages for display. * * @param metrics - Hub-avoidance metrics * @returns Object with formatted percentage strings */ export declare const formatHubAvoidanceMetrics: (metrics: HubAvoidanceMetrics) => { hubTraversalRate: string; peripheralCoverageRatio: string; degreeDistribution: Record; }; /** * Compare hub-avoidance metrics between two algorithms. * * Returns which algorithm has better hub avoidance (lower hub traversal). * * @param metrics1 - First algorithm's metrics * @param metrics2 - Second algorithm's metrics * @returns Comparison result */ export interface HubAvoidanceComparison { /** Which metrics have lower hub rate (-1, 0, or 1) */ lowerHubRate: number; /** Difference in hub traversal rate (metrics1 - metrics2) */ hubRateDelta: number; /** Ratio of peripheral coverage (metrics1 / metrics2) */ peripheralRatioDelta: number; /** Whether metrics1 has better hub avoidance overall */ better: boolean; } export declare const compareHubAvoidance: (metrics1: HubAvoidanceMetrics, metrics2: HubAvoidanceMetrics) => HubAvoidanceComparison; /** * Compute hub-avoidance metrics for table rendering. * * This function aggregates degree distribution data into a format * suitable for LaTeX table generation. * * @param statsArray - Array of expansion stats from multiple runs * @param hubThreshold - Hub threshold (default: 100) * @returns Aggregated hub-avoidance metrics */ export interface AggregatedHubAvoidanceMetrics { meanHubTraversalRate: number; meanPeripheralCoverageRatio: number; degreeDistributionPct: Record; totalRuns: number; } export declare const aggregateHubAvoidanceMetrics: (statsArray: Array, hubThreshold?: number) => AggregatedHubAvoidanceMetrics; //# sourceMappingURL=hub-avoidance-calculator.d.ts.map