Adds an edge in the graph. Also adds both endpoint nodes as necessary.
It is not an error to add the same edge twice. Self-edges are OK too.
Returns true if the two nodes are newly connected, and false if they were
already connected.
Arguments: const ConnectedComponentsFinder&) = delete;
ConnectedComponentsFinder& operator=(const ConnectedComponentsFinder&) =
delete;
// Adds a node in the graph. It is OK to add the same node more than
// once; additions after the first have no effect.
void AddNode(T node
Returns the current number of added distinct nodes.
This includes nodes added explicitly via the calls to AddNode() method
and implicitly via the calls to AddEdge() method.
Nodes that were added several times only count once.
Finds the connected component containing a node, and returns the
total number of nodes in that component. Returns zero iff the
node has not been already added with AddNode.