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)

