% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/communities.R
\name{community_louvain}
\alias{community_louvain}
\alias{com_lv}
\title{Louvain Community Detection}
\usage{
community_louvain(x, weights = NULL, resolution = 1, seed = NULL, ...)

com_lv(x, weights = NULL, resolution = 1, seed = NULL, ...)
}
\arguments{
\item{x}{Network input}

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

\item{resolution}{Resolution parameter. Higher values = more communities.
Default 1 (standard modularity).}

\item{seed}{Random seed for reproducibility. Default NULL.}

\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{
Multi-level modularity optimization using the Louvain algorithm.
Fast and widely used for large networks.
}
\examples{
if (requireNamespace("igraph", quietly = TRUE)) {
  g <- igraph::make_graph("Zachary")
  comm <- community_louvain(g)
  membership(comm)

  # Reproducible result with seed
  comm1 <- community_louvain(g, seed = 42)
  comm2 <- community_louvain(g, seed = 42)
  identical(membership(comm1), membership(comm2))
}
}
\references{
Blondel, V.D., Guillaume, J.L., Lambiotte, R., & Lefebvre, E. (2008).
Fast unfolding of communities in large networks.
\emph{Journal of Statistical Mechanics}, P10008.
}
