% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/centrality.R
\name{centrality_closeness}
\alias{centrality_closeness}
\alias{centrality_incloseness}
\alias{centrality_outcloseness}
\title{Closeness Centrality}
\usage{
centrality_closeness(x, mode = "all", ...)

centrality_incloseness(x, ...)

centrality_outcloseness(x, ...)
}
\arguments{
\item{x}{Network input (matrix, igraph, network, cograph_network, tna object).}

\item{mode}{For directed networks: \code{"all"} (default), \code{"in"}, or
\code{"out"}.}

\item{...}{Additional arguments passed to \code{\link{centrality}} (e.g.,
\code{normalized}, \code{weighted}, \code{directed}).}
}
\value{
Named numeric vector of closeness values.
}
\description{
Inverse of the average shortest path distance from a node to all others.
For directed networks, \code{centrality_incloseness} and
\code{centrality_outcloseness} measure incoming and outgoing closeness.
}
\examples{
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
centrality_closeness(adj)
}
\seealso{
\code{\link{centrality}} for computing multiple measures at once,
\code{\link{centrality_harmonic}} for a variant that handles disconnected
graphs.
}
