\HeaderA{kCores}{Find all the k-cores in a graph}{kCores}
\keyword{models}{kCores}
\begin{Description}\relax
Find all the k-cores in a graph
\end{Description}
\begin{Usage}
\begin{verbatim}
kCores(g, EdgeType=c("in", "out"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] an instance of the \code{graph} class 
\item[\code{EdgeType}] 
\end{ldescription}
 {what types of edges to be considered when \code{g} is directed }
\end{Arguments}
\begin{Details}\relax
A k-core in a graph is a subgraph where each node is adjacent to at least a minimum number, k, of the other nodes in the subgraph.

The implementation is based on the algorithm by V. Batagelj and M. Zaversnik, 2002.

The example \code{snacoreex.gxl} is in the paper by V. Batagelj and M. Zaversnik, 2002.
\end{Details}
\begin{Value}
A vector of the core numbers for all the nodes in \code{g}.
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{References}\relax
Social Network Analysis: Methods and Applications.  By S. Wasserman and K. Faust, pp. 266. 
An O(m) Algorithm for Cores decomposition of networks, by V. Batagelj and M. Zaversnik, 2002.
\end{References}
\begin{SeeAlso}\relax
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
kcoex <- fromGXL(file(system.file("XML/snacoreex.gxl",package="RBGL")))
kCores(kcoex)

kcoex2 <- fromGXL(file(system.file("XML/conn2.gxl",package="RBGL")))
kCores(kcoex2)
kCores(kcoex2, "in")
kCores(kcoex2, "out")

\end{ExampleCode}
\end{Examples}

