Thanks.
R.
You'll need to write a version of max_clique_graph that does this.
Here is a 5 minute solution that you can modify:
Aric
import networkx
def max_clique_graph(cliques,min_size=3):
"""
Create the maximal clique graph of a graph.
It finds the maximal cliques and treats these as nodes.
The nodes are connected if they have common members in
the original graph. Theory has done a lot with clique
graphs, but I haven't seen much on maximal clique graphs.
"""
G=networkx.Graph()
G.name='max clique graph'
for i in range(len(cliques)):
c=cliques[i]
if len(c)<min_size:
continue
label=' '.join(map(str,c))
G.add_node(label)
for j in range(i,len(cliques)):
other=cliques[j]
if len(other)<min_size:
continue
intersect=[w for w in c if w in other]
if intersect: # Not empty list, make connection
G.add_edge(label,' '.join(map(str,other)))
return G
if __name__ == "__main__":
G=networkx.generators.gnm_random_graph(10,20)
cliques=networkx.find_cliques(G)
H=max_clique_graph(cliques)
How do I cite this in publications?
On Aug 7, 4:39 pm, Aric Hagberg <hagb...@lanl.gov> wrote:
Right now the best thing to do is cite the web page.
I'll put a note on the web site for the citation information
for future reference.
Aric