maximal_cliques#

causalbase.graph.maximal_cliques(adj, order)[source]#

Extract the maximal cliques of a chordal graph.

Each node together with its neighbours earlier in order is a clique of a chordal graph; the ones contained in another are dropped.

Parameters:
adjnp.ndarray

Symmetric boolean adjacency matrix of a chordal (triangulated) undirected graph.

orderlist[int]

A maximum cardinality ordering of adj, as returned by mcs_order().

Returns:
list[frozenset[int]]

The maximal cliques of the graph. No returned clique is a subset of another.