qpCliqueNumber(g, exact.calculation=TRUE, return.vertices=FALSE, approx.iter=100, verbose=TRUE, R.code.only)
graphNEL
object or an adjacency matrix of the given
undirected graph.exact.calculation=FALSE
.The lower bound on the maximum clique size is calculated by ranking the
vertices by their connectivity degree, put the first vertex in a set and
go through the rest of the ranking adding those vertices to the set that
form a clique with the vertices currently within the set. Once the entire
ranking has been examined a large clique should have been built and eventually
one of the largests ones. This process is repeated a number of times
(approx.iter
) each of which the ranking is altered with increasing
levels of randomness acyclically (altering 1 to $p$ vertices and again). Larger
values of approx.iter
should provide tighter lower bounds although it has
been proven that no polynomial time algorithm can approximate the maximum
clique size within a factor of $n^\epsilon$ ($\epsilon > 0$), unless P=NP
(Feige et al, 1991; Pardalos and Xue, 1994).
Feige, U., Goldwasser, S., Lov\'asz, L., Safra, S. and Szegedy, M. Approximating the maximum clique is almost NP-Complete. Proc. 32nd IEEE Symp. on Foundations of Computer Science, 2-12, 1991.
Karp, R.M. Reducibility among combinatorial problems. Complexity of computer computations, 43:85-103, 1972.
Niskanen, S. Ostergard, P. Cliquer User's Guide, Version 1.0. Communications Laboratory, Helsinki University of Technology, Espoo, Finland, Tech. Rep. T48, 2003. (http://users.tkk.fi/~pat/cliquer.html)
Ostergard, P. A fast algorithm for the maximum clique problem. Discrete Appl. Math. 120:197-207, 2002.
Pardalos, P.M. and Xue, J. The maximum clique problem. J. Global Optim., 4:301-328, 1994.
qpClique
require(graph)
nVar <- 50
set.seed(123)
g1 <- randomEGraph(V=as.character(1:nVar), p=0.3)
qpCliqueNumber(g1, verbose=FALSE)
g2 <- randomEGraph(V=as.character(1:nVar), p=0.7)
qpCliqueNumber(g2, verbose=FALSE)
Run the code above in your browser using DataLab