Questions tagged [clique]

In the mathematical area of graph theory, a clique in an undirected graph is a subset of its vertices such that every two vertices in the subset are connected by an edge.

Definition

A clique in an undirected graph G = (V, E) is a subset of the vertex set C ⊆ V, such that for every two vertices in C, there exists an edge connecting the two. This is equivalent to saying that the subgraph induced by C is complete (in some cases, the term clique may also refer to the subgraph).

A maximal clique is a clique that cannot be extended by including one more adjacent vertex, that is, a clique which does not exist exclusively within the vertex set of a larger clique.

A maximum clique is a clique of the largest possible size in a given graph. The clique number ω(G) of a graph G is the number of vertices in a maximum clique in G. The intersection number of G is the smallest number of cliques that together cover all edges of G.

The opposite of a clique is an independent set, in the sense that every clique corresponds to an independent set in the complement graph. The clique cover problem concerns finding as few cliques as possible that include every vertex in the graph. A related concept is a biclique, a complete bipartite subgraph. The bipartite dimension of a graph is the minimum number of bicliques needed to cover all the edges of the graph.

Clique Problem

In computer science, the clique problem is the computational problem of finding a maximum clique, or all cliques, in a given graph. It is NP-complete, one of Karp's 21 NP-complete problems (Karp 1972). It is also fixed-parameter intractable, and hard to approximate. Nevertheless, many algorithms for computing cliques have been developed, either running in exponential time (such as the Bron–Kerbosch algorithm) or specialized to graph families such as planar graphs or perfect graphs for which the problem can be solved in polynomial time.

Free software for searching maximum clique

93 questions
17
votes
4 answers

How to aggregate matching pairs into "connected components" in Python

Real-world problem: I have data on directors across many firms, but sometimes "John Smith, director of XYZ" and "John Smith, director of ABC" are the same person, sometimes they're not. Also "John J. Smith, director of XYZ" and "John Smith, director…
Ian Gow
  • 3,098
  • 1
  • 25
  • 31
11
votes
7 answers

Bron-Kerbosch algorithm for clique finding

Can anyone tell me, where on the web I can find an explanation for Bron-Kerbosch algorithm for clique finding or explain here how it works? I know it was published in "Algorithm 457: finding all cliques of an undirected graph" book, but I can't find…
Alex Reitbort
  • 13,504
  • 1
  • 40
  • 61
8
votes
3 answers

Implementing Bron–Kerbosch algorithm in python

for a college project I'm trying to implement the Bron–Kerbosch algorithm, that is, listing all maximal cliques in a given graph. I'm trying to implement the first algorithm (without pivoting) , but my code doesn't yield all the answers after…
a.u.r
  • 1,253
  • 2
  • 21
  • 32
8
votes
2 answers

What is the significance of the semi clustering formula in the Google Pregel paper?

Semi clustering algorithm is mentioned in the Google Pregel paper. The score of a semi cluster is calculated using the below formula where Ic is sum of the weights of all the internal edges Bc is the sum of the weights of all the boundary edges Vc…
Praveen Sripati
  • 32,799
  • 16
  • 80
  • 117
7
votes
1 answer

My naive maximal clique finding algorithm runs faster than Bron-Kerbosch's. What's wrong?

In short, my naive code (in Ruby) looks like: # $seen is a hash to memoize previously seen sets # $sparse is a hash of usernames to a list of neighboring usernames # $set is the list of output clusters $seen = {} def subgraph(set, adj) hash =…
Vincent Woo
  • 2,650
  • 1
  • 20
  • 21
7
votes
1 answer

How to find pattern groups in boolean array?

Given a 2D array of Boolean values I want to find all patterns that consist of at least 2 columns and at least 2 rows. The problem is somewhat close to finding cliques in a graph. In the example below green cells represent "true" bits, greys are…
Serge
  • 1,531
  • 2
  • 21
  • 44
5
votes
3 answers

Finding max clique in perfect graphs

A fast algorithm to find the size of the largest clique in a perfect graph(this one having odd cycles with at least 1 chord) with about 100 vertices ?? And is there any simpler method than brute force as this is a perfect graph and there should be a…
copperhead
  • 647
  • 1
  • 9
  • 15
5
votes
1 answer

NetworkX -- Create new graph of all nodes that are a part of 4-node clique

I have a network that I would like to bound by clique, but I haven't quite figured out how to do this correctly. I am able to do this same process using k-cores, but not sure what the right process for creating a graph with only cliques in it. I…
CurtLH
  • 2,329
  • 4
  • 41
  • 64
4
votes
2 answers

Cliques in python

I have this problem and I need help with it, this is my code: cliques=[clique for clique in nx.find_cliques(GC) if len(clique)>2] for clique in cliques: if len (clique)==3: GC.remove_edge() print "Clique to…
Python
  • 209
  • 4
  • 6
4
votes
1 answer

Recreate sets from combinations of these sets

I came across a specific problem and looking for some algorithm for it. The problem to solve is as described below. Let's say we have combinations like below 1 - 3 - 5 1 - 4 - 5 1 - 8 - 5 2 - 4 - 5 3 - 4 - 5 2 - 4 - 7 These combinations were…
4
votes
0 answers

Find cliques in an un directed graph using Pregel/Spark in scala

I want to utilize Pregel/ spark-pregel implementation to find the cliques of an un-directed graph using Scala. Any suggestions or algorithms to do that will be highly appreciated.
mas
  • 145
  • 8
4
votes
1 answer

Cliques for directed graphs in igraph

I'm working on a Twitternetwork based on follower-relations in R. In this Network I want to determine the size of the largest cliques within everybody can read each others tweets in his or her timeline. Therefore I would need largest.cliques. But…
supersambo
  • 811
  • 1
  • 9
  • 25
4
votes
1 answer

Java library for a clique cover of a graph

Does anyone know of a library or some code (preferably Java) that solves the clique cover problem? I found an OCaml version, but I would like to use something I can more easily integrate with. I've also found Java code and C code to find the maximum…
ivan
  • 41
  • 2
3
votes
1 answer

Algorithm for Colored Clique of Size K

I abstracted a real-world problem to a graph-theory-problem. Currently, I try to solve this problem by making use of a clique-algorithm from networkx library. I need ideas how my algorithm can be adapted to improve run-time performance. Problem: Let…
srcnuzn
  • 75
  • 5
3
votes
0 answers

Find all cliques of size k in an undirected graph

I would like to find all cliques of size k in an undirected graph. A similar problem is described in this question; unlike the OP in linked question, I am not interested in finding all cliques, only those of size k. I found two approaches so far.…
hilberts_drinking_problem
  • 11,322
  • 3
  • 22
  • 51
1
2 3 4 5 6 7