\HeaderA{connectedComp}{Identify Connected Components in an Undirected Graph}{connectedComp}
\keyword{models}{connectedComp}
\begin{Description}\relax
The connected components in
an undirected graph are identified. If the graph is directed then the
weakly connected components are identified.
\end{Description}
\begin{Usage}
\begin{verbatim}
connectedComp(g)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] graph with \code{edgemode} \dQuote{undirected}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Uses a depth first search approach to identifying all the connected
components of an undirected graph. If the input, \code{g}, is a directed
graph it is first transformed to an undirected graph (using
\code{\LinkA{ugraph}{ugraph}}).
\end{Details}
\begin{Value}
A list of length equal to the number of connected components in
\code{g}. Each element of the list contains a vector of the node
labels for the nodes that are connected.
\end{Value}
\begin{Author}\relax
Vince Carey <stvjc@channing.harvard.edu>
\end{Author}
\begin{References}\relax
Boost Graph Library
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{connComp}{connComp}},\code{\LinkA{strongComp}{strongComp}}, \code{\LinkA{ugraph}{ugraph}}, \code{\LinkA{same.component}{same.component}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
km <- fromGXL(file(system.file("GXL/kmstEx.gxl",package="graph"), open="r"))
km <- graph::addNode(c("F","G","H"), km)
km <- addEdge("G", "H", km, 1)
km <- addEdge("H", "G", km, 1)
ukm <- ugraph(km)
ukm
edges(ukm)
connectedComp(ukm)
\end{ExampleCode}
\end{Examples}

