Advanced maths

Chordal graph clique tree calculator with running intersection certificate

Recognize chordal graphs and return maximal cliques linked in a tree with a running-intersection certificate.

Your numbers

Zero-based labels 0 through n−1; all declared vertices remain included.
One row: u v. No loops or duplicate unordered pairs.

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

Recognize chordal graphs and return maximal cliques linked in a tree with a running-intersection certificate.

THE FORMULAEvery eliminated vertex has a clique of remaining neighbors; for each v, cliques containing v induce a connected subtree.

A worked example

The triangles {0,1,2} and {2,3,4} form two maximal cliques. Joining them along intersection {2} yields a clique tree.

Good to know

Simple undirected graphs on 1–40 vertices. Exact simplicial elimination and maximum-intersection spanning tree. Nonchordal graphs return rejection plus the residual induced vertex set; no added fill edges. Disconnected component clique trees use zero-intersection joining links.

Represent overlapping complete subgraphs

A chordal graph has no induced cycle of length four or more. Its maximal cliques can be arranged as nodes of a tree so that, for every original vertex, the clique nodes containing that vertex form a connected subtree. This is the running-intersection property checked by the calculator.

The clique tree represents overlap between complete subgraphs rather than replacing each original edge by a tree edge. Clique nodes are sets of original vertex labels, and adjacent clique nodes carry their set intersection. A single original vertex may appear in several cliques, provided those occurrences stay connected along the tree.

Two maximal cliques share a separatorClique 0{0, 1, 2}Clique 1{2, 3, 4}{2}Occurrences of vertex 2 stay connected
Scroll across to see the full diagram.
The clique-tree edge carries the shared separator and certifies running intersection.

Compare this with the Minimum fill in calculator with a chordal completion witness. Recognize chordality and construct maximal cliques joined in a clique tree;adding edges to make a graph chordal does not return this representation.

Enter a simple graph for recognition

Supply up to forty vertices and list undirected edges by their zero-based endpoint labels. Isolated vertices are included in the declared graph and each contributes a singleton maximal clique. No weights, loops, parallel copies or implicit edges are accepted, and input ordering does not change whether the graph is chordal.

Disconnected graphs are allowed. Their component clique trees are joined by links with empty intersection to produce one displayed tree. Those empty links do not assert adjacency between the original components. They are a representation convention, and the running-intersection condition remains valid because no original vertex belongs to two different components.

Read the shared triangle example

The default graph consists of triangles on zero, one, two and on two, three, four. Each triangle is a maximal clique because no additional vertex is adjacent to every member. Their shared vertex is two, so a tree with those two clique nodes has one link labeled by that intersection.

Vertices zero and one occur only in the first clique, while three and four occur only in the second. Vertex two occurs in both, and the connecting edge keeps its occurrences connected. Thus every vertex satisfies running intersection, making the example a short complete certificate of the returned two-clique representation.

Eliminate simplicial vertices exactly

A vertex is simplicial when its neighbors in the current remaining graph are pairwise adjacent. The calculator repeatedly removes such a vertex and records the order. A graph is chordal exactly when this process can remove every vertex, so the completed sequence is a perfect elimination order.

If no simplicial vertex remains before the graph is empty, recognition stops with a nonchordal result and the remaining vertex set. This is an explicit rejection, not an attempt to add missing edges. The tool does not advertise a shortest chordless-cycle witness when its rejection certificate instead describes the failed elimination stage.

Build and audit the clique tree

For each eliminated vertex, combine it with its later neighbors to obtain a clique candidate. Removing candidates contained in larger candidates leaves the maximal cliques. A complete graph of these cliques is weighted by intersection size, and a maximum-weight spanning tree provides the desired clique connections.

The running-intersection table lists the clique indices containing each original vertex and the number of tree links among them. Since any subgraph of a tree is acyclic, exactly one fewer such link than clique occurrences proves connectivity. The program explicitly checks that equality for every original vertex before returning a successful certificate.

Compare with chordal completion

A minimum-fill calculator adds edges until a nonchordal graph becomes chordal. This page instead recognizes the supplied graph and represents it without changing any adjacency. A failed input stays failed; the residual graph is not silently repaired, and a clique tree is not claimed for the original nonchordal topology.

Chordality also differs from the broader perfect-graph property. Every chordal graph is perfect, but some perfect graphs contain induced even cycles and therefore are not chordal. A four-cycle is a useful example: its two-coloring behaves well, yet it has no chord and fails the elimination test used here.

Interpret nonunique representations

A chordal graph can have several perfect elimination orders and several valid clique trees. The calculator returns one of each. Relabeling vertices can change the chosen tree while preserving the maximal-clique family and recognition result. The important invariant is that all occurrences of each vertex remain connected in the displayed tree.

Clique-tree links are separators in a structural representation, not road lengths, flow capacities or a unique physical network. In disconnected inputs an empty separator merely joins otherwise independent component representations. Use the returned clique labels, intersections and per-vertex certificates together when checking a result or comparing two equally valid tree layouts.

A few questions, answered

Are fill edges added?

No. A nonchordal graph is rejected with its failed elimination stage.

Can disconnected graphs have a displayed clique tree?

Yes. Component trees are joined with empty-intersection links by convention.

What does running intersection mean?

For each original vertex, all clique nodes containing it form a connected subtree.

Must the returned tree be unique?

No. Different maximum-intersection spanning trees can certify the same graph.

Find your calculator

Start typing to explore the library.