% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/centrality_measures.R
\name{net_edge_betweenness}
\alias{net_edge_betweenness}
\alias{net_edge_betweenness.netobject}
\alias{net_edge_betweenness.netobject_group}
\alias{net_edge_betweenness.default}
\title{Edge Betweenness Network}
\usage{
net_edge_betweenness(x, invert = TRUE, ...)

\method{net_edge_betweenness}{netobject}(x, invert = TRUE, ...)

\method{net_edge_betweenness}{netobject_group}(x, invert = TRUE, ...)

\method{net_edge_betweenness}{default}(x, invert = TRUE, ...)
}
\arguments{
\item{x}{A \code{netobject} or \code{netobject_group}.}

\item{invert}{Logical. Invert weights to distances by \code{1/w} before
computing shortest paths? Default \code{TRUE} (correct for probability
and frequency networks).}

\item{...}{Additional arguments (ignored).}
}
\value{
For a \code{netobject}: a new \code{netobject} (class
\code{c("netobject", "cograph_network")}) whose \code{$weights} are the
edge-betweenness scores, with \code{method = "edge_betweenness"}. Call
\code{extract_edges()} on it for a tidy per-edge table, or \code{plot()}
to render it. The object preserves source-network metadata so
\code{\link{permutation}} can test edge-betweenness differences by
permuting the source networks. For a \code{netobject_group}: a
\code{netobject_group} of such networks, one per group.
}
\description{
Builds a network in which each edge's weight is replaced by its
betweenness: the number of shortest paths between all node pairs that
traverse that edge (fractional when shortest paths tie). This is the
Nestimate counterpart of \code{tna::betweenness_network()} and produces
identical values for transition networks; the name differs to avoid a
clash with \code{tna::betweenness_network()} and
\code{igraph::edge_betweenness()}.
}
\details{
For a probability/transition network the edge weights are transition
probabilities, so they are inverted to distances (\code{invert = TRUE})
before path-finding: the geodesic between two states is then the most
probable route rather than the one with the fewest hops. Pass
\code{invert = FALSE} when the weights already represent distances.

Directedness is taken from the network itself. A directed network yields
an asymmetric betweenness matrix; an undirected (symmetric) network
yields a symmetric one.
}
\examples{
seqs <- data.frame(
  V1 = c("A","B","A","C"), V2 = c("B","C","B","A"),
  V3 = c("C","A","C","B"))
net <- build_network(seqs, method = "relative")
eb  <- net_edge_betweenness(net)
extract_edges(eb)

}
