clusteringCoef             package:RBGL             R Documentation

_C_a_l_c_u_l_a_t_e _c_l_u_s_t_e_r_i_n_g _c_o_e_f_f_i_c_i_e_n_t _f_o_r _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:

     Calculate clustering coefficient for an undirected graph

_U_s_a_g_e:

     clusteringCoef(g, Weighted=FALSE, vW=degree(g))

_A_r_g_u_m_e_n_t_s:

       g: an instance of the 'graph' class 

Weighted: calculate weighted clustering coefficient or not

      vW: vertex weights to use when calculating weighted clustering
          coefficient

_D_e_t_a_i_l_s:

     For an undirected graph {G}, let delta(v) be the number of
     triangles with {v}  as a node, let tau(v) be the number of
     triples, i.e., paths of length 2 with  {v} as the center node.  

     Let V' be the set of nodes with degree at least 2.

     Define clustering coefficient for 'v', c(v) = (delta(v) / tau(v)). 

     Define clustering coefficient for 'G', C(G) = sum(c(v)) / |V'|, 
     for all 'v' in V'. 

     Define weighted clustering coefficient for 'G',  Cw(G) = sum(w(v)
     * c(v)) / sum(w(v)), for all 'v' in V'.

_V_a_l_u_e:

     Clustering coefficient for 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:

     Approximating Clustering Coefficient and Transitivity, T. Schank,
     D. Wagner,  Journal of Graph Algorithms and Applications, Vol. 9,
     No. 2 (2005).

_S_e_e _A_l_s_o:

     clusteringCoefAppr, transitivity, graphGenerator

_E_x_a_m_p_l_e_s:

     g <- fromGXL(file(system.file("XML/conn.gxl",package="RBGL")))
     cc <- clusteringCoef(g)
     ccw1 <- clusteringCoef(g, Weighted=TRUE)
     vW  <- c(1, 1, 1, 1, 1,1, 1, 1)
     ccw2 <- clusteringCoef(g, Weighted=TRUE, vW)

