spanning function
A spanning tree by breadth from node 0, then from the first node of each other part: the parent and depth of every node, and the roots of the parts.
import { spanning } from '@dioramajs/data/graph'.
function spanning(
n: number,
edges: readonly GraphEdge[],
): { depth: Int32Array; parent: Int32Array; roots: number[] }Parameters
| Name | Type | Description |
|---|---|---|
n | number | |
edges | readonly GraphEdge[] |
Defined in packages/data/src/graph.ts.