connectedComp              package:RBGL              R Documentation

_I_d_e_n_t_i_f_y _C_o_n_n_e_c_t_e_d _C_o_m_p_o_n_e_n_t_s _i_n _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:

     The connected components in an undirected graph are identified. If
     the graph is directed then the weakly connected components are
     identified.

_U_s_a_g_e:

     connectedComp(g)

_A_r_g_u_m_e_n_t_s:

       g: graph with 'edgemode' "undirected"

_D_e_t_a_i_l_s:

     Uses a depth first search approach to identifying all the
     connected components of an undirected graph. If the input, 'g', is
     a directed graph it is first transformed to an undirected graph
     (using 'ugraph').

_V_a_l_u_e:

     A list of length equal to the number of connected components in
     'g'. Each element of the list contains a vector of the node labels
     for the nodes that are connected.

_A_u_t_h_o_r(_s):

     Vince Carey <stvjc@channing.harvard.edu>

_R_e_f_e_r_e_n_c_e_s:

     Boost Graph Library

_S_e_e _A_l_s_o:

     'connComp','strongComp', 'ugraph', 'same.component'

_E_x_a_m_p_l_e_s:

     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)

