% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/measure_centrality_closeness.R
\name{measure_central_close}
\alias{measure_central_close}
\alias{node_by_closeness}
\alias{node_by_harmonic}
\alias{node_by_reach}
\alias{node_by_information}
\alias{node_by_eccentricity}
\alias{node_by_distance}
\alias{node_by_vitality}
\alias{node_by_randomwalk}
\title{Measuring nodes closeness-like centrality}
\usage{
node_by_closeness(.data, normalized = TRUE, direction = "out", cutoff = NULL)

node_by_harmonic(.data, normalized = TRUE, cutoff = -1)

node_by_reach(.data, normalized = TRUE, cutoff = 2)

node_by_information(.data, normalized = TRUE)

node_by_eccentricity(.data, normalized = TRUE)

node_by_distance(.data, from, to, normalized = TRUE)

node_by_vitality(.data, normalized = TRUE)

node_by_randomwalk(.data, normalized = TRUE)
}
\arguments{
\item{.data}{A network object of class \code{mnet}, \code{igraph}, \code{tbl_graph}, \code{network}, or similar.
For more information on the standard coercion possible,
see \code{\link[manynet:as_tidygraph]{manynet::as_tidygraph()}}.}

\item{normalized}{Logical scalar, whether scores are normalized.
Different denominators may be used depending on the measure,
whether the object is one-mode or two-mode, and other arguments.
By default TRUE.}

\item{direction}{Character string, “out” bases the measure on outgoing ties,
“in” on incoming ties, and "all" on either/the sum of the two.
By default "all".}

\item{cutoff}{Maximum path length to use during calculations.}

\item{from, to}{Index or name of a node to calculate distances from or to.}
}
\value{
A \code{node_measure} numeric vector the length of the nodes in the network,
providing the scores for each node.
If the network is labelled,
then the scores will be labelled with the nodes' names.
}
\description{
These functions calculate common closeness-related centrality measures
that rely on path-length for one- and two-mode networks:
\itemize{
\item \code{node_by_closeness()} measures the closeness centrality of nodes in a
network.
\item \code{node_by_harmonic()} measures nodes' harmonic centrality or valued
centrality, which is thought to behave better than reach centrality
for disconnected networks.
\item \code{node_by_reach()} measures nodes' reach centrality,
or how many nodes they can reach within \emph{k} steps.
\item \code{node_by_information()} measures nodes' information centrality or
current-flow closeness centrality.
\item \code{node_by_eccentricity()} measures nodes' eccentricity or maximum distance
from another node in the network.
\item \code{node_by_distance()} measures nodes' geodesic distance from or to a
given node.
\item \code{node_by_vitality()} measures a network's closeness vitality centrality,
or the change in closeness centrality between networks with and without a
given node.
}

All measures attempt to use as much information as they are offered,
including whether the networks are directed, weighted, or multimodal.
If this would produce unintended results,
first transform the salient properties using e.g. \code{\link[manynet:to_undirected]{to_undirected()}} functions.
All centrality and centralization measures return normalized measures by default,
including for two-mode networks.
}
\section{Closeness centrality}{

Closeness centrality, status centrality, or barycenter centrality is
defined as the reciprocal of the farness or distance, \eqn{d},
from a node to all other nodes in the network:
\deqn{C_C(i) = \frac{1}{\sum_j d(i,j)}}
When (more commonly) normalised, the numerator is instead \eqn{N-1}.
}

\section{Harmonic centrality}{

Harmonic centrality or valued centrality reverses the sum and reciprocal
operations compared to closeness centrality:
\deqn{C_H(i) = \sum_{i, i \neq j} \frac{1}{d(i,j)}}
where \eqn{\frac{1}{d(i,j)} = 0} where there is no path between \eqn{i} and
\eqn{j}. Normalization is by \eqn{N-1}.
Since the harmonic mean performs better than the arithmetic mean on
unconnected networks, i.e. networks with infinite distances,
harmonic centrality is to be preferred in these cases.
}

\section{Reach centrality}{

In some cases, longer path lengths are irrelevant and 'closeness' should
be defined as how many others are in a local neighbourhood.
How many steps out this neighbourhood should be defined as is given by
the 'cutoff' parameter.
This is usually termed \eqn{k} or \eqn{m} in equations,
which is why this is sometimes called (\eqn{m}- or)
\eqn{k}-step reach centrality:
\deqn{C_R(i) = \sum_j d(i,j) \leq k}
The maximum reach score is \eqn{N-1}, achieved when the node can reach all
other nodes in the network in \eqn{k} steps or less,
but the normalised version, \eqn{\frac{C_R}{N-1}}, is more common.
Note that if \eqn{k = 1} (i.e. cutoff = 1), then this returns the node's degree.
At higher cutoff reach centrality returns the size of the node's component.
}

\section{Information centrality}{

Information centrality, also known as current-flow centrality,
is a hybrid measure relating to both path-length and walk-based measures.
The information centrality of a node is the harmonic average of the
“bandwidth” or inverse path-length for all paths originating from the node.

As described in the \code{{sna}} package,
information centrality works on an undirected but potentially weighted
network excluding isolates (which take scores of zero).
It is defined as:
\deqn{C_I = \frac{1}{T + \frac{\sum T - 2 \sum C_1}{|N|}}}
where \eqn{C = B^-1} with \eqn{B} is a pseudo-adjacency matrix replacing
the diagonal of \eqn{1-A} with \eqn{1+k},
and \eqn{T} is the trace of \eqn{C} and \eqn{S_R} an arbitrary row sum
(all rows in \eqn{C} have the same sum).

Nodes with higher information centrality have a large number of short paths
to many others in the network, and are thus considered to have greater
control of the flow of information.
}

\section{Eccentricity centrality}{

Eccentricity centrality, graph centrality, or the Koenig number,
is the (if normalized, inverse of) the distance to the furthest node:
\deqn{C_E(i) = \frac{1}{max_{j \in N} d(i,j)}}
where the distance from \eqn{i} to \eqn{j} is \eqn{\infty} if unconnected.
As such it is only well defined for connected networks.
}

\section{Closeness vitality centrality}{

The closeness vitality of a node is the change in the sum of all distances
in a network, also known as the Wiener Index, when that node is removed.
Note that the closeness vitality may be negative infinity if
removing that node would disconnect the network.
Formally:
\deqn{C_V(i) = \sum_{j,k} d(j,k) - \sum_{j,k} d(j,k,G\ i)}
where \eqn{d(j,k,G\ i)} is the distance between nodes \eqn{j} and \eqn{k}
in the network with node \eqn{i} removed.
}

\section{Random walk closeness centrality}{

Random walk closeness centrality is based on the average length of
random walks starting at all other nodes to reach a given node.
It is defined as the inverse of the average hitting time to a node.
This means that higher values are given to nodes that can be reached
more quickly on average by random walks starting at other nodes.
Formally:
\deqn{C_{RW}(i) = \frac{1}{\frac{1}{N-1} \sum_{j \neq i} H_{ji}}}
where \eqn{H_{ji}} is the hitting time from node \eqn{j} to node \eqn{i}.
}

\examples{
node_by_closeness(ison_southern_women)
node_by_reach(ison_adolescents)
}
\references{
\subsection{On closeness centrality}{

Bavelas, Alex. 1950.
"Communication Patterns in Task‐Oriented Groups".
\emph{The Journal of the Acoustical Society of America}, 22(6): 725–730.
\doi{10.1121/1.1906679}

Harary, Frank. 1959.
"Status and Contrastatus".
\emph{Sociometry}, 22(1): 23–43.
\doi{10.2307/2785610}
}

\subsection{On harmonic centrality}{

Marchiori, Massimo, and Vito Latora. 2000.
"Harmony in the small-world".
\emph{Physica A} 285: 539-546.
\doi{10.1016/S0378-4371(00)00311-3}

Dekker, Anthony. 2005.
"Conceptual distance in social network analysis".
\emph{Journal of Social Structure} 6(3).
}

\subsection{On reach centrality}{

Borgatti, Stephen P., Martin G. Everett, and J.C. Johnson. 2013.
\emph{Analyzing social networks}.
London: SAGE Publications Limited.
}

\subsection{On information centrality}{

Stephenson, Karen, and Marvin Zelen. 1989.
"Rethinking centrality: Methods and examples".
\emph{Social Networks} 11(1):1-37.
\doi{10.1016/0378-8733(89)90016-6}

Brandes, Ulrik, and Daniel Fleischer. 2005.
"Centrality Measures Based on Current Flow".
\emph{Proc. 22nd Symp. Theoretical Aspects of Computer Science} LNCS 3404: 533-544.
\doi{10.1007/978-3-540-31856-9_44}
}

\subsection{On eccentricity centrality}{

Hage, Per, and Frank Harary. 1995.
"Eccentricity and centrality in networks".
\emph{Social Networks}, 17(1): 57-63.
\doi{10.1016/0378-8733(94)00248-9}
}

\subsection{On closeness vitality centrality}{

Koschuetzki, Dirk, Katharina Lehmann, Leon Peeters, Stefan Richter,
Dagmar Tenfelde-Podehl, and Oliver Zlotowski. 2005.
"Centrality Indices", in
Brandes, Ulrik, and Thomas Erlebach (eds.).
\emph{Network Analysis: Methodological Foundations}.
Springer: Berlin, pp. 16-61.
}

\subsection{On random walk closeness centrality}{

Noh, J.D. and R. Rieger. 2004.
"Random Walks on Complex Networks".
\emph{Physical Review Letters}, 92(11): 118701.
\doi{10.1103/PhysRevLett.92.118701}
}
}
\seealso{
Other closeness:
\code{\link{measure_centralisation_close}},
\code{\link{measure_centralities_close}}

Other centrality:
\code{\link{measure_central_between}},
\code{\link{measure_central_degree}},
\code{\link{measure_central_eigen}},
\code{\link{measure_centralisation_between}},
\code{\link{measure_centralisation_close}},
\code{\link{measure_centralisation_degree}},
\code{\link{measure_centralisation_eigen}},
\code{\link{measure_centralities_between}},
\code{\link{measure_centralities_close}},
\code{\link{measure_centralities_degree}},
\code{\link{measure_centralities_eigen}}

Other measures:
\code{\link{measure_assort_net}},
\code{\link{measure_assort_node}},
\code{\link{measure_breadth}},
\code{\link{measure_broker_node}},
\code{\link{measure_broker_tie}},
\code{\link{measure_brokerage}},
\code{\link{measure_central_between}},
\code{\link{measure_central_degree}},
\code{\link{measure_central_eigen}},
\code{\link{measure_centralities_between}},
\code{\link{measure_centralities_close}},
\code{\link{measure_centralities_degree}},
\code{\link{measure_centralities_eigen}},
\code{\link{measure_closure}},
\code{\link{measure_closure_node}},
\code{\link{measure_cohesion}},
\code{\link{measure_core}},
\code{\link{measure_diffusion_infection}},
\code{\link{measure_diffusion_net}},
\code{\link{measure_diffusion_node}},
\code{\link{measure_diverse_net}},
\code{\link{measure_diverse_node}},
\code{\link{measure_features}},
\code{\link{measure_fragmentation}},
\code{\link{measure_hierarchy}},
\code{\link{measure_periods}}

Other nodal:
\code{\link{mark_core}},
\code{\link{mark_degree}},
\code{\link{mark_diff}},
\code{\link{mark_nodes}},
\code{\link{mark_select_node}},
\code{\link{measure_assort_node}},
\code{\link{measure_broker_node}},
\code{\link{measure_brokerage}},
\code{\link{measure_central_between}},
\code{\link{measure_central_degree}},
\code{\link{measure_central_eigen}},
\code{\link{measure_closure_node}},
\code{\link{measure_core}},
\code{\link{measure_diffusion_node}},
\code{\link{measure_diverse_node}},
\code{\link{member_brokerage}},
\code{\link{member_cliques}},
\code{\link{member_community}},
\code{\link{member_community_hier}},
\code{\link{member_community_non}},
\code{\link{member_components}},
\code{\link{member_core}},
\code{\link{member_diffusion}},
\code{\link{member_equivalence}},
\code{\link{motif_brokerage_node}},
\code{\link{motif_exposure}},
\code{\link{motif_node}},
\code{\link{motif_path}}
}
\concept{centrality}
\concept{closeness}
\concept{measures}
\concept{nodal}
