DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

comps(C++)


comps -- find connected components in a Graph

Synopsis

   #define Graph_algdeclare(G,V,E)... 
   #define Graph_algimplement(G,V,E)... 
   Expanding Graph_algdeclare(G,V,E) produces the following text:
       Set<G> strong_conn_comps(const G& g);
       Set<G> conn_comps_u(const G& g);

Description

A connected component is a Graph having the property that each Vertex is reachable from every other Vertex by following some path (sequence of Edges). If the Graph is being treated as undirected, Edge directionality is ignored in finding paths; if the Graph is being treated as directed, then Edge directionality is treated as significant in finding paths. By the above definition, every Graph (whether directed or undirected) consists of one or more components.

These functions take a Graph g and find its connected components. As usual, functions with the _u suffix treat the Graph as undirected, while functions without the suffix treat the Graph as directed.

Complexity

O(max(v,e)), where v is the number of Vertices and e is the number of Edges in the Graph.

References

Graph_alg(C++), Set(C++)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005