Skip to contents

Count the 16 types of triads in a directed network using MAN notation.

Usage

triad_census(x)

Arguments

x

A matrix, igraph object, or cograph_network

Value

A named numeric vector of length 16 giving the count of each MAN triad type, in the order listed under Details.

Details

Triad census is defined only for directed networks. Matrix input is built as directed; existing igraph and cograph inputs must already be directed.

MAN notation describes triads by:

  • M: number of Mutual (reciprocal) edges

  • A: number of Asymmetric edges

  • N: number of Null (absent) edges

The 16 triad types are: 003, 012, 102, 021D, 021U, 021C, 111D, 111U, 030T, 030C, 201, 120D, 120U, 120C, 210, 300

Examples

set.seed(1)
mat <- matrix(sample(0:1, 100, replace = TRUE), 10, 10)
diag(mat) <- 0
# igraph and sna also export triad_census(); qualify the call.
cograph::triad_census(mat)
#>  003  012  102 021D 021U 021C 111D 111U 030T 030C  201 120D 120U 120C  210  300 
#>    2   12    8    3    5    5   12   12    5    3   13    3    5   10   22    0