import { GraphExpander } from '../../interfaces/graph-expander'; /** * Generic expansion result type - compatible with all baseline results. */ export interface ExpansionResult { /** Union of all nodes visited during expansion */ sampledNodes: Set; /** Set of edges visited during expansion */ sampledEdges: Set; } /** * Result from retroactive path enumeration. */ export interface RetroactivePathEnumerationResult { /** All simple paths found between seed pairs */ paths: Array<{ fromSeed: number; toSeed: number; nodes: string[]; }>; /** Statistics about enumeration */ stats: RetroactivePathEnumerationStats; } /** * Statistics collected during retroactive path enumeration. */ export interface RetroactivePathEnumerationStats { /** Total simple paths enumerated */ totalPaths: number; /** Number of seed pairs processed */ seedPairsProcessed: number; /** Average paths per seed pair */ avgPathsPerPair: number; /** Path length distribution */ pathLengthDistribution: Map; } /** * Retroactive Path Enumeration * * Post-processing function that takes ANY expansion result (from BFS, * degree-prioritised, random, etc.) and enumerates ALL simple paths * through the discovered subgraph. * * **Key Properties**: * - Works with any expansion result (union of sampled nodes) * - Uses DFS with backtracking to find all simple paths * - Depth-limited for tractability on large subgraphs * - Pure post-processing (doesn't modify original expansion) * * **Experimental Purpose**: * Disentangles path discovery mechanism from path enumeration completeness. * Tests whether different expansion strategies produce subgraphs with * different path densities or diversity, independent of online path detection. * * **Use Case**: * Compare path diversity across expansion strategies after exhaustive * enumeration. If Strategy A finds more paths than Strategy B retroactively, * A's subgraph is structurally richer (not just faster to converge). * * **Note**: This can be expensive on dense subgraphs. Use maxLength to * control tractability. */ /** * Enumerate all simple paths between seed pairs in a sampled subgraph. * * @param result - Expansion result containing sampledNodes * @param expander - Graph expander providing neighbour access * @param seeds - Array of seed node IDs (N >= 2) * @param maxLength - Maximum path length to explore (default: 20) * @returns Enumeration results including all discovered paths * * @example * ```typescript * // Run standard BFS * const bfsExpansion = new StandardBfsExpansion(expander, seeds); * const bfsResult = await bfsExpansion.run(); * * // Retroactively enumerate all paths through BFS subgraph * const enumResult = await retroactivePathEnumeration( * bfsResult, * expander, * seeds, * 20 * ); * * console.log(`BFS found ${bfsResult.paths.length} paths online`); * console.log(`Retroactive enumeration found ${enumResult.paths.length} paths`); * ``` */ export declare const retroactivePathEnumeration: (result: ExpansionResult, expander: GraphExpander, seeds: readonly string[], maxLength?: number) => Promise; //# sourceMappingURL=retroactive-path-enum.d.ts.map