/** * Dependency Graph Analysis (Phase 4.2 of #90) * * Provides: * - Connection strength analysis between resources * - Cluster quality scoring (cohesion vs coupling) * - Strongly-connected component detection (Tarjan's algorithm) * * Used by clustering.ts to make smart grouping decisions. */ import type { DependencyGraph } from './graph.js'; /** * Connectivity strength between two resources. * Higher score = more reasons to keep together. */ export interface ConnectionStrength { source: string; target: string; /** Number of different dependency edges (Ref + GetAtt + DependsOn) */ edgeCount: number; /** Bidirectional dependencies are stronger */ isBidirectional: boolean; /** Shared condition usage */ sharedConditions: string[]; /** Overall strength score (0-100) */ score: number; } /** * Metrics for evaluating cluster quality. */ export interface ClusterScore { clusterId: string; /** Intra-cluster connections (higher is better) */ cohesion: number; /** Cross-cluster connections (lower is better) */ coupling: number; /** Resource count and % of limit */ size: number; sizePercent: number; /** Overall quality score (cohesion - coupling, normalized) */ quality: number; } /** * A strongly-connected component in the graph. */ export interface StrongComponent { resourceIds: string[]; /** True if component forms a dependency cycle */ isCyclic: boolean; } /** * Compute connection strength between all resource pairs. */ export declare function analyzeConnectivity(graph: DependencyGraph): Map; /** * Score a cluster's quality based on internal/external dependencies. */ export declare function scoreCluster(clusterId: string, resourceIds: string[], graph: DependencyGraph, allClusters: Map): ClusterScore; /** * Find strongly-connected components (Tarjan's algorithm). * Resources in cyclic components must stay in same stack. */ export declare function detectStronglyConnectedComponents(graph: DependencyGraph): StrongComponent[]; //# sourceMappingURL=analysis.d.ts.map