networks(deprecated)/components - Maple Help

networks

 components
 find the connected components of a graph

 Calling Sequence components(G) components(G, root=v)

Parameters

 G - graph v - vertex of G

Description

 • Important: The networks package has been deprecated.  Use the superseding command GraphTheory[ConnectedComponents] instead.
 • The components of the graph G are returned as a set of sets.  The number of sets indicates the number of components while the elements of the sets indicate the vertices belonging to each component.
 • If a second argument of the form root=v is given, then only the single component containing the vertex v is constructed.
 • A set of subgraphs corresponding to each component can be constructed by mapping induce() onto the set of components.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[components](...).

Examples

Important: The networks package has been deprecated.  Use the superseding command GraphTheory[ConnectedComponents] instead.

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{random}\left(12,6\right):$
 > $\mathrm{ends}\left(G\right)$
 $\left\{\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{10}\right\}{,}\left\{{2}{,}{12}\right\}{,}\left\{{3}{,}{8}\right\}{,}\left\{{4}{,}{6}\right\}{,}\left\{{6}{,}{8}\right\}\right\}$ (1)
 > $\mathrm{components}\left(G\right)$
 $\left\{\left\{{1}\right\}{,}\left\{{5}\right\}{,}\left\{{7}\right\}{,}\left\{{9}\right\}{,}\left\{{11}\right\}{,}\left\{{2}{,}{3}{,}{4}{,}{6}{,}{8}{,}{10}{,}{12}\right\}\right\}$ (2)
 > $\mathrm{components}\left(G,\mathrm{root}=5\right)$
 $\left\{{5}\right\}$ (3)