Introduction to Network Analysis in Python
Eric Ma
Data Carpentry instructor and author of nxviz package
find_cliques
finds all maximal cliquesimport networkx as nx G = nx.barbell_graph(m1=5, m2=1)
nx.find_cliques(G)
<generator object find_cliques at 0x1043f1f68>
list(nx.find_cliques(G))
[[4, 0, 1, 2, 3], [4, 5], [6, 8, 9, 10, 7], [6, 5]]
import networkx as nx
G = nx.barbell_graph(m1=5, m2=1)
nx.find_cliques(G)
<generator object find_cliques at 0x1043f1f68>
list(nx.find_cliques(G))
[[4, 0, 1, 2, 3], [4, 5], [6, 8, 9, 10, 7], [6, 5]]
import networkx as nx
G = nx.barbell_graph(m1=5, m2=1)
nx.find_cliques(G)
<generator object find_cliques at 0x1043f1f68>
list(nx.find_cliques(G))
[[4, 0, 1, 2, 3], [4, 5], [6, 8, 9, 10, 7], [6, 5]]
Introduction to Network Analysis in Python