UNPKG

@graphty/layout

Version:

graph layout algorithms based on networkx

29 lines (28 loc) 873 B
/** * Special graph detection functions for planarity testing */ import { Node, Edge } from '../../types'; /** * Check if graph is K5 (complete graph with 5 nodes) * * @param nodes - List of nodes * @param edges - List of edges * @returns True if graph is K5 */ export declare function isK5(nodes: Node[], edges: Edge[]): boolean; /** * Check if graph is K3,3 (complete bipartite with 3,3 nodes) * * @param nodes - List of nodes * @param edges - List of edges * @returns True if graph is K3,3 */ export declare function isK33(nodes: Node[], edges: Edge[]): boolean; /** * Try to find a bipartite partition of the nodes * * @param nodes - List of nodes * @param edges - List of edges * @returns Array of two partitions, or null if not bipartite */ export declare function tryFindBipartitePartition(nodes: Node[], edges: Edge[]): [Node[], Node[]] | null;