View source: R/balance_scores.R
balance_score | R Documentation |
Implements several indices to assess the balancedness of a network.
balance_score(g, method = "triangles")
g |
igraph object with a sign edge attribute. |
method |
string indicating the method to be used. See details for options |
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)
where \lambda_i
are the eigenvalues of the
signed adjacency matrix and \mu_i
of the unsigned adjacency matrix. Maximal (=1) if all walks are balanced.
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.
numeric balancedness score between 0 and 1
David Schoch
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")
balance_score(g, method = "walk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.