% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/network-summary.R
\name{dispersion}
\alias{dispersion}
\title{Dispersion (Backstrom-Kleinberg 2014)}
\usage{
dispersion(x, u = NULL, v = NULL, normalized = TRUE, alpha = 1, b = 0, c = 0)
}
\arguments{
\item{x}{Network input (matrix, igraph, network, cograph_network, tna object).}

\item{u}{Optional source node (1-based index or node name). If \code{NULL}
(default), compute for all sources.}

\item{v}{Optional target node. If \code{NULL}, compute for all neighbors
of \code{u}.}

\item{normalized}{Logical. If \code{TRUE} (default), return the normalized
form; otherwise the raw count.}

\item{alpha}{Numeric normalization exponent. Default 1.}

\item{b}{Numeric bias added to dispersion before exponentiation. Default 0.}

\item{c}{Numeric bias added to embeddedness in the denominator. Default 0.}
}
\value{
\itemize{
\item Scalar if both \code{u} and \code{v} are specified.
\item Named numeric vector if exactly one of \code{u}, \code{v} is given
(names are the other endpoints).
\item A data frame with columns \code{from}, \code{to}, \code{dispersion}
when neither \code{u} nor \code{v} is given (one row per ordered edge).
}
}
\description{
Per-pair measure of tie strength from the Facebook relationship-inference
paper. For each pair \eqn{(u, v)} where \eqn{v} is a neighbor of \eqn{u}:
}
\details{
\enumerate{
\item Let \eqn{S_T = N(u) \cap N(v)} be their mutual friends (embeddedness).
\item Count pairs \eqn{(s, t) \subset S_T} such that:
\itemize{
\item \eqn{s} and \eqn{t} are not directly connected, AND
\item \eqn{s} and \eqn{t} share no common neighbor inside \eqn{N(u)}
other than \eqn{u} and \eqn{v}.
}
\item The raw dispersion is this count. When \code{normalized = TRUE},
the result is \eqn{(\mathrm{dispersion} + b)^{\alpha} /
    (\mathrm{embeddedness} + c)} (normalization is skipped when
\code{embeddedness + c == 0}).
}

Matches \code{networkx.dispersion} bit-exact for all three call modes
(single pair, single source, full matrix).
}
\examples{
g <- igraph::make_graph("Zachary")
# Node 0 (R index 1) to node 33 (R index 34)
dispersion(g, u = 1, v = 34)
# All pairs from node 1
head(dispersion(g, u = 1))
}
\references{
Backstrom, L., & Kleinberg, J. (2014). Romantic partnerships and the
dispersion of social ties: A network analysis of relationship status on
Facebook. In \emph{Proceedings of CSCW} (pp. 831-841). ACM.
\url{https://arxiv.org/pdf/1310.6753v1.pdf}
}
