How this calculation works
Count independent vertex subsets by size and return their generating polynomial together with one maximum independent-set witness. This summarizes the full size distribution rather than only a fractional-coloring optimum.
I_G(x)=Σ_k i_k x^k; I_G=I_(G−v)+x I_(G−N[v]).A worked example
For the four-cycle, there is one empty independent set, four singleton sets and two independent pairs{0,2},{1,3}. There are no larger independent sets. Thus I(x)=1+4x+2x², the independence number is2 and the total number of independent sets is7.
Good to know
Simple undirected graph1–22 vertices. Exact integer memoized deletion recurrence with1000000-state cap. Includes the empty set. Returns one maximum-set witness,not all maximizers;no weighted activities or fractional-coloring optimization.
Independent subsets contain no selected edge
A vertex subset is independent when none of the graph’s edges has both endpoints in that subset. The independence polynomial records how many such subsets exist at each possible cardinality.
The constant coefficient is always one, representing the empty subset. The coefficient of x is the declared vertex count, including isolated vertices. These two coefficients provide immediate consistency checks before interpreting the higher-degree counts.
Compare this with the Fractional chromatic number calculator with independent set weights. A fractional coloring optimum does not return the independent-set generating polynomial.
The graph is unweighted and includes isolates
Declare all vertices and enter unique undirected edges using labels from zero. An isolate can be added to any independent subset of the remaining graph, so omitting it changes every coefficient rather than merely the display.
No loop or parallel-edge convention is inferred. This page counts ordinary subsets of a simple graph, not multisets, weighted occupancy configurations or color classes with named colors. Additional numeric columns are rejected.
Split the recurrence by one vertex
Choose a remaining vertex v. An independent set either excludes v, leaving an independent set of G minus v, or includes v, forcing all its neighbors to be excluded as well.
The second case therefore contributes x times the polynomial of G minus the closed neighborhood of v. The two cases are disjoint and exhaustive. Memoizing remaining vertex masks avoids recomputing the same induced subproblem while preserving exact integer coefficients.
The square has exactly two independent pairs
Every single vertex of the default four-cycle is independent. Among its six two-vertex subsets, only the two opposite pairs{0,2} and{1,3} avoid an edge. Any three selected vertices contain adjacent vertices.
The resulting coefficient list is[1,4,2], so the largest exponent with a nonzero coefficient is two. Substituting x=1 sums all cardinalities and gives seven total independent subsets, providing a second check on the default output.
Separate the distribution from one maximum witness
The polynomial’s degree is the independence number. The leading coefficient counts all maximum independent sets, while the returned vertex list supplies just one set of that maximum size. These outputs answer different questions.
A witness should have the reported number of vertices and contain no entered edge internally. Relabeling can change which tied witness appears first, but neither the polynomial nor its degree changes under that relabeling.
Exact counts can grow beyond ordinary number precision
The recurrence uses integer arithmetic for coefficients rather than floating-point accumulation. Counts are returned as decimal integer strings so they retain their exact value when they exceed the range of consecutive machine integers.
The state cap is a separate computational limitation: reaching it raises an error rather than returning a truncated polynomial. The degree bound and coefficient exactness do not make the exponential worst-case subproblem growth disappear.
Use the generating function with a stated interpretation
At a positive activity λ, the polynomial can normalize a hard-core occupancy model, but this page does not assume or fit such a physical model. Its primary result is the exact unweighted combinatorial coefficient list.
Fractional coloring uses independent sets in a different optimization problem. A fractional chromatic number does not recover this generating polynomial, just as the number of independent sets does not determine a fractional coloring witness. Choose the output matching the actual task.
A few questions, answered
Does the total include the empty set?
Yes. The constant coefficient one represents the empty independent subset.
Is the polynomial degree the maximum independent-set size?
Yes. It is the largest size with a nonzero count.
Are all maximum independent sets listed?
No. Their count is the leading coefficient, and one witness is displayed.
Do coefficients use exact integers?
Yes. They are computed exactly and returned as decimal integer strings.