I have an undirected networkx graph as follows and I want to print triad census
of the graph. However, nx.triadic_census(G)
does not support undirected graphs.
import networkx as nx
G = nx.Graph()
G.add_edges_from(
[('A', 'B'), ('A', 'C'), ('D', 'B'), ('E', 'C'), ('E', 'F'),
('B', 'H'), ('B', 'G'), ('B', 'F'), ('C', 'G')])
Error: NetworkXNotImplemented: not implemented for undirected type
I am aware that there is only 4 isomorphic classes for undirected graphs (not 16 as directed graphs). Is there a way of getting the count of these 4 isomorphic classes using networkx?
I am not limited to networkx
and happy to receive answers using other libraries or other languages.
I am happy to provide more details if needed.