/** * Topology Analyzer * ADR-031: Strange Loop Self-Awareness * * Analyzes swarm topology to compute connectivity metrics, * find bottlenecks, and detect structural vulnerabilities. */ import type { SwarmTopology, ConnectivityMetrics, BottleneckAnalysis } from './types.js'; /** * Analyzes swarm topology for connectivity metrics and bottlenecks */ export declare class TopologyAnalyzer { /** * Analyze connectivity of the swarm topology */ analyzeConnectivity(topology: SwarmTopology): ConnectivityMetrics; /** * Perform detailed bottleneck analysis */ analyzeBottlenecks(topology: SwarmTopology): BottleneckAnalysis; /** * Build an adjacency graph from topology */ private buildGraph; /** * Remove a node from the graph (returns a new graph) */ private removeNode; /** * Count connected components using DFS */ private countConnectedComponents; /** * Depth-first search traversal */ private dfs; /** * Calculate minimum cut (vertex connectivity approximation) * For simplicity, we use the minimum degree as a lower bound */ private calculateMinCut; /** * Find articulation points (cut vertices) using Tarjan's algorithm */ private findArticulationPoints; /** * Calculate average shortest path length using BFS */ private calculateAveragePathLength; /** * BFS to find shortest distances from a source node */ private bfsDistances; /** * Calculate clustering coefficient (average local clustering) */ private calculateClusteringCoefficient; /** * Calculate graph density */ private calculateDensity; /** * Calculate graph diameter (longest shortest path) */ private calculateDiameter; /** * Calculate criticality of a node based on its removal impact */ private calculateNodeCriticality; /** * Find agents that would be disconnected if a node is removed */ private findAffectedAgents; /** * Suggest mitigation action based on criticality */ private suggestMitigation; /** * Calculate overall health based on bottleneck analysis */ private calculateHealthFromBottlenecks; } /** * Create a topology analyzer instance */ export declare function createTopologyAnalyzer(): TopologyAnalyzer; //# sourceMappingURL=topology-analyzer.d.ts.map