UNPKG

graph-builder

Version:

A graph builder library for modeling abstract graph structures.

25 lines (24 loc) 1.21 kB
import { ForwardingGraph } from "./ForwardingGraph"; import { MutableGraph } from "./MutableGraph"; import { AbstractGraphBuilder } from "./AbstractGraphBuilder"; import { BaseGraph } from "./BaseGraph"; import { EndpointPair } from "./EndpointPair"; /** * Configurable implementation of {@link MutableGraph} that supports both directed and undirected * graphs. Instances of this class should be constructed with {@link GraphBuilder}. * * <p>Time complexities for mutation methods are all O(1) except for `removeNode(N node)`, * which is in O(d_node) where d_node is the degree of `node`. */ export declare class ConfigurableMutableGraph<N> extends ForwardingGraph<N> implements MutableGraph<N> { private backingValueGraph; /** Constructs a {@link MutableGraph} with the properties specified in `builder`. */ constructor(builder: AbstractGraphBuilder<N>); protected delegate(): BaseGraph<N>; addNode(node: N): boolean; putEdge(nodeU: N, nodeV: N): boolean; putEdgeConnectingEndpoints(endpoints: EndpointPair<N>): boolean; removeNode(node: N): boolean; removeEdge(nodeU: N, nodeV: N): boolean; removeEdgeConnectingEndpoints(endpoints: EndpointPair<N>): boolean; }