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.

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

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

     kCliques(coex)

