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
Arguments: const ConnectedComponentsFinder&) = delete;
ConnectedComponentsFinder& operator=(const ConnectedComponentsFinder&) =
// 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.