Returns the set of maximal cliques of a chordal graph.
The algorithm breaks the graph in connected components and performs a maximum cardinality search in each component to get the cliques.
Parameters : | G : graph
|
---|---|
Returns : | cliques : A set containing the maximal cliques in G. |
Raises : | NetworkXError :
|
Examples
>>> import networkx as nx
>>> e= [(1,2),(1,3),(2,3),(2,4),(3,4),(3,5),(3,6),(4,5),(4,6),(5,6),(7,8)]
>>> G = nx.Graph(e)
>>> G.add_node(9)
>>> setlist = nx.chordal_graph_cliques(G)