Clique — Definition, Formula & Examples
A clique is a group of vertices in a graph where every vertex is joined by an edge to every other vertex in the group. Think of a circle of friends in which everyone knows everyone else.
Let be a simple undirected graph. A subset is a clique if for all distinct , the edge . Equivalently, the induced subgraph is a complete graph . The clique number is the size of the largest clique in . A clique is maximal if no other vertex can be added to it, and maximum if no clique in is larger.
Key Formula
Where:
- = number of vertices in the clique
- = number of distinct pairs of vertices, each of which must be joined by an edge
How It Works
To test whether a set of vertices is a clique, you check every pair of them. There are pairs, and all of those edges must be present. To find the clique number, you search for the largest set that passes this test. Degrees give a quick filter: a vertex in a clique of size must have degree at least , so you can rule out vertices with too few neighbors.
Worked Example
Problem: A graph has vertices A, B, C, D, E and edges AB, AC, AD, BC, BD, CD, DE. Find the clique number .
Step 1: List the degrees. A, B, and C each have 3 neighbors. D has 4 neighbors (A, B, C, E). E has 1 neighbor (D).
Step 2: Rule out a clique of size 5. Every vertex in it would need degree at least . Vertex E has degree 1, so no 5-vertex clique exists.
Step 3: Test the set {A, B, C, D}. A clique on 4 vertices needs every pair joined. The edges AB, AC, AD, BC, BD, CD are all present, so the set is a clique.
Answer: The set {A, B, C, D} is a maximum clique, so .
Why It Matters
Cliques are a core topic in discrete mathematics and algorithms courses. There they serve as a standard example of an NP-complete problem and give a lower bound for graph coloring, since . Analysts also use clique detection to find tightly connected groups in social networks and protein-interaction networks.
Common Mistakes
Mistake: Treating a maximal clique as a maximum clique.
Correction: In the worked example, {D, E} is maximal because no other vertex is adjacent to both D and E. It has only 2 vertices, though, while the maximum clique has 4. Maximal means it cannot be extended. Maximum means it is the largest in the whole graph.
Mistake: Calling any closed loop of vertices a clique, such as a 4-cycle A–B–C–D–A.
Correction: A cycle connects only consecutive vertices. A clique needs every pair connected, including the diagonals AC and BD. A 4-vertex clique needs all 6 edges, but a 4-cycle has only 4.
