cliques(graph, min=NULL, max=NULL)
largest.cliques(graph)
maximal.cliques(graph, min=NULL, max=NULL, subset=NULL, file=NULL)
maximal.cliques.count(graph, min=NULL, max=NULL, subset=NULL)
clique.number(graph)
NULL
means no limit, ie. it is the same as 0.NULL
means no limit.NULL
, then it must be a vector of vertex
ids, numeric or symbolic if the graph is named. The algorithm is run
from these vertices only, so only a subset of all maximal cliques is
returned. See the Eppstein paper for detailsNULL
, then it must be a file name, i.e. a
character scalar. The output of the algorithm is written to this
file. (If it exists, then it will be overwritten.) Each clique will
be a separate line in the file, given with the ncliques
, largest.cliques
and clique.number
return
a list containing numeric vectors of vertex ids. Each list element is
a clique. maximal.cliques
returns NULL
, invisibly, if its
file
argument is not NULL
. The output is written to the
specified file in this case.
clique.number
and maximal.cliques.count
return an
integer scalar.
cliques
find all complete subgraphs in the input graph, obeying
the size limitations given in the min
and max
arguments. largest.cliques
finds all largest cliques in the input graph. A
clique is largest if there is no other clique including more vertices.
maximal.cliques
finds all maximal cliques in the input graph.
A clique in maximal if it cannot be extended to a larger clique. The
largest cliques are always maximal, but a maximal clique is not
neccessarily the largest.
maximal.cliques.count
counts the maximal cliques.
clique.number
calculates the size of the largest clique(s).
The current implementation of these functions searches
for maximal independent vertex sets (see
independent.vertex.sets
) in the complementer graph.
independent.vertex.sets
# this usually contains cliques of size six
g <- erdos.renyi.game(100, 0.3)
clique.number(g)
cliques(g, min=6)
largest.cliques(g)
# To have a bit less maximal cliques, about 100-200 usually
g <- erdos.renyi.game(100, 0.03)
maximal.cliques(g)
Run the code above in your browser using DataLab