import { InferredGraphSpec } from './main'; import { AnalyzerGraph } from './types'; export type AnalyzerGraphPredicate = (g: AnalyzerGraph) => boolean; /** * Create a predicate that checks if an axis equals a specific value. * Example: axisEquals("directionality", { kind: "undirected" }) * @param key * @param expected * @param policy */ export declare const axisEquals: (key: K, expected: InferredGraphSpec[K], policy?: Partial) => AnalyzerGraphPredicate; /** * Create a predicate that checks if an axis has a specific kind. * Example: axisKindIs("cycles", "acyclic") * @param key * @param kind * @param policy */ export declare const axisKindIs: (key: K, kind: KK, policy?: Partial) => AnalyzerGraphPredicate; /** * Create a predicate that checks if graph matches a partial GraphSpec. * Only checks the axes specified in the expected partial spec. * @param expected * @param policy */ export declare const hasGraphSpec: (expected: Partial, policy?: Partial) => AnalyzerGraphPredicate; /** * Check if graph is a tree (undirected, acyclic, connected). * * Optimised O(V+E) implementation that avoids computing the full graph spec. * A tree must be: * - All edges undirected * - Simple (no multi-edges) * - No self-loops * - Connected * - Acyclic (for connected undirected graph: E = V - 1) * * @param g - Graph to check * @returns true if graph is a tree */ export declare const isTree: (g: AnalyzerGraph) => boolean; /** * Check if graph is a forest (undirected, acyclic). * * Optimised O(V+E) implementation that avoids computing the full graph spec. * A forest must be: * - All edges undirected * - Simple (no multi-edges) * - No self-loops * - Acyclic (E < V for undirected graph) * * @param g - Graph to check * @returns true if graph is a forest */ export declare const isForest: (g: AnalyzerGraph) => boolean; /** * Check if graph is a DAG (directed, acyclic). * * Optimised O(V+E) implementation that avoids computing the full graph spec. * Uses Kahn's algorithm for cycle detection. * * @param g - Graph to check * @returns true if graph is a DAG */ export declare const isDAG: (g: AnalyzerGraph) => boolean; /** * Check if graph is bipartite. * Uses direct bipartite check instead of full spec computation for performance. * @param g */ export declare const isBipartite: (g: AnalyzerGraph) => boolean; /** * Check if graph is complete. * @param g */ export declare const isComplete: (g: AnalyzerGraph) => boolean; /** * Check if graph is sparse (density <= 10%). * @param g */ export declare const isSparse: (g: AnalyzerGraph) => boolean; /** * Check if graph is dense (density > 75%). * @param g */ export declare const isDense: (g: AnalyzerGraph) => boolean; /** * Check if graph is regular (all vertices have same degree). * @param g */ export declare const isRegular: (g: AnalyzerGraph) => boolean; /** * Check if graph is connected (runtime check for AnalyzerGraph). * Note: Different from graph-spec.isConnected which is a type guard for GraphSpec. * @param g */ export declare const isGraphConnected: (g: AnalyzerGraph) => boolean; /** * Check if graph is Eulerian (all vertices have even degree). * For undirected graphs, this means an Eulerian circuit exists. * For directed graphs, checks if strongly connected with equal in/out degrees. * @param g */ export declare const isEulerian: (g: AnalyzerGraph) => boolean; /** * Check if graph is a star (one central vertex connected to all others). * @param g */ export declare const isStar: (g: AnalyzerGraph) => boolean; /** * Check if graph is planar (can be drawn without edge crossings). * Uses Euler's formula heuristics: E <= 3V - 6 for simple graphs. * For bipartite planar graphs: E <= 2V - 4. * Note: This is a necessary but not sufficient condition. * @param g */ export declare const isPlanar: (g: AnalyzerGraph) => boolean; /** * Check if graph is chordal (every cycle of length >= 4 has a chord). * Equivalent to having a perfect elimination ordering. * Uses Maximum Cardinality Search (MCS) algorithm. * @param g */ export declare const isChordal: (g: AnalyzerGraph) => boolean; /** * Check if graph is an interval graph. * Interval graphs are chordal and can be represented as intersection of intervals. * @param g */ export declare const isInterval: (g: AnalyzerGraph) => boolean; /** * Check if graph is a permutation graph. * Permutation graphs are both comparability graphs and their complements are too. * @param g */ export declare const isPermutation: (g: AnalyzerGraph) => boolean; /** * Check if graph is a unit disk graph. * Requires vertices to have position attributes ({x, y}). * Graph is unit disk if edges exist exactly when distance <= threshold. * @param g */ export declare const isUnitDisk: (g: AnalyzerGraph) => boolean; /** * Check if graph is a comparability graph (has transitive orientation). * Comparability graphs represent partial orders. * @param g */ export declare const isComparability: (g: AnalyzerGraph) => boolean; /** * Check if graph is scale-free (power-law degree distribution). * @param g */ export declare const isScaleFree: (g: AnalyzerGraph) => boolean; /** * Check if graph has small-world property (high clustering + short paths). * @param g */ export declare const isSmallWorld: (g: AnalyzerGraph) => boolean; /** * Check if graph has modular community structure. * @param g */ export declare const isModular: (g: AnalyzerGraph) => boolean; /** * Check if graph is Hamiltonian (has cycle visiting every vertex exactly once). * NP-complete to determine, so this is conservative for graphs with n > 10. * @param g */ export declare const isHamiltonian: (g: AnalyzerGraph) => boolean; /** * Check if graph is traceable (has path visiting every vertex exactly once). * NP-complete to determine, so this is conservative for graphs with n > 10. * @param g */ export declare const isTraceable: (g: AnalyzerGraph) => boolean; /** * Check if graph is perfect (ω(H) = χ(H) for all induced subgraphs H). * Perfect graphs have no odd holes or odd anti-holes. * Uses sufficient conditions: bipartite graphs and chordal graphs are perfect. * @param g */ export declare const isPerfect: (g: AnalyzerGraph) => boolean; /** * Check if graph is a split graph (partition into clique + independent set). * Uses direct computation instead of full spec computation for performance. * @param g */ export declare const isSplit: (g: AnalyzerGraph) => boolean; /** * Check if graph is a cograph (P4-free, no induced path on 4 vertices). * Uses direct computation instead of full spec computation for performance. * @param g */ export declare const isCograph: (g: AnalyzerGraph) => boolean; /** * Check if graph is a threshold graph (both split and cograph). * @param g */ export declare const isThreshold: (g: AnalyzerGraph) => boolean; /** * Check if graph is a line graph (represents edge adjacencies of another graph). * @param g */ export declare const isLineGraph: (g: AnalyzerGraph) => boolean; /** * Check if graph is claw-free (no K1,3 induced subgraph). * @param g */ export declare const isClawFree: (g: AnalyzerGraph) => boolean; /** * Check if graph is cubic (3-regular). * @param g */ export declare const isCubic: (g: AnalyzerGraph) => boolean; /** * Check if graph is k-regular for a specific k. * @param k */ export declare const isKRegular: (k: number) => (g: AnalyzerGraph) => boolean; /** * Check if graph is strongly regular (n,k,λ,μ) parameters. * @param g */ export declare const isStronglyRegular: (g: AnalyzerGraph) => boolean; /** * Check if graph is self-complementary (isomorphic to its complement). * @param g */ export declare const isSelfComplementary: (g: AnalyzerGraph) => boolean; /** * Check if graph is vertex-transitive (all vertices equivalent under automorphisms). * GI-hard to determine, so this is conservative for graphs with n > 6. * @param g */ export declare const isVertexTransitive: (g: AnalyzerGraph) => boolean; /** * Check if graph is complete bipartite K_{m,n}. * @param g */ export declare const isCompleteBipartite: (g: AnalyzerGraph) => boolean; //# sourceMappingURL=predicates.d.ts.map