(
nodeIterable: Graph.NodeWalker<N>
)
| 3248 | |
| 3249 | // Utility function that works with any NodeWalker |
| 3250 | function collectNodes<N>( |
| 3251 | nodeIterable: Graph.NodeWalker<N> |
| 3252 | ): Array<number> { |
| 3253 | return Array.from(Graph.indices(nodeIterable)).sort() |
| 3254 | } |
| 3255 | |
| 3256 | // Both traversal and element iterators implement NodeWalker |
| 3257 | const dfsNodes = Graph.dfs(graph, { start: [0] }) |