2

Given an undirected graph G = G(V, E), how can I find the size of the largest clique in it in polynomial time? Knowing the number of edges, I could put an upper limit on the maximal clique size with

https://cs.stackexchange.com/questions/11360/size-of-maximum-clique-given-a-fixed-amount-of-edges

, and then I could iterate downwards from that upper limit to 1. Since this upper cap is O(sqrt(|E|)), I think I can check for the maximal clique size in O(sqrt(|E|) * sqrt(|E|) * sqrt(|E|)) time.

Is there a more efficient way to solve this NP-complete problem?

Community
  • 1
  • 1
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
  • Are you sure you understand that example? Complete graph with 20 nodes having maximal clique equal to the graph itself. Then there will be 20 cliques of size 19 etc. Knowing the upper bound does not help you to find the real maximal clique. – libik Mar 30 '14 at 22:07
  • Hmm, couldn't I get the upper bound and iterate through the nodes in decreasing degree? – dangerChihuahua007 Mar 30 '14 at 22:10
  • Or is there a dynamic programming method to find the maximal clique size? – dangerChihuahua007 Mar 30 '14 at 22:10
  • @DavidFaux - well you can, however I do not think you save much time with it. Dynamic programming can solve the problem to pseudopolynomial, but I do not know one :) – libik Mar 30 '14 at 22:14
  • I think I don't understand your question. Are you asking for a general clique algorithms? Have you read the [Wikipedia article](http://en.wikipedia.org/wiki/Clique_problem#Finding_maximum_cliques_in_arbitrary_graphs)? – Niklas B. Mar 30 '14 at 22:16
  • That's to find the maximal clique. I only need the number. – dangerChihuahua007 Mar 30 '14 at 22:20
  • @DavidFaux The number of cliques or the size of the maximum clique? At least the latter is NP-hard and former is probably even harder. Since you seem to have realized that the decision problem behind this is NP-complete, why do you ask for a polynomial algorithm? By providing one we'd show P = NP – Niklas B. Mar 30 '14 at 22:25
  • The maximal clique. Ah ok. I thought we could come up with a pseudo-polynomial algorithm. – dangerChihuahua007 Mar 30 '14 at 22:50
  • @DavidFaux What do you mean by pseudopolynomial? Usually that is used in the context of problems involving numbers, for algorithms that are polynomial in the input size when encoded in an unary number system. – Niklas B. Mar 30 '14 at 23:06
  • 2
    Just so you won't get confused by the most widely used terminology, a maximAL clique is one where if you add any vertex, it's not a clique anymore. A maximUM clique is a clique with the highest number of vertices possible. Every maximUM clique is a maximAL clique, but the other direction isn't correct. For example, take a graph consisting of three vertices and one edge. The isolated vertex is a maximAL clique, but not a maximUM clique. – G. Bach Mar 30 '14 at 23:41

2 Answers2

4

Finding the largest clique in a graph is the clique number of the graph and is also known as the maximum clique problem (MCP). This is one of the most deeply studied problems in the graph domain and is known to be NP-Hard so no polynomial time algorithm is expected to be found to solve it in the general case (there are particular graph configurations which do have polynomial time algorithms). Maximum clique is even hard to approximate (i.e. find a number close to the clique number).

If you are interested in exact MCP algorithms there have been a number of important improvements in the past decade, which have increased performance in around two orders of magnitude. The current leading family of algorithms are branch and bound and use approximate coloring to compute bounds. I name the most important ones and the improvement:

  • Branching on color (MCQ)
  • Static initial ordering in every subproblem (MCS and BBMC)
  • Recoloring: MCS
  • Use of bit strings to encode the graph and the main operations (BBMC)
  • Reduction to maximum satisfiability to improve bounds (MaxSAT)
  • Selective coloring (BBMCL)

and others. It is actually a very active line of research in the scientific community. The top algorithms are currently BBMC, MCS and I would say MaxSAT. Of these probably BBMC and its variants (which use a bit string encoding) are the current leading general purpose solvers. The library of bitstrings used for BBMC is publicly available.

chesslover
  • 347
  • 2
  • 6
1

Well I was thinking a bit about some dynamic programming approach and maybe I figured something out.

First : find nodes with very low degree (can be done in O(n)). Test them, if they are part of any clique and then remove them. With a little "luck" you can crush graph into few separate components and then solve each one independently (which is much much faster). (To identify component, O(n) time is required).

Second : For each component, you can find if it makes sense to try to find any clique of given size. How? Lets say, you want to find clique of size 19. Then there has to exist at least 19 nodes with at least 19 degree. Otherwise, such clique cannot exist and you dont have to test it.

libik
  • 22,239
  • 9
  • 44
  • 87