chordal_cliques

chordal_cliques#

graph_tool.structure.chordal_cliques(g)[git][source]#

Return the maximal cliques of a chordal graph.

Parameters:
gGraph

Chordal graph to be used. Edge directions are ignored.

Returns:
cliqueslist of numpy.ndarray

The vertices of every maximal clique.

See also

is_chordal

Test for chordal graphs

maximal_cliques

Maximal cliques of a general graph

junction_tree

Tree of the maximal cliques of a chordal completion

Notes

A chordal graph has at most \(V\) maximal cliques, which are found from the order of maximum cardinality search [blair-introduction-1993] in time \(O(V + E)\). The treewidth of a chordal graph is the size of its largest clique minus one. A ValueError is raised if the graph is not chordal (see is_chordal()); the maximal cliques of general graphs are given by maximal_cliques().

References

[blair-introduction-1993]

Jean R. S. Blair and Barry Peyton, “An introduction to chordal graphs and clique trees”, in Graph Theory and Sparse Matrix Computation, Springer, 1-29 (1993), DOI: 10.1007/978-1-4613-8369-7_1 [sci-hub, @tor]

Examples

>>> g = gt.circular_graph(6)
>>> g.add_edge_list(gt.chordal_completion(g))
>>> cs = gt.chordal_cliques(g)
>>> print(len(cs), max([len(c) for c in cs]) - 1)
4 2