These functions return values or vectors relating to how cohesive a network is:

  • net_by_density() measures the ratio of ties to the number of possible ties.

  • net_by_compactness() measures the average closeness of all pairs of nodes in the network.

  • net_by_components() measures the number of components in the network, either strongly or weakly connected.

  • net_by_independence() measures the independence number, or size of the largest independent set in the network.

net_by_density(.data)

net_by_compactness(.data)

net_by_components(.data, connectivity = c("strong", "weak"))

net_by_independence(.data)

Arguments

.data

A network object of class stocnet, igraph, tbl_graph, network, or similar. Internally any of these will be coerced to an efficient implementation. For more information on possible coercions, see e.g. manynet::as_stocnet().

connectivity

Character string, "weak" treats a directed network's components as if the network were undirected, and "strong" requires ties in both directions between members. This is ignored for undirected networks, where the two notions coincide. Note that the default differs by function: functions that assert or count connectedness default to "strong", while functions that scope or split a network into components default to "weak".

Value

A network_measure numeric score.

The object also carries the measure it computed, the range its values can fall within, and whether and how those values were normalized. These are shown as a one-line header when the object is printed. Where a measure offers a choice between several ways of counting the same thing, it also carries the variant it used. All can be retrieved with attr().

Signed networks

net_by_compactness() measures distance, and a negative tie is hostility rather than a channel along which cohesion travels. Where the network is signed, it therefore considers only the positive ties. Use manynet::to_unsigned() first to control this yourself. The other measures in this topic do not depend on distance, and so use every tie whatever its sign.

Multilevel networks

A multilevel network reports itself as two-mode, but holds ties within a mode as well as between them, so it cannot be projected onto one mode. net_by_independence() therefore measures a multilevel network whole, which is the quantity wanted in any case. The projection remains for genuine two-mode networks, where no two nodes of one mode are ever tied and the unprojected answer would be trivially the larger mode.

Compactness

Compactness is the average of the reciprocal distances between all pairs of nodes: $$C = \frac{\sum_{i \neq j} \frac{1}{d(i,j)}}{N(N-1)}$$ where unreachable pairs contribute \(0\). Its complement, \(1 - C\), is sometimes called breadth.

Compactness is more discriminating than net_by_connectedness(), which counts only whether pairs are reachable at all. Two networks in which every node can reach every other are equally connected, but the one in which they do so in fewer steps is more compact. A complete network scores 1, and an empty network 0. It is the network-level counterpart of node_by_harmonic(), such that net_by_compactness(ison_adolescents) == mean(node_by_harmonic(ison_adolescents, normalized = TRUE, cutoff = -1)).

Note that this quantity is known in the physics literature as the global efficiency of a network (Latora and Marchiori 2001). It is named compactness here for the social network analytic tradition, partly to avoid confusion with the unrelated net_by_efficiency() (Krackhardt) and node_by_efficiency() (Burt).

References

On compactness

Borgatti, Stephen P., Martin G. Everett, Jeffrey C. Johnson, and Filip Agneessens. 2022. Analyzing Social Networks Using R, chapter 10. London: SAGE.

Latora, Vito, and Massimo Marchiori. 2001. "Efficient Behavior of Small-World Networks". Physical Review Letters 87(19): 198701. doi:10.1103/PhysRevLett.87.198701

Examples

net_by_density(ison_adolescents)
#> # Density, normalized [0, 1]
#> [1] 0.357
net_by_density(ison_southern_women)
#> # Density, normalized [0, 1]
#> [1] 0.353
net_by_compactness(ison_adolescents)
#> # Compactness, normalized [0, 1]
#> [1] 0.616
net_by_compactness(ison_southern_women)
#> # Compactness, normalized [0, 1]
#> [1] 0.515
net_by_components(fict_thrones)
#> # Number of components [1, Inf)
#> [1] 130
net_by_components(fict_thrones, connectivity = "weak")
#> # Number of components [1, Inf)
#> [1] 2
net_by_independence(ison_adolescents)
#> # Independence number [1, Inf)
#> [1] 4
net_by_independence(fict_actually)
#> # Independence number [1, Inf)
#> [1] 76