\HeaderA{incremental.components}{Compute connected components for an undirected graph}{incremental.components}
\aliasA{init.incremental.components}{incremental.components}{init.incremental.components}
\aliasA{same.component}{incremental.components}{same.component}
\keyword{models}{incremental.components}
\begin{Description}\relax
Compute connected components for an undirected graph
\end{Description}
\begin{Usage}
\begin{verbatim}
init.incremental.components(g)
incremental.components(g)
same.component(g, node1, node2)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] an instance of the \code{graph} class 
\item[\code{node1}] one vertex of the given graph 
\item[\code{node2}] another vertex of the given graph 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This family of functions work together to calculate the connected 
components of an undirected graph. The algorithm is based on the 
disjoint-sets.  It works where the graph is growing by adding new edges.
Call "init.incremental.components" to initialize the calculation on a new graph.
Call "incremental.components" to re-calculate connected components after 
growing the graph.  Call "same.component" to learn if two given vertices 
are in the same connected components. 
Currently, the codes can only handle ONE incremental graph at a time.  When you
start working on another graph by calling "init.incremental.components", the
disjoint-sets info on the previous graph is lost. 
See documentation on Incremental Connected Components in Boost Graph Library 
for more details.
\end{Details}
\begin{Value}
Output from \code{init.incremental.components} is a list of component numbers for each vertex in the graph.

Output from \code{incremental.components} is a list of component numbers for each vertex in the graph.

Output from \code{same.component} is true if both nodes are in the same connected component, otherwise it's false.
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{References}\relax
Boost Graph Library by Siek et al.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{connComp}{connComp}}, \code{\LinkA{connectedComp}{connectedComp}}, \code{\LinkA{strongComp}{strongComp}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
coex <- fromGXL(file(system.file("XML/conn2.gxl",package="RBGL"), open="r"))
init.incremental.components(coex)
incremental.components(coex)
v1 <- 1
v2 <- 5
same.component(coex, v1, v2)
\end{ExampleCode}
\end{Examples}

