Another suggestion then: there is the strict structural balance measure, that was designed for bisections, and that considers "---" triangles as imbalanced. And there is the generalized structural imbalance, which considers them as balanced, as this is required to partition the graph into more than 2 clusters.
As I understand it, your function balance_score computes the latter measure. Maybe it would be nice (and quite easy) to let the user compute the former.
Yeah this is good point. So far I just implemented some basic stuff there but I am definitely planning to extend that function. So thanks for this suggestion.
Another suggestion then: there is the strict structural balance measure, that was designed for bisections, and that considers "---" triangles as imbalanced. And there is the generalized structural imbalance, which considers them as balanced, as this is required to partition the graph into more than 2 clusters.
As I understand it, your function
balance_score
computes the latter measure. Maybe it would be nice (and quite easy) to let the user compute the former.