nwtriads

Triad census of a network

Syntax

nwtriads
[netname]
[,
plot
name(string)]
   
plot Draw a bar chart of the 16 MAN-category counts
name(string) Name for the graph created by plot; default = triads

Description

Returns the triad census of the network (or a list of networks). This is a way to characertize a network based on its triads.

Each unique triad (triple of nodes i, j, and k) in a directed network can be one of the following:

  • 003 = i,j,k, empty triad.
  • 012 = i->j, k, triad with a single directed edge.
  • 102 = i<->j, k, triad with a reciprocated connection between two vertices.
  • 021D = i<-j->k, triadic out-star.
  • 021U = i->j<-k triadic in-star.
  • 021C = i->j->k, directed line.
  • 111D = i<->j<-k
  • 111U = i<->j->k.
  • 030T = i->j<-k, i->k.
  • 030C = i<-j<-k, i->k.
  • 201 = i<->j<->k.
  • 120D = i<-j->k, i<->k.
  • 120U = i->j<-k, i<->k.
  • 120C = i->j->k, i<->k.
  • 210 = i->j<->k, i<->k.
  • 300 = i<->j<->k, i<->k, complete triad.

This is the so called MAN notation. As in nwdyads it characterized a triad by the number of 1) mutual dyads, 2) asymmetric dyads and 3) null dyads. For example, MAN = 102 means that there is one mutual dyad and two null dyads.

plot draws a bar chart of the 16 category counts, in the same fixed MAN order the text table above already uses (not sorted by count), via this package’s own established preserve/rebuild-a-plotting-dataset/restore convention - the same one nwcug’s own plot option uses for its null-distribution histogram. Grayscale by design, matching every other plot this package produces.

Examples

. nwwebuse glasgow, nwclear

. nwtriads glasgow3

    Triad census:  glasgow3

       003 |       012 |      021D |      021U |
-----------+-----------+-----------+-----------+
     16086 |      1401 |         4 |         8 |

      021C |      030T |      030C |       102 |
-----------+-----------+-----------+-----------+
         7 |         1 |         0 |      1969 |

      120D |      120U |      120C |      111D |
-----------+-----------+-----------+-----------+
         3 |        28 |        33 |         4 |

      111U |       201 |       210 |       300 |
-----------+-----------+-----------+-----------+
         1 |        17 |        26 |        12 |

     Transitivity: .4830508474576271

This example shows, e.g. that in the glasgow3 network, there are 12 triads where all nodes i, j and k are directely connected with each other.

Supported network types

Binary: yes. Directed: yes - this is the command’s native case; the full 16-type MAN classification requires a genuine directed/asymmetric-dyad distinction. Undirected: the command still runs, but 12 of the 16 categories (everything except _003/_102/_201/_300) are not meaningful for undirected data and reliably return 0, since an undirected network has no asymmetric ties by construction - nwtriads prints a note to this effect when called on an undirected network. Weighted: not applicable (a triad census is inherently a binary/dichotomous count). Signed: not checked. Two-mode: same as for the bipartite graph read as a one-mode network (valid; no mode-specific normalisation); the census counts the triples of the bipartite graph (igraph::triad_census); it has no triangle, so the transitivity is 0; closure in a two-mode network is nwclustering (its default on a two-mode network).

See also

  • nwdyads

  • last certified : 24 Aug 2026


nwcommands version 3.17.6, 9 November 2026 (check your installed version)


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.