I have a networkx graph G, say for example
import networkx as nx
G=nx.erdos_renyi_graph(100,.1)
I would like to count in an efficient way to the number of open triples, that is, the frequency of the pattern: A is connected to B, B is connected to C but A and B are not connected.
Is there a clever way to exploit a built in function for this?