Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

graphcent

Compute the (Harary) Graph Centrality Scores of Network Positions


Description

graphcent takes one or more graphs (dat) and returns the Harary graph centralities of positions (selected by nodes) within the graphs indicated by g. Depending on the specified mode, graph centrality on directed or undirected geodesics will be returned; this function is compatible with centralization, and will return the theoretical maximum absolute deviation (from maximum) conditional on size (which is used by centralization to normalize the observed centralization score).

Usage

graphcent(dat, g=1, nodes=NULL, gmode="digraph", diag=FALSE, 
    tmaxdev=FALSE, cmode="directed", geodist.precomp=NULL, 
    rescale=FALSE, ignore.eval)

Arguments

dat

one or more input graphs.

g

integer indicating the index of the graph for which centralities are to be calculated (or a vector thereof). By default, g==1.

nodes

list indicating which nodes are to be included in the calculation. By default, all nodes are included.

gmode

string indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. gmode is set to "digraph" by default.

diag

boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag is FALSE by default.

tmaxdev

boolean indicating whether or not the theoretical maximum absolute deviation from the maximum nodal centrality should be returned. By default, tmaxdev==FALSE.

cmode

string indicating the type of graph centrality being computed (directed or undirected geodesics).

geodist.precomp

a geodist object precomputed for the graph to be analyzed (optional)

rescale

if true, centrality scores are rescaled such that they sum to 1.

ignore.eval

logical; should edge values be ignored when calculating geodesics?

Details

The Harary graph centrality of a vertex v is equal to 1/(max_u d(v,u)), where d(v,u) is the geodesic distance from v to u. Vertices with low graph centrality scores are likely to be near the “edge” of a graph, while those with high scores are likely to be near the “middle.” Compare this with closeness, which is based on the reciprocal of the sum of distances to all other vertices (rather than simply the maximum).

Value

A vector, matrix, or list containing the centrality scores (depending on the number and size of the input graphs).

Note

Judicious use of geodist.precomp can save a great deal of time when computing multiple path-based indices on the same network.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Hage, P. and Harary, F. (1995). “Eccentricity and Centrality in Networks.” Social Networks, 17:57-63.

See Also

Examples

g<-rgraph(10)     #Draw a random graph with 10 members
graphcent(g)    #Compute centrality scores

sna

Tools for Social Network Analysis

v2.6
GPL (>= 2)
Authors
Carter T. Butts [aut, cre, cph]
Initial release
2020-10-5

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.