Use this if you are using igraph from R
The vertex connectivity of a graph or two vertices, this is recently also called group cohesion.
vertex_connectivity(graph, source = NULL, target = NULL, checks = TRUE) ## S3 method for class 'igraph' cohesion(x, checks = TRUE, ...)
The input graph.
The id of the source vertex, for
The id of the target vertex, for
Logical constant. Whether to check that the graph is connected and also the degree of the vertices. If the graph is not (strongly) connected then the connectivity is obviously zero. Otherwise if the minimum degree is one then the vertex connectivity is also one. It is a good idea to perform these checks, as they can be done quickly compared to the connectivity calculation itself. They were suggested by Peter McMahan, thanks Peter.
The vertex connectivity of two vertices (
a directed graph is the minimum number of vertices needed to remove from the
graph to eliminate all (directed) paths from
vertex_connectivity calculates this quantity if both the
target arguments are given and they're not
The vertex connectivity of a graph is the minimum vertex connectivity of all
(ordered) pairs of vertices in the graph. In other words this is the minimum
number of vertices needed to remove to make the graph not strongly
connected. (If the graph is not strongly connected then this is zero.)
vertex_connectivity calculates this quantitty if neither the
target arguments are given. (Ie. they are both
A set of vertex disjoint directed paths from
is a set of directed paths between them whose vertices do not contain common
vertices (apart from
target). The maximum number of
vertex disjoint paths between two vertices is the same as their vertex
connectivity in most cases (if the two vertices are not connected by an
The cohesion of a graph (as defined by White and Harary, see references), is
the vertex connectivity of the graph. This is calculated by
These three functions essentially calculate the same measure(s), more
vertex_connectivity is the most general, the other two are
included only for the ease of using more descriptive function names.
A scalar real value.
Gabor Csardi email@example.com
White, Douglas R and Frank Harary 2001. The Cohesiveness of Blocks In Social Networks: Node Connectivity and Conditional Density. Sociological Methodology 31 (1) : 305-359.
g <- barabasi.game(100, m=1) g <- delete_edges(g, E(g)[ 100 %--% 1 ]) g2 <- barabasi.game(100, m=5) g2 <- delete_edges(g2, E(g2)[ 100 %--% 1]) vertex_connectivity(g, 100, 1) vertex_connectivity(g2, 100, 1) vertex_disjoint_paths(g2, 100, 1) g <- sample_gnp(50, 5/50) g <- as.directed(g) g <- induced_subgraph(g, subcomponent(g, 1)) cohesion(g)