decompose.graph            package:igraph            R Documentation

_D_e_c_o_m_p_o_s_e _a _g_r_a_p_h _i_n_t_o _c_o_m_p_o_n_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Creates a separate graph for each component of a graph.

_U_s_a_g_e:

     decompose.graph(graph, mode = c("weak", "strong"),
            max.comps = NA, min.vertices = 0) 

_A_r_g_u_m_e_n_t_s:

   graph: The original graph.

    mode: Character constant giving the type of the components, wither
          'weak' for weakly connected components or 'strong' for
          strongly connected components.

max.comps: The maximum number of components to return. The first
          'max.comps' components will be returned (which hold at least
          'min.vertices' vertices, see the next parameter), the others
          will be ignored. Supply 'NA' here if you don't want to limit
          the number of components.

min.vertices: The minimum number of vertices a component should contain
          in order to place it in the result list. Eg. supply 2 here to
          ignore isolate vertices.

_V_a_l_u_e:

     A list of graph objects.

_A_u_t_h_o_r(_s):

     Gabor Csardi csardi@rmki.kfki.hu

_S_e_e _A_l_s_o:

     'is.connected' to decide whether a graph is connected, 'clusters'
     to calculate the connected components of a graph.

_E_x_a_m_p_l_e_s:

     # the diameter of each component in a random graph
     g <- erdos.renyi.game(1000, 1/1000)
     comps <- decompose.graph(g, min.vertices=2)
     sapply(comps, diameter)

