Advanced maths

Maximal clique calculator from graph edge list

Enumerate every inclusion-maximal clique of a small simple graph and identify which cliques have the largest size.

Your numbers

Labels are 1 through this count. Include isolated vertices.
One edge per row. Use distinct valid endpoints; no repeated unordered pairs. Leave empty for isolates.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A clique is a set of vertices with an edge between every distinct pair. This calculator enumerates all inclusion-maximal cliques, rather than reporting only one greedy set. A listed clique is maximal when no outside vertex can be added while keeping complete adjacency. The maximum clique size is the largest size among that complete list. A pivoted Bron–Kerbosch search maintains a current clique, possible extensions and previously processed extensions, avoiding duplicate enumeration while retaining smaller maximal sets that are not maximum.

THE FORMULAA clique has every member pair adjacent; maximal means no vertex can be added; maximum means largest cardinality.

A worked example

Use triangle edges 1–2,1–3,2–3, add edge 3–4 and include isolated vertex five. The maximal cliques are {1,2,3}, {3,4} and {5}. Their sizes are three, two and one, so the maximum clique size is three. The pair {1,2} is a clique but not maximal because vertex three can be added. The set {3,4} is maximal even though a larger clique exists elsewhere. Vertex five is a singleton maximal clique because it has no neighbor.

Good to know

Undirected simple graph on 1–24 vertices and at most 200 edges. Self-loops and repeated unordered pairs are rejected. The exact search is capped at 200,000 recursive states and 5,000 output cliques. Reaching a cap throws an error; no partial collection is labeled complete and no unproven largest-so-far size is advertised as the maximum. Every vertex, including isolates, participates. Edge weights, directed adjacency and approximate large-network community detection are not supported.

Maximal describes extendability, while maximum compares all candidates

The words differ by only a few letters but answer different questions. A maximal clique cannot be enlarged without removing a current member. A maximum clique has no larger competitor anywhere in the graph. Every maximum clique is maximal, but a small isolated complete group can be maximal without approaching the global maximum. The result table explicitly marks maximum-size rows while preserving all other maximal rows.

Vertices can belong to several maximal cliques. In the example, vertex three joins both the triangle and the separate two-vertex clique, so cliques do not partition the vertex set. A connected component need not be a clique either: a path is connected even when its endpoints lack an edge. Requiring every pair, rather than a route between each pair, is the defining distinction. An isolated vertex satisfies the pairwise condition vacuously and cannot be extended.

A triangle, an attached edge and an isolate form three maximal cliques12345{1,2,3}: size 3{3,4}: size 2{5}: size 1
The maximal cliques are {1,2,3}, {3,4} and {5}. Only the triangle is maximum, with size three; the smaller sets cannot be enlarged and remain maximal.

Complete enumeration needs an explicit stopping policy

Some small-looking graphs contain exponentially many maximal cliques. A page that silently stops after its first output rows can miss a larger set and mislabel the reported maximum. This calculator instead treats the state and output caps as resource errors. Below those caps, the search exhausts the supported candidate space before reporting the complete count and maximum cardinality. Input order may affect search work but not the mathematical collection.

A clique is also different from a coloring class: proper coloring puts mutually nonadjacent vertices together, whereas a clique contains mutually adjacent ones and needs a different color for every member. Thus a clique size gives a lower bound for the chromatic number, but equality is not automatic. The Chromatic polynomial calculator from a graph edge list counts proper color assignments for the entered graph; this page exposes complete subgraphs instead of treating those different outputs as synonyms.

A few questions, answered

Does the calculator list every clique, including all subcliques?

No. It lists every maximal clique. Its subsets are also cliques, but listing all of them would answer a different and much larger enumeration question.

Can an isolated vertex be a maximal clique?

Yes. Its singleton set has no missing internal pair, and no other vertex can be added because none is adjacent to it.

Find your calculator

Start typing to explore the library.