Defined in: packages/graph/src/graph.ts:85
The options every graph factory accepts, whatever its layout, so
__GRAPH_LAYOUTS[kind](options) constructs any of them.
Properties
Section titled “Properties”vertexCount
Section titled “vertexCount”
readonlyvertexCount:number
Defined in: packages/graph/src/graph.ts:87
Vertices are the integers 0 … vertexCount - 1. For 1-based input, pass n + 1 and leave vertex 0 isolated.
directed
Section titled “directed”
readonlydirected:boolean
Defined in: packages/graph/src/graph.ts:89
Required: guessing it wrong changes every answer.
weighted
Section titled “weighted”
readonlyweighted:boolean
Defined in: packages/graph/src/graph.ts:91
Required: a weighted graph needs a weight on every edge, and an unweighted graph rejects one.
parallelEdges?
Section titled “parallelEdges?”
readonlyoptionalparallelEdges?:boolean
Defined in: packages/graph/src/graph.ts:93
Keep every copy of a repeated edge. Defaults to false, where a repeated edge with the same weight is a no-op.
selfLoops?
Section titled “selfLoops?”
readonlyoptionalselfLoops?:boolean
Defined in: packages/graph/src/graph.ts:95
Allow an edge from a vertex to itself. Defaults to false.
edges?
Section titled “edges?”
readonlyoptionaledges?:GraphEdges|Iterable<GraphEdgeTuple,any,any>
Defined in: packages/graph/src/graph.ts:101
Edges to add, in order, as [from, to] or [from, to, weight] tuples or
as the columns a graph’s edges() returns. On an undirected graph [u, v]
and [v, u] are the same edge.