kCliques                package:RBGL                R Documentation

_F_i_n_d _a_l_l _t_h_e _k-_c_l_i_q_u_e_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:

     Find all the k-cliques in an undirected graph

_U_s_a_g_e:

     kCliques(g)

_A_r_g_u_m_e_n_t_s:

       g: an instance of the 'graph' class 

_D_e_t_a_i_l_s:

     Notice that there are different definitions of k-clique in
     different context.

     In computer science, a k-clique of a graph is a clique, i.e., a
     complete subgraph, of k nodes. 

     In Social Network Analysis, a k-clique in a graph is a subgraph
     where the distance between any two nodes is no greater than k.

     Here we take the definition in Social Network Analysis.

     Let D be a matrix, D[i][j] is the shortest path from node i to
     node j.  Algorithm is outlined as following:  (1) use Johnson's
     algorithm to fill D; let N = max(D[i][j]) for all i, j;  (2) each
     edge is a 1-clique by itself;  (3) for k = 2, ..., N, try to
     expand each (k-1)-clique to k-clique:  (3.1) consider a
     (k-1)-clique the current k-clique KC; (3.2) repeat the following:
     if for all nodes j in KC, D[v][j] <= k, add node v to KC; (3.3)
     eliminate duplicates; (4) the whole graph is N-clique.

_V_a_l_u_e:

     A list of length N; k-th entry (k = 1, ..., N) is a list of all
     the k-cliques in graph '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. 258.

_S_e_e _A_l_s_o:

_E_x_a_m_p_l_e_s:

     coex <- fromGXL(file(system.file("XML/snacliqueex.gxl",package="RBGL")))
     kCliques(coex)

