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)

