Proto<N, E>Common structural interface shared by immutable and mutable graphs.
Details
Contains the node and edge maps, adjacency indexes, allocation counters, and
shared protocols used by both Graph and MutableGraph.
export interface interface Proto<out N, out E>Common structural interface shared by immutable and mutable graphs.
Details
Contains the node and edge maps, adjacency indexes, allocation counters, and
shared protocols used by both Graph and MutableGraph.
Proto<out function (type parameter) N in Proto<out N, out E>N, out function (type parameter) E in Proto<out N, out E>E> extends interface Iterable<T, TReturn = any, TNext = any>Iterable<readonly [type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex, function (type parameter) N in Proto<out N, out E>N]>, import EqualEqual.Equal, Pipeable, Inspectable {
readonly [const TypeId: "~effect/collections/Graph"TypeId]: typeof const TypeId: "~effect/collections/Graph"TypeId
readonly Proto<out N, out E>.nodes: Map<NodeIndex, N>nodes: interface Map<K, V>Map<type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex, function (type parameter) N in Proto<out N, out E>N>
readonly Proto<out N, out E>.edges: Map<EdgeIndex, Edge<E>>edges: interface Map<K, V>Map<type EdgeIndex = numberEdge index for edge identification using plain numbers.
When to use
Use when you need to keep the identifier for a graph edge so you can later
read, update, remove, or compare that edge.
Gotchas
An EdgeIndex is an identifier, not an array offset. Removed edge
identifiers are not reused.
EdgeIndex, class Edge<E>class Edge {
source: number;
target: number;
data: E;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents edge data containing source, target, and user data.
When to use
Use as the graph edge value that carries source node, target node, and stored
edge data together.
Edge<function (type parameter) E in Proto<out N, out E>E>>
readonly Proto<out N, out E>.adjacency: Map<NodeIndex, Array<EdgeIndex>>adjacency: interface Map<K, V>Map<type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex, interface Array<T>Array<type EdgeIndex = numberEdge index for edge identification using plain numbers.
When to use
Use when you need to keep the identifier for a graph edge so you can later
read, update, remove, or compare that edge.
Gotchas
An EdgeIndex is an identifier, not an array offset. Removed edge
identifiers are not reused.
EdgeIndex>>
readonly Proto<out N, out E>.reverseAdjacency: Map<NodeIndex, Array<EdgeIndex>>reverseAdjacency: interface Map<K, V>Map<type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex, interface Array<T>Array<type EdgeIndex = numberEdge index for edge identification using plain numbers.
When to use
Use when you need to keep the identifier for a graph edge so you can later
read, update, remove, or compare that edge.
Gotchas
An EdgeIndex is an identifier, not an array offset. Removed edge
identifiers are not reused.
EdgeIndex>>
Proto<out N, out E>.nextNodeIndex: NodeIndexnextNodeIndex: type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex
Proto<out N, out E>.nextEdgeIndex: EdgeIndexnextEdgeIndex: type EdgeIndex = numberEdge index for edge identification using plain numbers.
When to use
Use when you need to keep the identifier for a graph edge so you can later
read, update, remove, or compare that edge.
Gotchas
An EdgeIndex is an identifier, not an array offset. Removed edge
identifiers are not reused.
EdgeIndex
Proto<out N, out E>.acyclic: Option.Option<boolean>acyclic: import OptionOption.type Option<A> = Option.None<A> | Option.Some<A>The Option data type represents optional values. An Option<A> is either
Some<A>, containing a value of type A, or None, representing absence.
When to use
Use to represent initial values that may not yet exist
- Returning from partial functions (not defined for all inputs)
- Managing optional fields in data structures
Namespace containing utility types for Option.
When to use
Use to access type-level helpers associated with Option.
Option<boolean>
}