Learn R Programming

ggm (version 0.5)

cliques: Cliques of an undirected graph

Description

Finds the cliques of an undirected graph.

Usage

cliques(gmat)

Arguments

gmat
a square Boolean matrix with dimnames, representing the edge matrix of an undirected graph.

Value

  • a list of vectors of integers representing subsets of the set of nodes.

Details

The cliques of a graph are the subsets of nodes which induce a maximally complete subgraph. The algorithm is NP-complete in general.

References

Lauritzen, S. (1996). Graphical models. Oxford: Clarendon Press.

See Also

UG,bd

Examples

Run this code
## Two cliques
u <- UG(~ a*b*c + c*d*e*g)
u
cliques(u)

## the same (note that the formula is not of a graphical model)
u <- UG(~ a*b+b*c+c*a + c*d*e*g)
u
cliques(u)

Run the code above in your browser using DataLab