# Centrality

# EcologicalNetwork.centrality_katzFunction.

Katz's centrality

centrality_katz(N::Unipartite; a::Float64=0.1, k::Int64=5)


This measure can work on different path length (k), and give a different weight to every subsequent connection (a). k must be at least 1 (only immediate neighbors are considered). a (being a weight), must be positive.

julia> N = UnipartiteNetwork(eye(5));

julia> centrality_katz(N)
5×1 Array{Float64,2}:
0.2
0.2
0.2
0.2
0.2


Katz, L., 1953. A new status index derived from sociometric analysis. Psychometrika 18, 39–43. doi:10.1007/bf02289026

# EcologicalNetwork.centrality_degreeFunction.

Degree centrality

centrality_degree(N::UnipartiteNetwork)


Degree centrality, corrected by the maximum degree (the most central species has a degree of 1).

$C_{d}(i) = k_i / \text{max}(\mathbf{k})$

# EcologicalNetwork.centrality_closenessFunction.

Closeness centrality

centrality_closeness(N::UnipartiteNetwork; nmax::Int64=100)


Closeness centrality is defined as:

$C_{c}(i) = \sum_j \left( \frac{n-1}{d_{ji}} \right)$

where $mathbf{d}$ is a matrix containing the lengths of the shortest paths between all pairs of species, and $n$ is the number of species.

The function calls shortest_path internally – the nmax argument is the maximal path length that wil be tried.

Bavelas, A., 1950. Communication Patterns in Task‐Oriented Groups. The Journal of the Acoustical Society of America 22, 725–730. doi:10.1121/1.1906679