import { GraphExpander } from '../../interfaces/graph-expander.js'; import { DegreePrioritisedExpansionResult } from './degree-prioritised-expansion.js'; /** * Salience-Prioritised Multi-Seed Graph Expansion * * **Novel Contribution**: Path quality-aware node expansion that prioritizes * nodes based on their participation in high-salience paths, rather than * degree-based prioritization. * * **Key Innovation**: Unlike degree-prioritised expansion (which avoids hubs * by expanding low-degree nodes first), salience-prioritised expansion actively * seeks out nodes that appear in high-quality (high-MI) paths. This should * result in higher salience coverage because the expansion naturally gravitates * toward the same paths that Path Salience ranking identifies as important. * * **Design Relationship**: * - DegreePrioritisedExpansion: Priority = node degree (ascending) * - SaliencePrioritisedExpansion: Priority = node salience score (descending) * * **Priority Function**: * - Primary: Node salience score (higher = better priority) * - Secondary: Node degree (lower = better, for tie-breaking hub avoidance) * * **Expected Behavior**: * - Higher salience coverage than degree-prioritised expansion * - Discovered paths should more closely match Path Salience top-K * - May sacrifice some hub-avoidance for path quality * * @template T - Node data type */ export declare class SaliencePrioritisedExpansion implements GraphExpander { /** Salience scores for each node (pre-computed from Path Salience ranking) */ private readonly nodeSalience; /** The underlying graph expander for neighbor access */ private readonly expander; /** Seed nodes for expansion */ private readonly seeds; /** Frontiers (one per seed) */ private readonly frontiers; /** Statistics collected during expansion */ private stats; /** Discovered paths between seed pairs */ private readonly paths; /** Track which frontier owns each node */ private readonly nodeToFrontierIndex; /** Track which seed pairs have connected */ private readonly connectedPairs; /** Tracks when each node was first discovered (iteration number) */ private readonly nodeDiscoveryIteration; /** * Create a new salience-prioritised expansion. * * @param expander - Underlying graph expander for neighbor access * @param seeds - Array of seed node IDs * @param nodeSalience - Map of node ID to salience score (appearance count in top-K paths) */ constructor(expander: GraphExpander, seeds: string[], nodeSalience: Map); /** * Get neighbors of a node. * @param nodeId */ getNeighbors(nodeId: string): Promise<{ targetId: string; relationshipType: string; }[]>; /** * Get node degree for priority computation. * @param nodeId */ getDegree(nodeId: string): number; /** * Calculate weighted priority (delegates to underlying expander). * @param nodeId */ calculatePriority(nodeId: string): number; /** * Get node data. * @param nodeId */ getNode(nodeId: string): Promise; /** * Add an edge to the output. * @param source * @param target * @param relationshipType */ addEdge(source: string, target: string, relationshipType: string): void; /** * Run the expansion to completion. */ run(): Promise; /** * Check if any frontier has unexpanded nodes. */ private hasNonEmptyFrontier; /** * Select the frontier with the highest-salience node. */ private selectHighestSalienceFrontier; /** * Reconstruct path between two seeds using parent pointers. * @param fromFrontier * @param fromFrontier.index * @param fromFrontier.visited * @param fromFrontier.parents * @param toFrontier * @param toFrontier.index * @param toFrontier.visited * @param toFrontier.parents * @param meetingNode */ private reconstructPath; /** * Record degree in statistics. * @param degree */ private recordDegree; /** * Get degree bucket for statistics. * @param degree */ private getDegreeBucket; } /** * Compute node salience scores from top-K salient paths. * * For each node, counts how many times it appears in the top-K salient paths. * Nodes that appear more frequently in high-quality paths get higher scores. * * @param topKPaths - Array of top-K salient paths (as node ID arrays) * @returns Map of node ID to salience score (appearance count) */ export declare const computeNodeSalienceScores: (topKPaths: string[][]) => Map; /** * Compute node salience scores directly from Path Salience ranking results. * * Extracts node IDs from ranked path objects and computes appearance counts. * * @param rankedPaths - Array of ranked paths from Path Salience algorithm * @returns Map of node ID to salience score */ export declare const computeNodeSalienceFromRankedPaths: (rankedPaths: Array<{ path: { nodes: Array<{ id: string; }>; }; }>) => Map; //# sourceMappingURL=salience-prioritised-expansion.d.ts.map