Search code examples
networkx

about nodelist in triadic_census for netwrokx


I want to get triadic_census in a single node, this is the code example:

import netwrokx as nx
G = nx.DiGraph([("b", "a"), ("b","c")])
print(nx.triadic_census(G))
print(nx.triadic_census(G,nodelist=["c"]))

But the result is different from what I think. this is the result of code:

{'003': 0, '012': 0, '102': 0, '021D': 1, '021U': 0, '021C': 0, '111D': 0, '111U': 0, '030T': 0, '030C': 0, '201': 0, '120D': 0, '120U': 0, '120C': 0, '210': 0, '300': 0}
{'003': 0, '012': 0, '102': 0, '021D': 0, '021U': 0, '021C': 0, '111D': 0, '111U': 0, '030T': 0, '030C': 0, '201': 0, '120D': 0, '120U': 0, '120C': 0, '210': 0, '300': 0}

I think Node C should also be part of 021D, i want to know whether the parameters I have entered are not right?


Solution

  • The problem has been fixed networkx pr