Title: | Find Graph Centrality Indices |
---|---|
Description: | Calculates centrality indices additional to the 'igraph' package centrality functions. |
Authors: | Mahdi Jalili <[email protected]> |
Maintainer: | Mahdi Jalili <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2024-12-04 07:09:47 UTC |
Source: | CRAN |
Find centrality indices (measures) additional to the igraph package centrality functions. The centiserve is a part of www.CentiServer.org project which is a comprehensive centrality measures resource and a web based application for finding graph centrality measures.
Package: | centiserve |
Type: | Package |
Version: | 1.0.0 |
Date: | 2014-12-30 |
License: | GPL (>= 2) |
Mahdi Jalili [email protected]
Adapted algorithms and sources are referenced in function document.
Maintainer: Mahdi Jalili [email protected]
Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.org
Adapted algorithms and sources are referenced in function document.
This function return average distance of a node in a strongly connected and loop free graph.
averagedis(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
averagedis(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
Average distance of node to the rest of nodes in the net defined as:
It is invers of closeness centrality.
More detail at Average Distance
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
del Rio, Gabriel, Dirk Koschutzki, and Gerardo Coello. "How to identify essential genes from molecular networks?." BMC systems biology 3.1 (2009): 102.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) averagedis(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) averagedis(g)
Barycenter scores are calculated as 1 / (total distance from vertex v to all other vertices) in a strongly connected network.
barycenter(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
barycenter(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
There are 2 types of distance centrality scores, Closeness Centrality and Barycenter Centrality.
Barycenter Centrality for vertex defined as:
Closeness scores are calculated using the formula and Barycenter scores are calculated as
.
More detail at Barycenter Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Viswanath, Meghana. Ontology-based automatic text summarization. Diss. University of Georgia, 2009.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) barycenter(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) barycenter(g)
BottleNeck Centrality for vertex v defined as:
Let be a shortest path tree rooted at node
.
if more than
paths from node
to other nodes in
meet at the vertex
, otherwise
.
bottleneck(graph, vids = V(graph), mode = c("all", "out", "in"))
bottleneck(graph, vids = V(graph), mode = c("all", "out", "in"))
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. This argument is ignored for undirected graphs. |
For each node in the graph, construct a tree
of shortest paths from that node to all other nodes in the graph. For a node
,
is the number of nodes that are directly or indirectly connected to node
(i.e. the tree
contains
nodes). So extract all nodes
on the above defined tree
of shortest paths from node
, such that more than
paths from
to other nodes in the tree meet at node
. Nodes
extracted in this way represent 'bottle necks' of the shortest path tree
rooted at node
, since at least
paths of the
tree
'meet' at
.
More detail at BottleNeck
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Przulj, N., Dennis A. Wigle, and Igor Jurisica. "Functional topology in a network of protein interactions." Bioinformatics 20.3 (2004): 340-348.
g <- graph(c(1,2,2,3,3,4,4,2)) bottleneck(g)
g <- graph(c(1,2,2,3,3,4,4,2)) bottleneck(g)
Centroid value C_cen(v) for node v defined as:
where , and
is the number of vertex closer to
than to
.
centroid(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
centroid(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
Centroid value computed by focusing the calculus on couples of nodes and systematically counting the nodes that are closer (in term of shortest path) to
or to
. The calculus proceeds by comparing the node distance from other nodes with the distance of all other nodes from the others, such that a high centroid value indicates that a node
is much closer to other nodes. Thus, the centroid value provides a centrality index always weighted with the values of all other nodes in the graph.
More detail at Centroid value
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Algorithm adapted from CentiLib (Grabler, Johannes, 2012).
Scardoni, Giovanni, Michele Petterlini, and Carlo Laudanna. "Analyzing biological network parameters with CentiScaPe." Bioinformatics 25.21 (2009): 2857-2859.
Grabler, Johannes, Dirk Koschutzki, and Falk Schreiber. "CentiLib: comprehensive analysis and exploration of network centralities." Bioinformatics 28.8 (2012): 1178-1179.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) centroid(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) centroid(g)
Current-flow closeness centrality is defined by:
where is a normalizing factor,
is the absolute electrical potential of vertex s based on the electrical current supply from vertex
to vertex
, and
corresponds to the effective resistance typically measured as voltage, which can be interpreted as an alternative measure of distance between
and
.
closeness.currentflow(graph, vids = V(graph), weights = NULL)
closeness.currentflow(graph, vids = V(graph), weights = NULL)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
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). |
The closeness index based on shortest paths can also be transformed to a measure based on electrical current. For the electrical current model set, Brandes et al. developed an alternative measure of the distance between two vertices and
, which is defined as the difference of their electrical potentials.
More detail at Current-Flow Closeness Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Note: This implementation is based on Daniel Fleischer's implementation for yFiles and JMP which convert to java implementation for CentiLib by Johannes Graessler and Dirk Koschuetzki.
Brandes, Ulrik, and Daniel Fleischer. Centrality measures based on current flow. Springer Berlin Heidelberg, 2005.
Grabler, Johannes, Dirk Koschutzki, and Falk Schreiber. "CentiLib: comprehensive analysis and exploration of network centralities." Bioinformatics 28.8 (2012): 1178-1179.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) closeness.currentflow(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) closeness.currentflow(g)
Freeman closeness centrality defined as:
closeness.freeman(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, normalized = FALSE)
closeness.freeman(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, normalized = FALSE)
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. |
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 and
then the total number of vertices is used in the formula instead of the path length.
More detail at Closeness Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Use igraph package closeness function.
Freeman, Linton C. "Centrality in social networks conceptual clarification." Social networks 1.3 (1979): 215-239.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) closeness.freeman(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) closeness.freeman(g)
Variant (Latora) closeness centrality defined as:
closeness.latora(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, normalized = FALSE)
closeness.latora(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, normalized = FALSE)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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. |
This variant (sum of inversed distances to all other nodes instead of the inversed of the sum of distances to all other nodes) applicable to both connected and unconnected graphs.
More detail at Closeness Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Latora V., Marchiori M., Efficient behavior of small-world networks, Physical Review Letters, V. 87, p. 19, 2001.
Opsahl, Tore, Filip Agneessens, and John Skvoretz. "Node centrality in weighted networks: Generalizing degree and shortest paths." Social Networks 32.3 (2010): 245-251.
g <- graph(c(1,2,2,3,3,4,4,2)) closeness.latora(g)
g <- graph(c(1,2,2,3,3,4,4,2)) closeness.latora(g)
Residual closeness centrality defined as:
closeness.residual(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
closeness.residual(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
This function calculate closeness of a vertex as Dangalchev defination.
More detail at Residual Closeness Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Dangalchev, Chavdar. "Residual closeness in networks." Physica A: Statistical Mechanics and its Applications 365.2 (2006): 556-564.
g <- graph(c(1,2,2,3,3,4,4,2)) closeness.residual(g)
g <- graph(c(1,2,2,3,3,4,4,2)) closeness.residual(g)
Closeness vitality of a node is the change in the sum of distances between all node pairs when excluding that node.
closeness.vitality(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
closeness.vitality(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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). |
More detail at Closeness Vitality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Brandes, U. & Erlebach, T. 2005. Network Analysis: Methodological Foundations, U.S. Government Printing Office.
g <- graph(c(1,2,2,3,3,4,4,2,1,4), directed=FALSE) closeness.vitality(g)
g <- graph(c(1,2,2,3,3,4,4,2,1,4), directed=FALSE) closeness.vitality(g)
Mathematically, the ClusterRank score of node
is defined as:
where the term f(c_i) accounts for the effect of i's local clustering and the term '+1' results from the contribution of itself.
Here
clusterrank(graph, vids = V(graph), directed = TRUE, loops = TRUE)
clusterrank(graph, vids = V(graph), directed = TRUE, loops = TRUE)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
directed |
Logical scalar, whether to directed graph is analyzed. This argument is ignored for undirected graphs. |
loops |
Logical; whether the loop edges are also counted. |
ClusterRank is a local ranking algorithm which takes into account not only the number of neighbors and the neighbors' influences, but also the clustering coefficient.
ClusterRank can also be applied to undirected networks where the superiority of ClusterRank is significant compared with degree centrality and k-core decomposition.
More detail at ClusterRank
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Chen, Duan-Bing, et al. "Identifying influential nodes in large-scale directed networks: the role of clustering." PloS one 8.10 (2013): e77455.
g <- graph(c(1,2,2,3,3,4,4,2,2,5,5,3,4,1,4,3,1,6,6,3,3,6,2,6,5,6)) clusterrank(g)
g <- graph(c(1,2,2,3,3,4,4,2,2,5,5,3,4,1,4,3,1,6,6,3,3,6,2,6,5,6)) clusterrank(g)
The communicability betweenness of a node r is:
where where is the number of walks involving node
,
is the number of closed walks starting at node p and ending at node
, and
is a normalization factor equal to the number of terms in the sum.
communibet(graph, vids = V(graph), normalized = FALSE)
communibet(graph, vids = V(graph), normalized = FALSE)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
normalized |
Logical scalar, whether to calculate the normalized score. |
Communicability betweenness measure makes use of the number of walks connecting every pair of nodes as the basis of a betweenness centrality measure.
The resulting takes values between zero and one. The lower bound cannot be attained for a connected graph, and the upper bound is attained in the star graph.
More detail at Communicability Betweenness Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Algorithm adapted from NetworkX 1.9 (Hagberg, A. 2008).
Estrada, Ernesto, Desmond J. Higham, and Naomichi Hatano. "Communicability betweenness in complex networks." Physica A: Statistical Mechanics and its Applications 388.5 (2009): 764-774.
Hagberg, Aric, Pieter Swart, and Daniel S Chult. Exploring network structure, dynamics, and function using NetworkX. No. LA-UR-08-05495; LA-UR-08-5495. Los Alamos National Laboratory (LANL), 2008.
## Not run: g <- graph(c(1,2,2,3,2,6,6,5,3,5,3,4,5,4,4,7), directed=FALSE) communibet(g) ## End(Not run)
## Not run: g <- graph(c(1,2,2,3,2,6,6,5,3,5,3,4,5,4,4,7), directed=FALSE) communibet(g) ## End(Not run)
This function returns community-based node centrality measures.
communitycent(graph, vids = V(graph), type = c("commweight", "commconn"), normalise = TRUE)
communitycent(graph, vids = V(graph), type = c("commweight", "commconn"), normalise = TRUE)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
type |
A character string naming the community centrality measure. Can be one of "commweight" or "commconn" |
normalise |
Logical, whether to normalise community connectedness for "commconn". Defaults to TRUE. Will be ignored for "commweight". |
The "commweight" type weights each community that a node belongs to by how similar that community is to each of the other communities to which the node also belongs.
For node the community centrality is:
where the main sum is over the N communities to which node belongs, and
refers to the similarity between community
and
, calculated as the Jaccard coefficient for the number of shared nodes between each community pair, and this is averaged over the
communities paired with community
and in which node
jointly belongs.
The "commconn" type weights each community that a node belongs to by how many connections the community forms outside of itself relative to how many connections the community has within itself (the inverse of modularity), so that nodes that belong to more highly connecting communitites will receive a higher community centrality score. For node i the community centrality is:
where is the number of edges node
has in community
,
is the number of edges community
makes outside of itself normalised by the number of nodes in community
multiplied by the average degree in the network, and
is the number of edges within community
normalised by the total number possible.
For more detail see 'linkcomm' package and Community Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Code obtained from 'linkcomm' package.
Kalinka, Alex T., and Pavel Tomancak. "linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type." Bioinformatics 27.14 (2011).
## Not run: g <- random.graph.game(20, 3/10) communitycent(g) ## End(Not run)
## Not run: g <- random.graph.game(20, 3/10) communitycent(g) ## End(Not run)
The cross-clique connectivity of a node is the number of cliques to which belongs. A node with a high
value is called a highly cross-connected node.
crossclique(graph, vids = V(graph))
crossclique(graph, vids = V(graph))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
Note: Directed graph considered as undirected ones and multiple edges and loops are ignored.
More detail at Cross-Clique Connectivity
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Faghani, M., and U. Nguyen. "A Study of XSS Worm Propagation and Detection Mechanisms in Online Social Networks." (2013): 1-1.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) crossclique(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) crossclique(g)
Decay centrality of a given vertex of a graph G is define as:
where denotes the distance between
and
and
is a parameter.
decay(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, decay = 0.5)
decay(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, decay = 0.5)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
decay |
A decay parameter which the default is 0.5. |
Decay centrality is a centrality measure based on the proximity between a choosen vertex and every other vertex weighted by the decay.
More detail at Decay Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Jana Hurajova, Silvia Gago and Tomas Madaras, Decay Centrality, 15th Conference of Kosice Mathematicians. Herl'ny 2.-5. aprila 2014.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) decay(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) decay(g)
The diffusion degree of a node is defined as the cumulative contribution score of the node itself and its neighbors.
diffusion.degree(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE, lambda = 1)
diffusion.degree(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE, lambda = 1)
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
loops |
Logical; whether the loop edges are also counted. |
lambda |
Possibly a numeric vector giving propagation probability of vertices. The default is 1 for all vertices. |
Diffusion degree of node
defined as:
where is degree of of vertex and
is propagation probability of vertex.
In a diffusion process, a node with propagation probability
, can activate its neighbor
with probability
.
When the diffusion process propagates to the next level, active neighbors of will try to activate their inactive neighbors. Thus the cumulative contribution in the diffusion process by neighbors of
will be maximized when all of its neighbors will be activated in the previous step.
More detail at Diffusion Degree
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Pal, Sankar K., Suman Kundu, and C. A. Murthy. "Centrality Measures, Upper Bound, and Influence Maximization in Large Scale Directed Social Networks." Fundamenta Informaticae 130.3 (2014): 317-342.
g <- graph(c(1,2,2,3,3,4,4,2)) diffusion.degree(g)
g <- graph(c(1,2,2,3,3,4,4,2)) diffusion.degree(g)
The score of node ,
, is defined to be
:
where for some .
dmnc(graph, vids = V(graph), mode = c("all", "out", "in"), epsilon = 1.67)
dmnc(graph, vids = V(graph), mode = c("all", "out", "in"), epsilon = 1.67)
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
epsilon |
|
See Maximum Neighborhood Component (MNC)
More detail at DMNC-Density of Maximum Neighborhood Component
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lin, Chung-Yen, et al. "Hubba: hub objects analyzer-a framework of interactome hubs identification for network biology." Nucleic acids research 36.suppl 2 (2008): W438-W443.
g <- random.graph.game(20, 3/10) dmnc(g)
g <- random.graph.game(20, 3/10) dmnc(g)
Entropy centrality measures centrality of nodes depending on their contribution to the entropy of the graph.
entropy(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
entropy(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
The centrality entropy measures of a graph G, defined as:
where where
is the number of geodesic paths from node
to all the other nodes in the graph and
is the total number of geodesic paths M that exists across all the nodes in the graph.
The centrality entropy provides information on the degree of centrality for a node in the graph. Those nodes that will split the graph in two or that will reduce substantially the number of paths available to reach other nodes when removed, will have a higher impact in decreasing the total centrality entropy of a graph.
More detail at Entropy Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Ortiz-Arroyo, Daniel, and DM Akbar Hussain. "An information theory approach to identify sets of key players." Intelligence and Security Informatics. Springer Berlin Heidelberg, 2008. 15-26.
g <- erdos.renyi.game(10, 1/10) entropy(g)
g <- erdos.renyi.game(10, 1/10) entropy(g)
For a node in G,
is defined as:
Given a threshold , we create 1000 reduced network by asigning a random number between 0 and 1 to every edge and remove edges if their associated random numbers are less than the threshold.
Let the be the reduced network generated at the
time reduced process. If nodes
and
are connected in
, set
to 1; otherwise
.
epc(graph, vids = V(graph), threshold = 0.5)
epc(graph, vids = V(graph), threshold = 0.5)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
threshold |
The threshold parameter, for filter graph and create reduced one, which must be between 0 and 1. The default is 0.5. |
For an interaction network G, assign a removing probability p to every edge. Let G'be a realization of the random edge removing from G. If nodes and
are connected in G', set
be 1, otherwise set
be 0. The percolated connectivity of
and
,
, is defined to be the average of
over realizations. The size of percolated component containing node
,
, is defined to be the sum of
over nodes
. The score of node
,
, is defined to be
.
More detail at EPC-Edge Percolated Component
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lin, Chung-Yen, et al. "Hubba: hub objects analyzer-a framework of interactome hubs identification for network biology." Nucleic acids research 36.suppl 2 (2008): W438-W443.
Chen, Shu-Hwa, et al. "cyto-Hubba: A Cytoscape plug-in for hub object analysis in network biology." 20th International Conference on Genome Informatics. 2009.
g <- graph(c(1,2,2,3,3,4,4,2)) epc(g)
g <- graph(c(1,2,2,3,3,4,4,2)) epc(g)
Geodesic K-path centrality counts neighbours as those that are on a geodesic path less than "k" away.
geokpath(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, k = 3)
geokpath(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL, k = 3)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
k |
The k parameter. The default is 3. |
More detail at Geodesic K-Path Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Borgatti, Stephen P., and Martin G. Everett. "A graph-theoretic perspective on centrality." Social networks 28.4 (2006): 466-484.
g <- barabasi.game(100) geokpath(g)
g <- barabasi.game(100) geokpath(g)
Hubbell centrality defined as:
where is some exogeneous input and
is a weight matrix derived from the adjancancy matrix
.
hubbell(graph, vids = V(graph), weights = NULL, weightfactor = 0.5)
hubbell(graph, vids = V(graph), weights = NULL, weightfactor = 0.5)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
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). |
weightfactor |
The weight factorLogical which must be greater than 0. The defualt is 0.5. |
This centrality value is defined by means of a weighted and loop allowed network. The weighted adjacency matrix of a network G is asymmetric and contains real-valued weights for each edge.
More detail at Hubbell Index
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Algorithm adapted from CentiLib (Grabler, Johannes, 2012).
Hubbell, Charles H. "An input-output approach to clique identification." Sociometry (1965): 377-399.
Grabler, Johannes, Dirk Koschutzki, and Falk Schreiber. "CentiLib: comprehensive analysis and exploration of network centralities." Bioinformatics 28.8 (2012): 1178-1179.
g <- barabasi.game(100) hubbell(g)
g <- barabasi.game(100) hubbell(g)
The Katz centrality for node i is:
where is the adjacency matrix of the graph G with eigenvalues
. The parameter
controls the initial centrality and
.
katzcent(graph, vids = V(graph), alpha = 0.1)
katzcent(graph, vids = V(graph), alpha = 0.1)
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
alpha |
The alpha parameter, which must be between 0.0-0.2. The default is 0.1. |
Katz centrality computes the relative influence of a node within a network by measuring the number of the immediate neighbors (first degree nodes) and also all other nodes in the network that connect to the node under consideration through these immediate neighbors.
More detail at Katz Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Algorithm adapted from CentiBin with thanks Dirk Koschutzki. (Junker, Bjorn H. 2006).
Newman, Mark. Networks: an introduction. Oxford University Press, 2010.
Junker, Bjorn H., Dirk Koschutzki, and Falk Schreiber. "Exploration of biological network centralities with CentiBiN." BMC bioinformatics 7.1 (2006): 219.
g <- barabasi.game(20) katzcent(g)
g <- barabasi.game(20) katzcent(g)
The Laplacian centrality with respect to v is:
where G is a graph of vertices,
is the set of neighbors of
in G and
is the degree of
in G.
laplacian(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
laplacian(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
loops |
Logical; whether the loop edges are also counted. |
Laplacian centrality is a simple centrality measure that can be calculated in linear time. It is defined as the drop in the Laplacian energy (i.e. sum of squares of the eigenvalues in the Laplacian matrix) of the graph when the vertex is removed.
More detail at Laplacian Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Qi, Xingqin, et al. "Laplacian centrality: A new centrality measure for weighted networks." Information Sciences 194 (2012): 240-253.
g <- graph(c(1,2,2,3,3,4,4,2)) laplacian(g)
g <- graph(c(1,2,2,3,3,4,4,2)) laplacian(g)
This function find the LeaderRank in a directed graph
leaderrank(graph, vids = V(graph))
leaderrank(graph, vids = V(graph))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
Given a network consisting of N nodes and M directed links, a ground node connected with every node by a bidirectional link is added. Then, the network becomes strongly connected and consists of N+1 nodes and M+2N links (a bidirectional link is counted as two links with inverse directions). LeaderRank directly applies the standard random walk process to determine the score of every node. Accordingly, if the score of node at time step
is
, the dynamics can be described by an iterative process as:
where is the element of the corresponding (N + 1)-dimensional adjacency matrix, which equals 1 if there is a directed link from
to
and 0 otherwise, and
is the out-degree of node
. The process starts with the initialization where all node scores are 1 and will soon converge to a unique steady state denoted as
. LeaderRank ranks all nodes according to
, and the nodes with larger final scores are considered to be more influential in spreading.
More detail at LeaderRank
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lu, Linyuan, et al. "Leaders in social networks, the delicious case." PloS one 6.6 (2011): e21202.
g <- graph(c(1,2,2,3,3,4,4,2)) leaderrank(g)
g <- graph(c(1,2,2,3,3,4,4,2)) leaderrank(g)
Leverage centrality considers the degree of a node relative to its neighbors and operates under the principle that a node in a network is central if its immediate neighbors rely on that node for information.
leverage(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
leverage(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
loops |
Logical; whether the loop edges are also counted. |
Leverage centrality of vertex defined as:
where is degree of a given node
,
is degree of each of its neighbors and
is all neighbors.
A node with negative leverage centrality is influenced by its neighbors, as the neighbors connect and interact with far more nodes. A node with positive leverage centrality, on the other hand, influences its neighbors since the neighbors tend to have far fewer connections.
More detail at Leverage Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Joyce, Karen E., et al. "A new measure of centrality for brain networks." PLoS One 5.8 (2010): e12200.
g <- graph(c(1,2,2,3,3,4,4,2)) leverage(g)
g <- graph(c(1,2,2,3,3,4,4,2)) leverage(g)
Lin centrality of a node with a nonempty coreachable set is:
where
lincent(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
lincent(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
Lin centrality consider closeness not the inverse of a sum of distances, but rather the inverse of the average distance, which entails a first multiplication by the number of coreachable nodes. This change normalizes closeness across the graph. Now, however, we want nodes with a larger coreachable set to be more important, given that the average distance is the same, so we multiply again by the number of coreachable nodes. Nodes with an empty coreachable set have centrality 1 by definition.
More detail at Lin Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lin, Nan. Foundations of social research. New York: McGraw-Hill, 1976.
Boldi, Paolo, and Sebastiano Vigna. "Axioms for centrality." Internet Mathematics just-accepted (2014): 00-00.
g <- graph(c(1,2,2,3,3,4,4,2)) lincent(g)
g <- graph(c(1,2,2,3,3,4,4,2)) lincent(g)
The l-index or lobby index of a node is the largest integer
such that
has at least
neighbors with a degree of at least
.
lobby(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
lobby(graph, vids = V(graph), mode = c("all", "out", "in"), loops = TRUE)
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
loops |
Logical; whether the loop edges are also counted. |
For more detail at Lobby Index
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Korn, A., A. Schubert, and A. Telcs. "Lobby index in networks." Physica A: Statistical Mechanics and its Applications 388.11 (2009): 2221-2226.
g <- random.graph.game(20, 3/10) lobby(g)
g <- random.graph.game(20, 3/10) lobby(g)
The Markov centrality score uses the concept of a random walk through the graph to calculate the centrality of each vertex.
markovcent(graph, vids = V(graph))
markovcent(graph, vids = V(graph))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the markov centrality values are returned. |
The method uses the mean first-passage time from every vertex to every other vertex to produce a score for each vertex.
More detail at Markov Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Original code from Bioconductor SANTA package (Cornish AJ, 2014)
White, S. & Smyth, P. Algorithms for estimating relative importance in networks. Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, 2003. ACM, 266-275.
Cornish AJ and Markowetz F (2014). "SANTA: Quantifying the Functional Content of Molecular Networks." PLOS Computational Biology, 10(9), pp. e1003808. http://dx.doi.org/10.1371/journal.pcbi.1003808.
g <- graph(c(1,2,2,3,3,4,4,2)) markovcent(g)
g <- graph(c(1,2,2,3,3,4,4,2)) markovcent(g)
Maximum Neighborhood Component defined as:
where where MC(v) is a maximum connected component of the and
is the induced subgraph of G by
and
is neighborhoods of node
.
mnc(graph, vids = V(graph), mode = c("all", "out", "in"))
mnc(graph, vids = V(graph), mode = c("all", "out", "in"))
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
The neighborhood of a node , nodes adjacent to
, induce a subnetwork
. The score of node
,
, is defined to be the size of the maximum connected component of
. The neighborhood
is the set of nodes adjacent to
and does not contain node
.
More detail at MNC-Maximum Neighborhood Component
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lin, Chung-Yen, et al. "Hubba: hub objects analyzer-a framework of interactome hubs identification for network biology." Nucleic acids research 36.suppl 2 (2008): W438-W443.
g <- random.graph.game(20, 3/10) mnc(g)
g <- random.graph.game(20, 3/10) mnc(g)
The pairwise disconnectivity index of vertex ,
defined as:
where is the total number of ordered pairs of vertices in a network that are connected by at least one directed path of any length. It is supposed that
> 0, i.e., there exists at least one edge in the network that links two different vertices.
is the number of ordered pairs that are still connected after removing vertex
from the network, via alternative paths through other vertices.
pairwisedis(graph, vids = V(graph))
pairwisedis(graph, vids = V(graph))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
The pairwise disconnectivity defined as index of vertex ,
, as the fraction of those initially connected pairs of vertices in a network which become disconnected if vertex
is removed from the network. The pairwise disconnectivity index quantifies how crucial an individual element is for sustaining the communication ability between connected pairs of vertices in a network that is displayed as a directed graph.
More detail at Pairwise Disconnectivity Index
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Potapov, Anatolij P., Bjorn Goemann, and Edgar Wingender. "The pairwise disconnectivity index as a new metric for the topological analysis of regulatory networks." BMC bioinformatics 9.1 (2008): 227.
g <- graph(c(1,2,2,3,3,4,4,2)) pairwisedis(g)
g <- graph(c(1,2,2,3,3,4,4,2)) pairwisedis(g)
The radiality is a node centrality index and will give high centralities to vertices that are a short distance to every other vertex in its reachable neighborhood compared to its diameter.
radiality(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
radiality(graph, vids = V(graph), mode = c("all", "out", "in"), weights = NULL)
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 constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. 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). |
Radiality centrality defined as:
where is diameter of graph G with
vertices and
is distance between vertex
and
.
The radiality of a node is calculated by computing the shortest path between the node
and all other nodes in the graph. The value of each path is then subtracted by the value of the diameter +1 (G+1) and the resulting values are summated. Finally, the obtained value is divided for the number of nodes -1 (n-1). The radiality should be always compared to the closeness and to the eccentricity: a node with high eccentricity + high closeness+ high radiality is a consistent indication of a high central position in the graph.
More detail at Radiality Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Wolfram Research, Inc., Mathematica, Version 10.0, Champaign, IL (2014). http://reference.wolfram.com/language/ref/RadialityCentrality.html
Scardoni, G., Laudanna, C., Tosadori, G., Fabbri, F. & Faizaan, M. CentiScaPe: Network centralities for Cytoscape. http://www.cbmc.it/~scardonig/centiscape/CentiScaPefiles/CentralitiesTutorial.pdf
g <- graph(c(1,2,2,3,3,4,4,2)) radiality(g)
g <- graph(c(1,2,2,3,3,4,4,2)) radiality(g)
The Stochastic Approach for Link-Structure Analysis (SALSA) is combination of HITS and PageRank which creates a neighborhood graph using authority and hub pages and links and create a bipartite graph of the authority and hub pages in the neighborhood graph.
salsa(graph, vids = V(graph), score = c("hub", "authority"))
salsa(graph, vids = V(graph), score = c("hub", "authority"))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
score |
Character constant, gives which score should be calculated and must be one of 'hub' or 'authority'. The default is 'hub'. |
More detail at SALSA
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Lempel, Ronny, and Shlomo Moran. "SALSA: the stochastic approach for link-structure analysis." ACM Transactions on Information Systems (TOIS) 19.2 (2001): 131-160.
g <- barabasi.game(10) salsa(g)
g <- barabasi.game(10) salsa(g)
The local centrality of node
is defined as:
where
and is the set of the nearest neighbors of node
and
is the number of the nearest and the next nearest neighbors of node
.
semilocal(graph, vids = V(graph), mode = c("all", "out", "in"))
semilocal(graph, vids = V(graph), mode = c("all", "out", "in"))
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 constatnt, it specifies how to use the direction of the edges if a directed graph is analyzed. For 'out' only the outgoing edges are followed. For 'in' all vertices from which the source vertex is reachable in at most order steps are counted. 'all' ignores the direction of the edges. This argument is ignored for undirected graphs. |
The local centrality is proposed aiming at identifying the influencers in undirected network, it can be applied to directed network as well with a modified definition of . Of course, for directed network,
should be the number of the nearest and next nearest upstream nodes of node
.
Local centrality measure is likely to be more effective to identify influential nodes than degree centrality measure as it utilizes more information, while it has much lower computational complexity than the betweenness and closeness centralities.
More detail at Semi_Local Centrality
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Chen, Duanbing, et al. "Identifying influential nodes in complex networks." Physica a: Statistical mechanics and its applications 391.4 (2012): 1777-1787.
g <- barabasi.game(10) semilocal(g)
g <- barabasi.game(10) semilocal(g)
The topological coefficient is a relative measure for the extent to which a node shares neighbors with other nodes.
topocoefficient(graph, vids = V(graph))
topocoefficient(graph, vids = V(graph))
graph |
The input graph as igraph object |
vids |
Vertex sequence, the vertices for which the centrality values are returned. Default is all vertices. |
Topological coefficient of a node
with
neighbors defined as:
where is defined for all nodes
that share at least one neighbor with
. The value
is the number of neighbors shared between the nodes
and
, plus one if there is a direct link between
and
.
Nodes that have one or no neighbors are assigned a topological coefficient of zero.
More detail at Topological Coefficient
A numeric vector contaning the centrality scores for the selected vertices.
Mahdi Jalili [email protected]
Assenov, Yassen, et al. "Computing topological parameters of biological networks." Bioinformatics 24.2 (2008): 282-284.
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) topocoefficient(g)
g <- graph(c(1,2,2,3,3,4,4,2), directed=FALSE) topocoefficient(g)