2010-09-13から1日間の記事一覧

python で有向ネットワークの三角形の取り出し。

python で有向ネットワークの三角形の取り出し。test.net 1 2 2 3 3 1 1 5 5 1 import networkx as nx G=nx.read_edgelist("test.net",create_using=nx.DiGraph()); for i in G.nodes(): outs=G.successors(i); ins=G.predecessors(i); for j in outs: for k…