By executing Networkx triadic_census Algorithm, I'm able to get the dictionary of the number of nodes falling on each type of triadic census
triad_census_social=nx.triadic_census(social_graph.to_directed())
Now, I'd like to return the list of triads, who all follow the pattern of census code "201", "120U", or any one of the 16 existing types. How can I get those node lists under a census count?
There is no function in
networkx
that allow you to do it, so you should implement it manually. I modified thenetworkx.algorithms.triads
code for you to return triads, not their count:Building on vurmux's answer (by fixing the '102' and '012' triads):
Result
In agreement with nx.triadic_census