import { Graph } from '../graph/graph'; import { BiconnectedResult } from '../types/clustering-types'; import { Edge, Node } from '../types/graph'; /** * Find biconnected components using Tarjan's algorithm. * * A biconnected component is a maximal subgraph where removing any single node * still leaves the graph connected. Articulation points (cut vertices) are nodes * whose removal increases the number of connected components. * * Use Case: Identify critical papers (articulation points) that connect research communities * in citation networks. Removing these papers would fragment the network. * * Algorithm Steps: * 1. DFS traversal with discovery time tracking * 2. Calculate low-link values (earliest ancestor reachable via back edges) * 3. Detect articulation points: low[child] ≥ disc[v] * 4. Extract components by popping edge stack on backtrack * 5. Handle disconnected graphs (DFS from each unvisited node) * @template N - Node type * @template E - Edge type * @param graph - Undirected graph to analyze * @returns Result containing biconnected components and articulation points, or error * @example * ```typescript * const graph = new Graph(false); // undirected * // ... add nodes and edges ... * * const result = biconnectedComponents(graph); * if (result.ok) { * console.log(`Found ${result.value.articulationPoints.size} articulation points`); * console.log(`Found ${result.value.components.length} biconnected components`); * * result.value.components.forEach(component => { * console.log(`Component ${component.id}: ${component.size} nodes`); * if (component.isBridge) { * console.log(' -> Bridge component'); * } * }); * } * ``` */ export declare const biconnectedComponents: (graph: Graph) => BiconnectedResult; //# sourceMappingURL=biconnected.d.ts.map