% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/communities.R
\name{community_walktrap}
\alias{community_walktrap}
\alias{com_wt}
\title{Walktrap Community Detection}
\usage{
community_walktrap(
  x,
  weights = NULL,
  steps = 4,
  merges = TRUE,
  modularity = TRUE,
  membership = TRUE,
  ...
)

com_wt(
  x,
  weights = NULL,
  steps = 4,
  merges = TRUE,
  modularity = TRUE,
  membership = TRUE,
  ...
)
}
\arguments{
\item{x}{Network input}

\item{weights}{Edge weights. NULL uses network weights, NA for unweighted.}

\item{steps}{Number of random walk steps. Default 4.}

\item{merges}{Logical; return merge matrix? Default TRUE.}

\item{modularity}{Logical; return modularity scores? Default TRUE.}

\item{membership}{Logical; return membership vector? Default TRUE.}

\item{...}{Additional arguments passed to \code{\link{to_igraph}}}
}
\value{
A \code{cograph_communities} object

A \code{cograph_communities} object. See \code{\link{detect_communities}}.
}
\description{
Detects communities via random walks. Nodes within the same community
tend to have short random walk distances.
}
\examples{
if (requireNamespace("igraph", quietly = TRUE)) {
  g <- igraph::make_graph("Zachary")

  # Default 4 steps
  comm <- community_walktrap(g)

  # More steps for larger communities
  comm2 <- community_walktrap(g, steps = 8)
}
}
\references{
Pons, P., & Latapy, M. (2006).
Computing communities in large networks using random walks.
\emph{Journal of Graph Algorithms and Applications}, 10(2), 191-218.
}
