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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The `ConnectedComponentsFinder` class in C++ is designed to identify and manage connected components within a graph."],["It provides methods to add nodes and edges to the graph, determine if two nodes are connected, and find the total number of connected components."],["Users can also retrieve information such as the size of a connected component containing a specific node and the total number of nodes in the graph."],["The class utilizes efficient algorithms to ensure quick and accurate analysis of graph connectivity."]]],[]]