C++ Reference: class DenseConnectedComponentsFinder

This documentation is automatically generated.

A connected components finder that only works on dense ints.
Method
AddEdge

Return type: void

Arguments: int node1, int node2

The main API is the same as ConnectedComponentsFinder (below): see the homonymous functions there.

Connected

Return type: bool

Arguments: int node1, int node2

DenseConnectedComponentsFinder

DenseConnectedComponentsFinder

Arguments: const DenseConnectedComponentsFinder&) = delete; DenseConnectedComponentsFinder& operator=( const DenseConnectedComponentsFinder&) = delete; // The main API is the same as ConnectedComponentsFinder (below

FindRoot

Return type: int

Arguments: int node

Returns the root of the set for the given node. node must be in [0;GetNumberOfNodes()-1]. Non-const because it does path compression internally.

GetComponentIds

Return type: std::vector<int>

Returns the same as GetConnectedComponents().

GetNumberOfComponents

Return type: int

GetNumberOfNodes

Return type: int

GetSize

Return type: int

Arguments: int node

SetNumberOfNodes

Return type: void

Arguments: int num_nodes

Sets the number of nodes in the graph. The graph can only grow: this dies if "num_nodes" is lower or equal to any of the values ever given to AddEdge(), or lower than a previous value given to SetNumberOfNodes(). You need this if there are nodes that don't have any edges.