How this calculation works
Find the smallest number of missing edges that makes a small undirected graph chordal. The calculator returns the added edges and a perfect elimination order of the completed graph. It searches additions by cardinality, which distinguishes a proven minimum fill from an inclusion-minimal completion or a fast elimination heuristic.
fill(G)=min{|F|: F⊆nonedges(G), G+F admits a perfect elimination order}.A worked example
C4 requires one diagonal. Adding 1–3 gives perfect elimination order 2,1,3,4. No-fill fails because the square is induced.
Good to know
Simple undirected graph, 1–8 vertices and at most 18 missing pairs. Exhaustive increasing-cardinality search, completed smaller levels; no weighted or forbidden fill edges.
Reference: Method reference (opens in a new tab) ↗
Recognizing a chordal completion
A chordal graph has no induced cycle of length at least four. A chord is an edge joining nonconsecutive vertices of a cycle; adding such edges can dismantle long induced cycles without removing any original connections.
The objective counts new unordered pairs. It does not minimize the largest clique or tree-decomposition bag, so a completion that is best for treewidth need not be best for the number of added edges.
Compare this with the Exact treewidth calculator with a tree decomposition. Minimum treewidth optimizes maximum bag size, not the number of added edges.
Minimum versus merely minimal
A completion is inclusion-minimal when none of its added edges can be removed while preserving chordality. That only rules out smaller subsets of that particular addition set; another unrelated set might contain fewer edges overall.
This calculator seeks minimum cardinality. It tests all smaller addition sizes before accepting the first successful completion, supplying the global exclusion argument that an inclusion-minimal or greedy result does not provide.
The role of a perfect elimination order
A perfect elimination order removes vertices whose still-present neighbors form a clique. Checking this property at every step proves that the completed graph is chordal, and makes the returned completion independently inspectable without trusting a picture.
A simplicial vertex is one with a clique neighborhood in the remaining graph. The checker repeatedly removes such vertices; if none exists before the graph is exhausted, the tested completion is rejected as nonchordal.
Adding one diagonal to the square
The default graph is the four-cycle 1–2–3–4–1. It is not chordal because its only four-cycle has neither diagonal, so a completion with zero added edges is impossible.
Adding edge 1–3 creates two triangles and permits elimination order 2, 1, 3, 4. One addition is therefore both feasible and necessary. Adding edge 2–4 instead gives another equally good completion.
How the complete search is bounded
The calculator supports at most eight vertices and at most eighteen missing pairs. It enumerates combinations of absent edges in increasing size, stopping only after finding a chordal graph and completing every smaller-size level.
The missing-edge cap limits the total candidate subsets to 2 to the power eighteen. Dense small graphs can be supported while very sparse eight-vertex graphs can be rejected; the cap concerns the actual search dimension rather than vertex count alone.
Preparing disconnected or already chordal graphs
Declare every vertex and enter each undirected pair once, with no loops. Chordality is tested across every component, and isolated vertices are valid simplicial vertices. Disconnected input does not require artificial edges between components.
An already chordal graph returns zero additions with an elimination order. This is a successful exact optimum, not a failure to find improvements; adding arbitrary edges to a chordal graph is not a substitute for checking the resulting completion.
Interpreting fill in applications
Fill edges can model extra dependencies introduced by elimination, and fewer such edges can reduce a symbolic sparsity burden. The calculator examines graph structure, without simulating numeric factorization, pivot stability or a matrix-specific ordering implementation.
The returned minimum can have ties, and only one completion is shown. If an application forbids particular fill pairs or assigns unequal costs to them, that is a constrained or weighted fill problem beyond this page's objective.
A few questions, answered
Is minimum fill the same as minimum treewidth?
No. Fill minimizes added-edge count; treewidth minimizes the largest bag size minus one.
Does the calculator remove original edges?
No. A completion preserves every original edge and only adds missing pairs.
Can there be several optimal completions?
Yes. Either diagonal is optimal for a four-cycle.
Why reject a graph with few edges?
Many absent pairs create an exponential addition search; at most eighteen missing pairs are supported.