% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster-metrics.R
\name{cluster_quality}
\alias{cluster_quality}
\alias{cqual}
\title{Cluster Quality Metrics}
\usage{
cluster_quality(x, clusters, weighted = TRUE, directed = TRUE)

cqual(x, clusters, weighted = TRUE, directed = TRUE)
}
\arguments{
\item{x}{Adjacency matrix}

\item{clusters}{Cluster specification (list or membership vector)}

\item{weighted}{Logical; if TRUE, use edge weights; if FALSE, binarize}

\item{directed}{Logical; if TRUE, treat as directed network}
}
\value{
A \code{cluster_quality} object with:
\item{per_cluster}{Data frame with per-cluster metrics}
\item{global}{List of global metrics (modularity, coverage)}

See \code{\link{cluster_quality}}.
}
\description{
Computes per-cluster and global quality metrics for network partitioning.
Supports both binary and weighted networks.
}
\examples{
mat <- matrix(runif(100), 10, 10)
diag(mat) <- 0
clusters <- c(1,1,1,2,2,2,3,3,3,3)

q <- cluster_quality(mat, clusters)
q$per_cluster   # Per-cluster metrics
q$global        # Modularity, coverage
mat <- matrix(runif(100), 10, 10)
diag(mat) <- 0
cqual(mat, c(1,1,1,2,2,2,3,3,3,3))
}
