graph-builder
Version:
A graph builder library for modeling abstract graph structures.
29 lines (28 loc) • 1.47 kB
TypeScript
import { ConfigurableValueGraph } from "./ConfigurableValueGraph";
import { MutableValueGraph } from "./MutableValueGraph";
import { EndpointPair } from "./EndpointPair";
import { AbstractGraphBuilder } from "./AbstractGraphBuilder";
/**
* Configurable implementation of {@link MutableValueGraph} that supports both directed and
* undirected graphs. Instances of this class should be constructed with {@link ValueGraphBuilder}.
*
* <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 ConfigurableMutableValueGraph<N, V> extends ConfigurableValueGraph<N, V> implements MutableValueGraph<N, V> {
/** Constructs a graph with the properties specified in `builder`. */
static from<N, V>(builder: AbstractGraphBuilder<N>): ConfigurableMutableValueGraph<N, V>;
addNode(node: N): boolean;
/**
* Adds `node` to the graph and returns the associated {@link GraphConnections}.
*
* throws IllegalStateException if `node` is already present
*/
private addNodeInternal;
putEdgeValue(nodeU: N, nodeV: N, value: V): V | undefined;
putEdgeValueConnectingEndpoints(endpoints: EndpointPair<N>, value: V): V | undefined;
removeNode(node: N): boolean;
removeEdge(nodeU: N, nodeV: N): V | undefined;
removeEdgeConnectingEndpoints(endpoints: EndpointPair<N>): V | undefined;
private newConnections;
}