How this calculation works
Compute the one-variable vertex-nullity interlace polynomial by enumerating induced adjacency matrices over the two-element field.
q(G;x) = Σ over S⊆V (x−1)^(|S|−rank_GF(2) A[S]).A worked example
For path 0–1–2, the eight induced subsets have nullity counts h0=3, h1=4, h2=1. Thus q=3+4(x−1)+(x−1)²=x²+2x, and q(2)=8.
Good to know
Simple loopless undirected graphs with 1–16 vertices. Exact GF(2) elimination and BigInt polynomial coefficients; exponential vertex-subset enumeration. One-variable vertex-nullity convention only; no ordinary real matrix rank or Tutte edge-subset substitution.
Reference: Primary method or official documentation (opens in a new tab) ↗
A polynomial built from vertex subsets
The vertex-nullity interlace polynomial associates a scalar polynomial with a finite graph. For every set of vertices S, take the adjacency matrix of the graph induced by S. Its nullity over the two-element field determines one contribution, (x−1) raised to that nullity. Summing all such contributions produces the named one-variable convention.
The word induced matters: selecting S retains every original edge whose endpoints both lie in S. This is not the arbitrary edge-subset construction used by the Tutte polynomial. Two graphs can share familiar degree information and still have different interlace polynomials because their induced adjacency ranks differ.
Compare this with the Tutte polynomial calculator from a graph edge list. Enumerate induced adjacency-matrix nullities over GF(2), rather than edge-subset rank/nullity in the Tutte polynomial.
Prepare a loopless graph
Enter the vertex count and distinct unordered endpoint pairs. All declared vertices count, even isolated ones. A graph with an isolated vertex therefore differs from the graph obtained by deleting it. The input parser rejects loops and duplicate pairs so that the intended simple, loopless convention remains unambiguous.
The calculation accepts disconnected graphs. Their adjacency matrices split into blocks, and nullities add when subsets are split across components. This leads to a product rule for the polynomial of a disjoint union. You can use that rule as an independent check rather than artificially connecting separate components before calculation.
Rank means rank over GF(2)
All matrix entries and row operations are taken modulo two. Adding two identical nonzero entries gives zero, and subtraction is identical to addition. A rank computed with floating Gaussian elimination over the real numbers can differ, so changing the coefficient field changes the mathematical object.
For each induced matrix, exact row reduction counts pivot columns. Nullity is the number of selected vertices minus that rank. The empty subset has a zero-by-zero adjacency matrix, rank zero and nullity zero, so it contributes one. Omitting it would corrupt the constant term and several useful evaluation identities.
From a histogram to ordinary coefficients
It is convenient to count how many subsets have each nullity before expanding. If hν counts subsets with nullity ν, then q(G;x)=Σhν(x−1)^ν. This shifted-power representation has nonnegative integer histogram entries even though binomial expansion contains alternating intermediate terms.
The displayed ordinary coefficient vector is indexed by ascending powers of x. Exact integer arithmetic prevents cancellation from becoming floating rounding error. A zero coefficient is still meaningful, particularly the constant coefficient. Treat the histogram and expanded vector as two representations of the same polynomial, not as two different graph invariants.
Calculate the three-vertex path
For path 0–1–2, the empty subset and the two adjacent vertex pairs have nullity zero. The three singleton subsets and the complete three-vertex path have nullity one. The pair {0,2}, which has no edge, has a zero two-by-two matrix and therefore nullity two.
The histogram is consequently (3,4,1). Expansion gives 3+4x−4+x²−2x+1=x²+2x. At x=2 every shifted power equals one, giving eight, exactly the number of vertex subsets. This example checks the empty subset, disconnected induced pairs, odd-sized adjacency rank and coefficient expansion in one small input.
Use identities without confusing invariants
For an edgeless graph on n vertices every induced matrix is zero, so summing (x−1)^|S| over all subsets gives x^n. For a disjoint union, independent subset choices multiply the polynomials. These identities are especially useful for testing isolated vertices and block-diagonal behavior.
The degree can be informative, but it should not automatically be read as a coloring number or an edge-cycle count. The page reports the stated interlace invariant only. A polynomial match does not establish graph isomorphism, since distinct graphs can share a polynomial invariant even when it captures more than a simple degree sequence.
Interpret bounded exact enumeration
The supported vertex count bounds an exponential enumeration: sixteen vertices already give 65,536 induced subsets. Exact arithmetic does not make that growth disappear. The limit protects interactive responsiveness while allowing every subset to be checked for accepted inputs. No sampling approximation is mixed into the returned coefficients.
Verify a result by recomputing q(2)=2^n, checking a component product or independently reducing a few induced matrices. Those checks complement the completed enumeration. For larger graphs, use a dedicated recurrence-based implementation with a clearly matched polynomial convention rather than truncating the vertex list and presenting the smaller graph’s answer as the original invariant.
A few questions, answered
Why does real-valued matrix rank give another answer?
The invariant is defined using GF(2), where row arithmetic is modulo two. Real rank is not interchangeable.
Does the empty subset count?
Yes. Its nullity is zero and its contribution is one.
Is this the Tutte polynomial?
No. This sums over induced vertex subsets and adjacency nullities, rather than arbitrary edge subsets.
Can the polynomial prove two graphs are isomorphic?
No. It is an invariant, and different graphs may have the same result.