% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/network-summary.R
\name{network_global_efficiency}
\alias{network_global_efficiency}
\title{Global Efficiency}
\usage{
network_global_efficiency(
  x,
  directed = NULL,
  weights = NULL,
  invert_weights = NULL,
  alpha = 1,
  ...
)
}
\arguments{
\item{x}{Network input: matrix, igraph, network, cograph_network, or tna object}

\item{directed}{Logical. Consider edge direction? Default TRUE for directed graphs.}

\item{weights}{Edge weights (NULL for unweighted). Set to NA to ignore existing weights.}

\item{invert_weights}{Logical or NULL. Invert weights so higher weights = shorter
paths? Default NULL which auto-detects: TRUE for tna objects, FALSE otherwise
(matching igraph/sna). Set TRUE for strength/frequency weights (qgraph style).}

\item{alpha}{Numeric. Exponent for weight inversion: distance = 1/weight^alpha.
Default 1.}

\item{...}{Additional arguments passed to \code{\link{to_igraph}}}
}
\value{
Numeric global efficiency. For unweighted simple graphs this is in
\eqn{[0, 1]}; weighted graphs can exceed 1 when edge distances are below 1.
}
\description{
Computes the global efficiency of a network - the average of the inverse
shortest path lengths between all pairs of nodes. Higher values indicate
better global communication efficiency. Handles disconnected graphs gracefully
(infinite distances contribute 0).
}
\examples{
# Complete graph has efficiency 1
k4 <- matrix(1, 4, 4); diag(k4) <- 0
network_global_efficiency(k4)  # 1

# Star has lower efficiency
star <- matrix(c(0,1,1,1, 1,0,0,0, 1,0,0,0, 1,0,0,0), 4, 4)
network_global_efficiency(star)  # ~0.83
}
