incremental.components         package:RBGL         R Documentation

_C_o_m_p_u_t_e _c_o_n_n_e_c_t_e_d _c_o_m_p_o_n_e_n_t_s _f_o_r _a_n _u_n_d_i_r_e_c_t_e_d _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     Compute connected components for an undirected graph

_U_s_a_g_e:

     init.incremental.components(g)
     incremental.components(g)
     same.component(g, node1, node2)

_A_r_g_u_m_e_n_t_s:

       g: an instance of the 'graph' class 

   node1: one vertex of the given graph 

   node2: another vertex of the given graph 

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     Output from 'init.incremental.components' is a list of component
     numbers for each vertex in the graph.

     Output from 'incremental.components' is a list of component
     numbers for each vertex in the graph.

     Output from 'same.component' is true if both nodes are in the same
     connected component, otherwise it's false.

_A_u_t_h_o_r(_s):

     Li Long <li.long@isb-sib.ch>

_R_e_f_e_r_e_n_c_e_s:

     Boost Graph Library by Siek et al.

_S_e_e _A_l_s_o:

     'connComp', 'connectedComp', 'strongComp'

_E_x_a_m_p_l_e_s:

     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)

