bipartite
-
[NetworkX] Bipartite Graph(양분 그래프) 그리기Data & ML & AI/NetworkX 2022. 10. 27. 23:18
샘플 Bipartite 그래프 생성 import networkx as nx from networkx.algorithms import bipartite X = set([1,2,3,4,5,6,7,8]) Y = set(['A','B','C','D','E','F']) B = nx.Graph() B.add_nodes_from(X, bipartite=0) B.add_nodes_from(Y, bipartite=1) B.add_edges_from([ (1,'A'),(1,'B'),(2,'A'),(2,'B'),(2,'D'),(3,'C'),(3,'E'),(4,'A'),(4,'D'), (5,'C'),(5,'E'),(6,'C'),(6,'F'),(7,'E'),(7,'F'),(8,'E') ]) 일반적인 그래프 그리기(비교용) nx..