kCores                 package:RBGL                 R Documentation

_F_i_n_d _a_l_l _t_h_e _k-_c_o_r_e_s _i_n _a _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     Find all the k-cores in a graph

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

     kCores(g, EdgeType=c("in", "out"))

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

       g: an instance of the 'graph' class 

EdgeType: what types of edges to be considered when 'g' is directed 

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

     A k-core in a graph is a subgraph where each node is adjacent to
     at least a minimum number, k, of the other nodes in the subgraph.

     A k-core in a graph may not be connected.  

     The core number for each node is the highest k-core this node is
     in.  A node in a k-core will be, by definition, in a (k-1)-core.

     The implementation is based on the algorithm by V. Batagelj and M.
     Zaversnik, 2002.

     The example 'snacoreex.gxl' is in the paper by V. Batagelj and M.
     Zaversnik, 2002.

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

     A vector of the core numbers for all the nodes in 'g'.

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

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

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

     Social Network Analysis: Methods and Applications.  By S.
     Wasserman and K. Faust, pp. 266.  An O(m) Algorithm for Cores
     decomposition of networks, by V. Batagelj and M. Zaversnik, 2002.

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

     con1 <- file(system.file("XML/snacoreex.gxl",package="RBGL"))
     kcoex <- fromGXL(con1)
     close(con1)

     kCores(kcoex)

     con2 <- file(system.file("XML/conn2.gxl",package="RBGL"))
     kcoex2 <- fromGXL(con2)
     close(con2)

     kCores(kcoex2)
     kCores(kcoex2, "in")
     kCores(kcoex2, "out")

