Counts the number of all possible signed triangles (+++),(++-), (+--) and (---)

count_signed_triangles(g)

Arguments

g

igraph object with a sign edge attribute.

Value

counts for all 4 signed triangle types

See also

Author

David Schoch

Examples

library(igraph)
g <- graph.full(4)
E(g)$sign <- c(-1, 1, 1, -1, -1, 1)
count_signed_triangles(g)
#> +++ ++- +-- --- 
#>   1   0   3   0