Closed githubuser3141 closed 5 years ago
The algorithm for finding all connected components is straightforward. We perform BFS/DFS search from each node and mark visited nodes with a given label. If node was not labeled after BFS/DFS is completed, it means we found a new component. So we create a new label and keep iterating.
Here is a code with example: https://github.com/anvaka/ngraph.graph/blob/master/examples/findConnectedComponents.js
Thank you very much for this and all your work!
Sorry if this is outside the scope of the project, but could you advise on ways to find groups of linked nodes in the graph? I needed to count their total.
Many thanks