This function counts the different induced subgraphs of three vertices in a graph.
triad_census(graph)
A numeric vector, the subgraph counts, in the order given in the above description.
Triad census was defined by David and Leinhardt (see References below). Every triple of vertices (A, B, C) are classified into the 16 possible states:
A,B,C, the empty graph.
A->B, C, the graph with a single directed edge.
A<->B, C, the graph with a mutual connection between two vertices.
A<-B->C, the out-star.
A->B<-C, the in-star.
A->B->C, directed line.
A<->B<-C.
A<->B->C.
A->B<-C, A->C.
A<-B<-C, A->C.
A<->B<->C.
A<-B->C, A<->C.
A->B<-C, A<->C.
A->B->C, A<->C.
A->B<->C, A<->C.
A<->B<->C, A<->C, the complete graph.
This functions uses the RANDESU motif finder algorithm to find and count the
subgraphs, see motifs()
.
See also Davis, J.A. and Leinhardt, S. (1972). The Structure of Positive Interpersonal Relations in Small Groups. In J. Berger (Ed.), Sociological Theories in Progress, Volume 2, 218-251. Boston: Houghton Mifflin.
dyad_census()
for classifying binary relationships,
motifs()
for the underlying implementation.
g <- sample_gnm(15, 45, directed = TRUE)
triad_census(g)
#> [1] 90 198 21 20 21 57 11 15 12 5 0 2 1 2 0 0