Implements several indices to assess the balancedness of a network.
balance_score(g, method = "triangles")
igraph object with a sign edge attribute.
string indicating the method to be used. See details for options
numeric balancedness score between 0 and 1
The method parameter can be one of
Fraction of balanced triangles. Maximal (=1) if all triangles are balanced.
\(\sum exp(\lambda_i) / \sum exp(\mu_i)\)
The frustration index assumes that the network can be partitioned into two groups, where intra group edges are positive and inter group edges are negative. The index is defined as the sum of intra group negative and inter group positive edges. Note that the problem is NP complete and only an upper bound is returned (based on simulated annealing). Exact methods can be found in the work of Aref. The index is normalized such that it is maximal (=1) if the network is balanced.
Estrada, E. (2019). Rethinking structural balance in signed social networks. Discrete Applied Mathematics.
Samin Aref, Mark C Wilson (2018). Measuring partial balance in signed networks. Journal of Complex Networks, 6(4): 566–595, https://doi.org/10.1093/comnet/cnx044
library(igraph)
g <- graph.full(4)
E(g)$sign <- c(-1, 1, 1, -1, -1, 1)
balance_score(g, method = "triangles")
#> [1] 1
balance_score(g, method = "walk")
#> [1] 1