Class graph::components

class graphcomponents

Represents a graph as a series of connected components.

The input graph may consist of many components, they will be separated in the construction.

Public Functions

const vector<int> &graph::componentsnodes(int c) const

Get the set of nodes in a component.

int graph::componentssize() const

Get the number of connected components in the graph.

int graph::componentsnum_reserved(int c) const

returns the number of reserved nodes in a component

int graph::componentssize(int c) const

Get the size (in nodes) of a component.

input_graph &graph::componentscomponent_graph(int c)

Get a mutable reference to the graph object of a component.

template <typename T>
bool graph::componentsinto_component(const int c, T &nodes_in, vector<int> &nodes_out) const

translate nodes from the input graph, to their labels in component c

template <typename T>
void graph::componentsfrom_component(const int c, T &nodes_in, vector<int> &nodes_out)

translate nodes from labels in component c, back to their original input labels