closeness.freeman {centiserve}R Documentation

Find the closeness centrality in a strongly connected graph

Description

Freeman closeness centrality defined as:

1/sum( d(v,i), i != v)

Usage

closeness.freeman(graph, vids = V(graph), mode = c("all", "out", "in"),
  weights = NULL, normalized = FALSE)

Arguments

graph

The input graph as igraph object

vids

Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices.

mode

Character string, defined the types of the paths used for measuring the distance in directed graphs. 'in' measures the paths to a vertex, 'out' measures paths from a vertex, all uses undirected paths. This argument is ignored for undirected graphs.

weights

Possibly a numeric vector giving edge weights. If this is NULL, the default, and the graph has a weight edge attribute, then the attribute is used. If this is NA then no weights are used (even if the graph has a weight attribute).

normalized

Logical scalar, whether to calculate the normalized score.

Details

Because closeness is infinite if there is no path between two vertex so freeman closeness require a strongly connected graph. In igraph if there is no (directed) path between vertex v and i then the total number of vertices is used in the formula instead of the path length.
More detail at Closeness Centrality

Value

A numeric vector contaning the centrality scores for the selected vertices.

Author(s)

Mahdi Jalili m_jalili@farabi.tums.ac.ir

Use igraph package closeness function.

References

Freeman, Linton C. "Centrality in social networks conceptual clarification." Social networks 1.3 (1979): 215-239.

Examples

g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE)
closeness.freeman(g)

[Package centiserve version 1.0.0 Index]