Partitioning a Force Graph into Connected Components

My program starts by creating a graph (~ 1K-50K vertices), which usually consists of several hundred related components.

The program should be able to manipulate and visualize individual components (using the layout algorithm with power mode).

It would be great (but not necessary) to be able to further split each connected component into connected subcomponents (by removing edges or vertices).

So my question is: can I use subgraph or filter_graph class templates to achieve the required functionality (support a set of component graphs that can be individually manipulated and possibly further subdivided into removing edges / vertices)? Or is there a different, better approach?

I apologize if this question is too simple. I just started to learn BGL and did not like this library. Thanks in advance!

+1
source share
1 answer

Use connected_componentsto assign a unique number to each component, storing it in the property of the nodes. Then you can use this property in the predicate filtered_graphto decide whether this component belongs to the current active chart or not. A vertical predicate would be straightforward, while an edge predicate could just look at any endpoint to make its choice. The number of subgraphs will be stored in the predicate objects themselves.

, . , , , . , , . , , . , incremental_components .

+4

All Articles