clusteringCoefAppr           package:RBGL           R Documentation

_A_p_p_r_o_x_i_m_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:

     Approximate clustering coefficient for an undirected graph

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

     clusteringCoefAppr(g, k=length(nodes(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

       k: parameter controls total expected runtime

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

     It is quite expensive to compute cluster coefficient and
     transitivity exactly  for a large graph by computing the number of
     triangles in the graph.  Instead,  'clusteringCoefAppr' samples
     triples with appropriate probability, returns the ratio between
     the number of existing edges and the number of samples.   

     MORE ABOUT CHOICE OF K.

     See reference for more details.

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

     Approximated 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:

     clusteringCoef, transitivity, graphGenerator

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

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

     k = length(nodes(g))
     cc <- clusteringCoefAppr(g, k)
     ccw1 <- clusteringCoefAppr(g, k, Weighted=TRUE)
     vW  <- c(1, 1, 1, 1, 1,1, 1, 1)
     ccw2 <- clusteringCoefAppr(g, k, Weighted=TRUE, vW)

