\HeaderA{clusteringCoefAppr}{Approximate clustering coefficient for an undirected graph}{clusteringCoefAppr}
\keyword{models}{clusteringCoefAppr}
\begin{Description}\relax
Approximate clustering coefficient for an undirected graph
\end{Description}
\begin{Usage}
\begin{verbatim}
clusteringCoefAppr(g, k=length(nodes(g)), Weighted=FALSE, vW=degree(g))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] an instance of the \code{graph} class 
\item[\code{Weighted}] calculate weighted clustering coefficient or not
\item[\code{vW}] vertex weights to use when calculating weighted clustering coefficient
\item[\code{k}] parameter controls total expected runtime
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
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, 
\code{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.
\end{Details}
\begin{Value}
Approximated clustering coefficient for graph \code{g}.
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{References}\relax
Approximating Clustering Coefficient and Transitivity, T. Schank, D. Wagner, 
Journal of Graph Algorithms and Applications, Vol. 9, No. 2 (2005).
\end{References}
\begin{SeeAlso}\relax
clusteringCoef, transitivity, graphGenerator
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- fromGXL(file(system.file("XML/conn.gxl",package="RBGL")))
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)
\end{ExampleCode}
\end{Examples}

