Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.algorithms.triads.all_triplets

all_triplets(G)[source]

Returns a generator of all possible sets of 3 nodes in a DiGraph.

Parameters
Gdigraph

A NetworkX DiGraph

Returns
tripletsgenerator of 3-tuples

Generator of tuples of 3 nodes