Fast computation of Ehrhart polynomials of Gelfand–Tsetlin polytopes
via Macdonald reciprocity
May 21, 2026
We describe an efficient method for computing the Ehrhart polynomial of Gelfand–Tsetlin polytopes arising from Kostka coefficients. The key idea is to exploit Ehrhart–Macdonald reciprocity: evaluating the Ehrhart polynomial at negative integers reduces
to counting strict Gelfand–Tsetlin patterns, which are often zero or very small for low dilations. Combined with an adaptive strategy that chooses the cheapest evaluation point (positive or negative) at each step, this yields substantial practical
speedups compared to general-purpose polytope software. We benchmark against \(\mathtt{OSCAR}\)/\(\mathtt{polymake}\), and illustrate the broader applicability of the method through order
polytopes and permutation posets. The implementation is available in the Rust kostka package, with related optimizations also incorporated in the new lrcalc-rs replacement for lrcalc.
Let \(\lambda/\mu\) be a skew shape and \(\mathbf{w}= (w_1, \dotsc, w_k)\) a weight vector with \(|\mathbf{w}| = |\lambda/\mu|\). The Gelfand–Tsetlin polytopeGelfand–Tsetlin polytope \(\mathrm{GT}(\lambda/\mu, \mathbf{w})\) is the set of all real-valued GT patterns of shape \(\lambda/\mu\) and weight \(\mathbf{w}\). Its integer points are in bijection with semistandard Young tableaux of shape \(\lambda/\mu\) and weight \(\mathbf{w}\), so \[\label{eq:kostka} K_{\lambda/\mu, \mathbf{w}} = \#(\mathrm{GT}(\lambda/\mu, \mathbf{w}) \cap \mathbb{Z}^d),\tag{1}\] where \(d = \dim \mathrm{GT}(\lambda/\mu, \mathbf{w})\).
By a theorem of E. Rassart [1], the function \(n \mapsto K_{n\lambda/n\mu, n\mathbf{w}}\) is a polynomial in \(n\): the Ehrhart polynomialEhrhart polynomial \(L_P(n)\) of the polytope \(P = \mathrm{GT}(\lambda/\mu, \mathbf{w})\). Computing this polynomial is important for understanding the structure of Kostka coefficients and the geometry of GT polytopes.
The polynomiality of stretched Kostka and Littlewood–Richardson coefficients, and the structure of the resulting Ehrhart polynomials, have been studied by R. King, C. Tollu, and F. Toumazet [2], [3]. Their later hive-model paper [3] computes several explicit stretched LR polynomials as illustrative examples: the degree-8 polynomial for \((\lambda,\mu,\nu)=((4,3,3,2,1),(4,3,2,2,1),(7,4,4,4,3,2,1))\); a factorization example with \((\lambda,\mu,\nu)=((9,7,6,2,0),(13,5,3,1,0),(14,12,11,5,4))\); and degree-bound examples including
\((\lambda,\mu,\nu)=((7,6,5,4,0,0),(7,7,7,4,0,0),(12,8,8,7,6,4,2))\) and \((\lambda,\mu,\nu)=((9,7,3,0,0),(9,9,3,2,0),(10,9,9,8,6))\). These examples support conjectures on factorization,
degree bounds, and linear factors; they are not a systematic benchmark computation of the family of GT/Kostka polytopes considered here. Nzeutchap, Toumazet, and Butelle [4] later developed a distributed method for stretched Kostka and Littlewood–Richardson coefficients based on the hive model. Their approach computes values at positive dilation
factors across a local network and interpolates the resulting stretched polynomial; it also uses hive inequalities to obtain an improved upper bound, denoted maxDeg, on the degree before the computation begins. Their reported LR examples are
arbitrary selected triples, with maxDeg between 4 and 14; in several cases the real degree is strictly smaller, including examples of real degree 0. In contrast, for the GT/Kostka family considered here we compute the dimension of the relevant
GT polytope directly, so the exact degree of the stretched Kostka polynomial is known before interpolation. The reciprocity step then reduces the number and cost of the needed evaluations, since many negative evaluations are strict pattern counts and often
vanish.
Kostka coefficients arise as special cases of Littlewood–Richardson (LR) coefficients. By the identity \(K_{\lambda/\nu,\mu} = \langle s_{\lambda/\nu}, h_\mu \rangle
= \langle s_\lambda, s_\nu h_\mu \rangle\), we construct a skew shape \(\rho/\sigma\) that is a disjoint union (no shared rows or columns) of \(\nu\) and single rows of lengths \(\mu_1, \mu_2, \dotsc\), giving \(s_{\rho/\sigma} = s_\nu h_\mu\) and hence \(K_{\lambda/\nu,\mu} = c^{\rho}_{\lambda, \sigma}\). Thus software for LR
coefficients such as A. Buch’s lrcalc [5] can be used for individual Kostka evaluations. However, the dilated partitions \(n\lambda\), \(n\mathbf{w}\) grow with \(n\), making LR computation expensive at large dilations. Even lrcalc (highly optimized C code) takes over
8 minutes for the 11 evaluations needed for \(\mathrm{GT}((3,3,3), (1^9))\) at dimension 10, compared to 1 ms for our dynamic programming (DP) approach with reciprocity (Table 1). Our
horizontal-strip DP exploits the specific structure of Kostka coefficients directly, without the overhead of the LR reduction.
The standard approach evaluates \(L_P(n)\) at \(n = 1, 2, \dotsc, d+1\) using a DP algorithm for Kostka coefficients, then recovers the polynomial by Lagrange interpolation. Each evaluation requires a DP that can be expensive for large dilations.
Our approach uses Ehrhart–Macdonald reciprocityEhrhart–Macdonald reciprocity to access the negative side of the polynomial for free or cheaply. The same idea also applies in other settings where one can count both lattice points and relative interior lattice points efficiently; in particular, we will later discuss order polytopes and an application to permutation posets.
For a rational polytope \(P \subset \mathbb{R}^d\) of dimension \(d\) (one whose vertices have rational coordinates), the function \(L_P(n) = \#(nP \cap \mathbb{Z}^d)\) is a quasi-polynomial in \(n\), and a polynomial when \(P\) is a lattice polytope. GT polytopes are rational but in general not lattice polytopes, so one would a priori expect \(L_P\) to be only a quasi-polynomial. However, by Rassart’s theorem [1], \(L_P\) is a genuine polynomial—a case of so-called period collapse. Ehrhart–Macdonald reciprocity [6], [7] gives: \[\label{eq:reciprocity} (-1)^d L_P(-n) = \relax\ifmmode\textcolor{blue}{L^{*}_P(n)}\else \textcolor{blue}{\emph{L^{*}_P(n)}}\fi \mathrel{\vcenter{:}}= \#(\mathop{\mathrm{int}}(nP) \cap \mathbb{Z}^d),\tag{2}\] where \(\mathop{\mathrm{int}}(nP)\)\(\mathop{\mathrm{int}}(nP)\) denotes the relative interior of \(nP\).
Recall that an SSYT of skew shape \(\lambda/\mu\) and content \(\mathbf{w}= (w_1, \dotsc, w_k)\) corresponds bijectively to a chain of partitions \[\mu = \alpha^{(0)} \subseteq \alpha^{(1)} \subseteq \dotsb \subseteq \alpha^{(k)} = \lambda,\] where each \(\alpha^{(i)} / \alpha^{(i-1)}\) is a horizontal strip of size \(w_i\). The Gelfand–Tsetlin polytopeGelfand–Tsetlin polytope \(\mathrm{GT}(\lambda/\mu, \mathbf{w}) \subset \mathbb{R}^m\) is the convex polytope obtained by relaxing the integrality constraint: the entries of the intermediate partitions \(\alpha^{(1)}, \dotsc, \alpha^{(k-1)}\) are allowed to be real, subject to the interlacing inequalities \[\alpha^{(i-1)}_j \leq \alpha^{(i)}_j \leq \alpha^{(i-1)}_{j-1}\] and the row-sum constraints \(|\alpha^{(i)}| - |\alpha^{(i-1)}| = w_i\). The lattice points of \(\mathrm{GT}(\lambda/\mu, \mathbf{w})\) are precisely the SSYT, so \(K_{\lambda/\mu, \mathbf{w}} = \#(\mathrm{GT}(\lambda/\mu, \mathbf{w}) \cap \mathbb{Z}^m)\).
The interior lattice points of \(n \cdot \mathrm{GT}(\lambda/\mu, \mathbf{w})\) are precisely the strict GT patternsstrict GT patterns: those where every interlacing inequality that is not forced as an equality in the affine hull of the polytope is strict. Equivalently, one imposes strictness only on the non-globally-tight inequalities. Thus \[\label{eq:strict-kostka} L^{*}_P(n) = K^{\mathrm{strict}}_{n\lambda/n\mu, n\mathbf{w}},\tag{3}\] where \(K^{\mathrm{strict}}\) counts strict semistandard tableaux (equivalently, GT patterns with strictness on all non-forced internal inequalities). This is computed by the same DP as the ordinary Kostka coefficient, but with strict inequality constraints.
To compute \(L_P(n)\) for a polytope of dimension \(d\), we need \(d+1\) evaluations at distinct integers. We always have \(L_P(0) = 1\) for free, and by 2 and 3 , each negative evaluation \((-1)^d L_P(-n) = K^{\mathrm{strict}}_{n\lambda, n\mu, n\mathbf{w}}\) reduces to a strict Kostka computation. The key observation is that strict Kostka coefficients are often zero for small \(n\): if any part of \(\mathbf{w}\) is 1, then strict GT patterns require the corresponding row to have distinct entries in a range that may be empty for small dilations. Even when the strict count is nonzero, its DP state space is typically much smaller than the ordinary Kostka DP for the same dilation.
This motivates an adaptive strategy:
The “cost” heuristic uses the most recent Kostka/strict-Kostka value as a proxy for the DP state-space size at the next dilation. The negative side typically wins for the first several points because strict Kostka equals zero.
Remark 1. The negative evaluations are completely free when \(K^{\mathrm{strict}} = 0\). For a weight vector with \(k\) ones, the strict Kostka coefficient \(K^{\mathrm{strict}}_{n\lambda, n\mu, n\mathbf{w}}\) is zero whenever \(n\) is small enough that the strict interlacing constraints for those unit-weight rows cannot be satisfied. In practice, half or more of the \(d+1\) required evaluation points are obtained this way.
Our implementation is in Rust. The specialized research code used for the computations in this article is available as the kostka crate.1 It contains the
GT/Kostka dynamic programs, the Ehrhart interpolation and reciprocity routines, and the strict-count variants used below. The order-polytope experiments discussed later use the same reciprocity/interpolation viewpoint, but are conceptually separate from
the lrcalc compatibility layer. At its core is a DP algorithm for (skew) Kostka coefficients \(K_{\lambda/\mu, \mathbf{w}}\) based on horizontal-strip removal, using BigUint arithmetic for exact
computation. A variant with strict inequality constraints in the DP transitions handles the strict Kostka coefficients \(K^{\mathrm{strict}}_{\lambda/\mu, \mathbf{w}}\). The dimension of \(\mathrm{GT}(\lambda/\mu, \mathbf{w})\) is determined by counting free entries in the GT pattern with propagation of forced values. This gives the exact degree of the stretched Kostka polynomial, rather than only an a priori
upper bound; see J. A. De Loera and T. B. McAllister [8] and Nzeutchap, Toumazet, and Butelle [4] for related degree computations. The Ehrhart polynomial is then recovered from evaluation points via Lagrange interpolation over \(\mathbb{Q}\).
The kostka CLI supports:
kostka ehrhart --lambda 3,2,1 -w 1,1,1,1,1,1
kostka ehrhart --lambda 4,3 --mu 2,1 -w 2,2,2
kostka hstar --lambda 4,3,2,1 -w 1,1,1,1,1,1,1,1,1,1
kostka hstar --lambda 4,3,1 --mu 2,1 -w 2,2,1
The tool also computes Kostka coefficients associated with flagged Schur functions, Littlewood–Richardson coefficients, and batch computations over all weights for a given shape. We refer to the Git repository for full documentation.
There is also a separate Rust implementation aimed at the classical lrcalc interface: lrcalc-rs.2 That project is not the specialized Ehrhart
engine used in Tables ¿tbl:tab:benchmarks? and 1; rather, it is a drop-in-oriented implementation of the liblrcalc ABI and command-line tools, with native code for Littlewood–Richardson
coefficients, Schur products, skew Schur expansions, Schubert products, and fast Kostka special cases. The speedups in the present article come from exploiting the GT/Kostka and reciprocity structure directly, while lrcalc-rs packages related
optimizations in a broader LR/Schur-function compatibility library.
We compare our method against two alternatives: the \(\mathtt{OSCAR}\)/\(\mathtt{polymake}\) pipeline [9], [10] and A. Buch’s lrcalc [5], which reduces Kostka evaluations to LR coefficient computations. (\(\mathtt{OSCAR}\) is a Julia framework that calls \(\mathtt{polymake}\) for polyhedral
computations, which in turn delegates lattice-point enumeration and \(h^*\)-vector computation to \(\mathtt{Normaliz}\) [11]; thus “\(\mathtt{OSCAR}\),” “\(\mathtt{polymake}\),” and “\(\mathtt{Normaliz}\)” refer to
different layers of the same computational stack.) Tables ¿tbl:tab:benchmarks? and 1 summarize the results.
The \(\mathtt{OSCAR}\)/\(\mathtt{polymake}\) approach requires constructing the full vertex representation of the GT polytope—expensive in high dimensions—and does not exploit Ehrhart–Macdonald reciprocity. Our method avoids vertex enumeration entirely: each evaluation of \(L_P(n)\) or \(L^{*}_P(n)\) reduces to a Kostka coefficient DP whose complexity depends on the dilation \(n\) (not the number of vertices), and reciprocity provides many free evaluation points where strict Kostka equals zero.
@llrrrr@ \(\lam\) & \(\wt\) & \(d\) & kostka & \(\mathtt{OSCAR}\) & speedup
\((8,1,1)\) & \((2,1^8)\) & 12 & 2 ms & 666 s & \(3 \times 10^5\)
\((4,4,2)\) & \((2,1^8)\) & 12 & 2 ms & 182 s & \(9 \times 10^4\)
\((4,3,3)\) & \((2,1^8)\) & 12 & 2 ms & 230 s & \(10^5\)
\((5,3,2)\) & \((2,1^8)\) & 13 & 4 ms & 764 s & \(2 \times 10^5\)
\((7,2,1)\) & \((2,1^8)\) & 13 & 3 ms & 1347 s & \(4 \times 10^5\)
\((7,1,1,1)\) & \((2,1^8)\) & 15 & 5 ms & 467 s & \(9 \times 10^4\)
\((4,2,2,2)\) & \((2,1^8)\) & 15 & 9 ms & 125 s & \(10^4\)
\((3,3,3,1)\) & \((2,1^8)\) & 15 & 8 ms & 573 s & \(7 \times 10^4\)
\((5,2,2,1)\) & \((2,1^8)\) & 17 & 21 ms & 1988 s & \(9 \times 10^4\)
\((5,3,1,1)\) & \((2,1^8)\) & 17 & 18 ms & 1179 s & \(7 \times 10^4\)
\((4,3,2,1)\) & \((1^{10})\) & 21 & 104 ms & — &
\((5,5,5)\) & \((1^{15})\) & 22 & 45 ms & — &
\((5,3,3,1,1,1)\) & \((2^4,1^6)\) & 26 & 17 s & — &
Remark 2. The observed wall-clock ratios are typically between \(10^4\) and \(10^5\). The \(\mathtt{OSCAR}\)/\(\mathtt{polymake}\) timings are from [10], computed on a laptop using the Julia \(\mathtt{OSCAR}\) framework (which calls \(\mathtt{polymake}\)/\(\mathtt{Normaliz}\) internally for \(h^*\)-vector computation). The total computation time reported in [10] for all partitions of size 10 was over 412 hours. Our method computes the same cases in under 1 second total, and extends to much larger cases (55,000 polytopes up to dimension 26 in our database).
For standard weight \(\mathbf{w}= (1^N)\), the reciprocity method is especially effective: \(K^{\mathrm{strict}}_{n\lambda, n\mathbf{w}} = 0\) for all small \(n\), so many evaluation points are free. For example, computing the degree-21 Ehrhart polynomial for \(\mathrm{GT}((4,3,2,1), (1^{10}))\) requires 22 evaluation points, of which the first 9 negative points all give \(K^{\mathrm{strict}} = 0\).
| \(\lam\) | \(\wt\) | \(d\) | kostka | lrcalc | speedup |
|---|---|---|---|---|---|
| \((3,2,1)\) | \((1^6)\) | 7 | \({<}\,1\) ms | 86 ms | \(\sim\!10^2\) |
| \((3,3,3)\) | \((1^9)\) | 10 | 1 ms | 491 s | \(\sim\!6 \times 10^3\) |
| \((4,3,2)\) | \((1^9)\) | 13 | 4 ms | \(>\!\)10 min | \(>\!10^5\) |
Remark 3. The slowdown of lrcalc at higher dilations is expected: computing \(c^{n\rho}_{n\lambda, n\sigma}\) requires enumerating Littlewood–Richardson tableaux of shape \(n\rho / n\lambda\) with content \(n\sigma\), whose count grows rapidly with \(n\). Our DP, by contrast, processes one row of the GT pattern at a time and
benefits from the horizontal-strip structure. The reciprocity advantage (free evaluations at negative integers) further widens the gap. The distributed hive computation of Nzeutchap–Toumazet–Butelle [4] is closer in spirit to interpolation: it parallelizes the computation of positive dilation values for stretched LR coefficients. Our
comparison here is different in two respects: we specialize to the GT/Kostka setting, where the horizontal-strip DP is very small, and we use Ehrhart–Macdonald reciprocity to replace many positive evaluations by strict negative-side evaluations.
For a rational polytope \(P\) with denominator \(q\) (the smallest positive integer such that \(qP\) is a lattice polytope), the lattice-point counting function \(L_P(n) = |nP \cap \mathbb{Z}^d|\) is a quasi-polynomialquasi-polynomial of degree \(d\) and period dividing \(q\). The Ehrhart series then satisfies \[\label{eq:hstar-rational} \sum_{n \geq 0} L_P(n) \, z^n = \frac{h^*_q(P;z)}{(1-z^q)^{d+1}},\tag{4}\] where \(h^*_q(P;z)\) is a polynomial of degree at most \(q(d+1)-1\) with non-negative integer coefficients, see [12] and [13]. Since GT polytopes have period collapse by Rassart’s theorem, we define the \(h^{*}\)-vector\(h^{*}\)-vector \((h^*_0, \dotsc, h^*_d)\) as in the lattice polytope case (\(q=1\)): \[\label{eq:hstar-lattice} \sum_{n \geq 0} L_P(n) \, z^n = \frac{h^*_0 + h^*_1 z + \dotsb + h^*_d z^d}{(1-z)^{d+1}}.\tag{5}\] Comparing 4 and 5 via the factorization \((1-z^q)^{d+1} = (1-z)^{d+1}(1+z+\dotsb+z^{q-1})^{d+1}\), we see that \(h^*_q(P;z) = (h^*_0 + \dotsb + h^*_d z^d) \cdot (1+z+\dotsb+z^{q-1})^{d+1}\). In particular, non-negativity of the \(h^*_i\) implies non-negativity of the coefficients of \(h^*_q(P;z)\). R. King, C. Tollu, and F. Toumazet [2] conjectured that the Ehrhart polynomial \(L_P(n)\) of a GT polytope has non-negative coefficients (in the standard monomial basis). Note that this is an independent property from \(h^*\)-positivity: neither implies the other in general. Our computations verify both properties for all straight-shape GT polytopes \(\mathrm{GT}(\lambda,(1^{|\lambda|}))\) with \(|\lambda| \leq 15\)—over 54,000 cases—providing further evidence for the conjecture. See also [14], [15] for related positivity conjectures for Ehrhart polynomials of polytopes related to key polynomials, flagged Schur functions, and cylindric Schur functions. For recent progress on Ehrhart positivity for marked order polytopes, relevant to skew GT polytopes without a weight condition, see [16].
As observed by C. Haase and T. B. McAllister [17], there exist rational polytopes with period collapse whose Ehrhart polynomial is not the Ehrhart polynomial of any lattice polytope. It is natural to ask whether the same phenomenon occurs for GT polytopes: is \(L_{\mathrm{GT}(\lambda/\mu, \mathbf{w})}(n)\) always realizable as the Ehrhart polynomial of a lattice polytope, or are GT polytopes genuinely different in this respect?
The reciprocity approach extends naturally to order polytopesorder polytopes. For a finite poset \(P\) on \(\{0,1,\dotsc,n-1\}\), the order polytopeorder polytope [18] \[\mathcal{O}(P) = \bigl\{x \in [0,1]^n : x_a \leq x_b \text{ for all } a <_P b \bigr\}\] has the property that its lattice points at dilation \(t\) are weakly order-preserving maps \(P \to \{0,1,\dotsc,t\}\), so \(L_{\mathcal{O}(P)}(t) = \Omega(P, t+1)\), where \(\Omega(P,k)\) is Stanley’s order polynomial. Interior lattice points at dilation \(t\) correspond to strictly order-preserving maps \(P \to \{1,\dotsc,t-1\}\), giving Ehrhart–Macdonald reciprocity in the form \[\label{eq:order-reciprocity} L_{\mathcal{O}(P)}(-k) = (-1)^n \, \bar{\Omega}(P, k-1),\tag{6}\] where \(\bar{\Omega}(P,m)\) counts strict order-preserving maps \(P \to \{1,\dotsc,m\}\).
The standard approach to evaluating \(\Omega(P,k)\) enumerates all order-preserving maps by backtracking over vertices, giving \(O(k^n)\) worst-case time. We introduce a frontier DPfrontier DP that processes vertices in a natural labeling order, maintaining as state only the values of live vertices—those with at least one unprocessed child. When a vertex \(v\) has no children among the remaining vertices, its value does not affect future constraints, so all valid choices are collapsed into a single multiplier \((k - \ell_v + 1)\), where \(\ell_v\) is the lower bound from parent constraints. States that agree on all live vertex values are merged.
The complexity is \(O(n \cdot k^{w})\), where \(w\) is the maximum frontier width (the largest number of simultaneously live vertices). For chains and zigzag (fence) posets, \(w = 1\); for antichains, \(w = 0\) (each vertex is independent); for Young diagram posets of shape \((\lambda_1, \dotsc, \lambda_r)\), \(w \leq \lambda_1\).
We benchmark three methods for computing the \(h^*\)-vector of order polytopes:
Rust DP: our frontier DP with Ehrhart–Macdonald reciprocity and BigRational interpolation;
linext: Stanley’s formula—enumerate all linear extensions \(\mathcal{L}(P)\) and tabulate descents (streaming, \(O(n)\) memory);
\(\mathtt{polymake}\): the \(\mathtt{polymake}\)/\(\mathtt{Normaliz}\) backend for general lattice-point enumeration.
| Poset | \(n\) | Rust DP | linext | \(\mathtt{polymake}\) | |
|---|---|---|---|---|---|
| Shape \((3,2,1)\) | 6 | 0.4 ms | 2 μs | 60 ms | |
| Fence(8) | 8 | 0.9 ms | 50 μs | 90 ms | |
| Shape \((4,3,2,1)\) | 10 | 2 ms | 30 μs | 90 ms | |
| Shape \((3,3,3)\) | 9 | 1.3 ms | 5 μs | 60 ms | |
| Fence(10) | 10 | 1.8 ms | 1.7 ms | 520 ms | |
| 2-alt(10) | 10 | 1.8 ms | 1.7 ms | 490 ms | |
| Shape \((5,4,3,2,1)\) | 15 | 9 ms | 11 ms | 2.5 s | |
| Shape \((4,4,4,4)\) | 16 | 20 ms | 2 ms | 270 ms | |
| Shape \((5,5,5)\) | 15 | 20 ms | 0.4 ms | 120 ms | |
| Fence(14) | 14 | 6 ms | — | \(>\!5\) s | |
| Shape \((5,5,5,5)\) | 20 | 175 ms | — | \(>\!5\) s | |
| Shape \((6,5,4,3,2,1)\) | 21 | 100 ms | — | — | |
| Fence(20) | 20 | 23 ms | — | — | |
| Shape \((6,6,6)\) | 18 | 230 ms | — | — | |
| Shape \((6,6,6,6)\) | 24 | 6.7 s | — | — |
Remark 4. Table 2 reveals that the three methods have complementary strengths. For few linear extensions (shapes with small hook lengths), Stanley’s formula is fastest: the staircase \((4,3,2,1)\) has only 768 linear extensions, so direct enumeration takes 30 μs. For narrow posets (chains, fences), the frontier DP dominates because \(w=1\) gives polynomial time \(O(nk)\), while the number of linear extensions grows exponentially—fence(14) already exhausts the 5 s cap for \(\mathtt{polymake}\), but the DP finishes in 6 ms. \(\mathtt{polymake}\)/\(\mathtt{Normaliz}\) is a general-purpose tool that does not exploit the order polytope structure; its triangulation-based approach scales with the number of vertices of the polytope, not the poset width. For the largest cases (\(n \geq 20\)), only the frontier DP is feasible.
By Stanley’s theorem [19], for a naturally labeled poset \(P\), the \(h^*\)-vector of \(\mathcal{O}(P)\) equals the \(P\)-Eulerian polynomial: \[h^*_i = \#\{\sigma \in \mathcal{L}(P) : \mathrm{des}(\sigma) = i\},\] where \(\mathcal{L}(P)\) is the set of linear extensions and \(\mathrm{des}(\sigma)\) counts descents. Counting linear extensions is \(\#\mathsf{P}\)-complete in general [20], and even for structured posets the number \(|\mathcal{L}(P)|\) can be enormous—e.g., \(|\mathcal{L}(P)| = n!\) for the antichain on \(n\) elements. Our Ehrhart/reciprocity approach avoids linear extension enumeration entirely: it requires only \(\sim n/2\) evaluations of the order polynomial via the frontier DP, each costing \(O(n \cdot k^w)\).
Example 1. For the fence (zigzag) poset on 10 elements: \[\mathbf{h}^{*}= (1, 133, 2475, 12331, 20641, 12331, 2475, 133, 1).\] This is palindromic, as expected for a Gorenstein polytope.
As an application of the fast \(h^*\)-computation, we investigate real-rootedness of \(h^*\)-polynomials for permutation posetspermutation posets. Given \(w \in S_n\), the permutation poset \(P_w\) is the partial order on \(\{1,\dotsc,n\}\) with \(i <_{P_w} j\) iff \(i < j\) and \(w_i < w_j\). Since \(P_w\) is always naturally labeled, \(h^*(\mathcal{O}(P_w); t)\) equals the \(P\)-Eulerian polynomial by Stanley’s theorem.
Starting from a \(321\)-avoiding permutation of Stembridge, \[w_0 = (2,4,6,8,10,1,12,3,15,5,17,7,9,11,13,14,16) \in S_{17},\] whose permutation poset has \(h^*(t) = 1 + 32t + 336t^2 + 1420t^3 + 2534t^4 + 1946t^5 + 658t^6 + 86t^7 + 3t^8\) (ultra-log-concave but not real-rooted), we searched over 34,226 nearby \(4321\)-avoiding permutations (within 3 arbitrary transpositions) and found exactly 22 with non-real-rooted \(h^*\). All 22 counterexamples are ultra-log-concave, hence also log-concave.
Example 2. Almost all non-real-rooted examples are \(321\)-avoiding. A notable exception, found at transposition distance 3 from \(w_0\), is \[w = (3,4,6,8,10,\underline{12,2,1},15,5,17,7,9,11,13,14,16) \in S_{17},\] which contains the pattern \(321\). Its \(h^*\)-polynomial is \[h^*(t) = 1 + 41t + 525t^2 + 2596t^3 + 5349t^4 + 4731t^5 + 1849t^6 + 284t^7 + 12t^8,\] with non-real roots at approximately \(-2.15 \pm 0.041\,i\). This is the only \(321\)-containing example among the 22 failures at \(n = 17\), and has the smallest imaginary part of all examples found—it is the closest to being real-rooted.
Example 3. A larger example occurs for the permutation \[\begin{align} w ={}&(9,10,1,2,3,4,5,12,15,16,17,18,19,6,\\ &7,8,11,20,21,22,23,13,25,26,27,28,14,24) \in S_{28}. \end{align}\] The permutation poset \(P_w\) has \[\begin{align} h^*(t)={}&1 + 66t + 1500t^2 + 15582t^3 + 81644t^4 + 223486t^5 \\ &+ 320052t^6 + 232424t^7 + 77660t^8 + 8560t^9 . \end{align}\] This polynomial is ultra-log-concave, but it is not real-rooted.
Our method applies whenever one has a combinatorial interpretation of both \(L_P(n)\) and the interior count \(L^{*}_P(n)\) that admits a DP or transfer-matrix algorithm, together with a regime where \(L^{*}_P(n) = 0\) for small \(n\). GT polytopes are closely related to flow polytopesflow polytopes on directed acyclic graphs [21].
Another natural test case is the Birkhoff polytope \(B_\ell\). Here \(L_{B_\ell}(n)\) and \(L^{*}_{B_\ell}(n)\) count nonnegative and positive integer magic squares with line sum \(n\), so the reciprocity setup again applies. For Birkhoff polytopes, however, the symmetry-based interpolation trick is classical rather than new. Beck and Pixton [22] record the standard consequence of Ehrhart–Macdonald reciprocity: from reciprocity one gets \(L_{B_\ell}(-\ell-t)=(-1)^{\ell-1}L_{B_\ell}(t)\) and \(L_{B_\ell}(-1)=\cdots=L_{B_\ell}(-\ell+1)=0\). They explicitly describe the resulting strategy: compute the first \(\binom{\ell-1}{2}\) values, use the symmetry and trivial zeros, and interpolate the polynomial. They also note that the volume of \(B_8\) had been computed by essentially this method, combined with additional computational tricks. Beck–Pixton’s own main contribution in that paper is a different residue-based method for computing \(H_\ell(t)\) and the volumes of larger Birkhoff polytopes. For context, our implementation computes the Ehrhart polynomial in under 10 ms for \(B_3\) and \(B_4\), in 0.28 s for \(B_5\), and in about 265 s for \(B_6\). Moreover, \(L^{*}_{B_\ell}(n)=0\) for \(1 \leq n < \ell\), so the first \(\ell-1\) negative evaluation points are free. Thus the new contribution in this direction would be the GT-DP implementation and its adaptation of that classical Birkhoff symmetry trick, not the trick itself. This suggests that the method is viable for smaller Birkhoff polytopes, although the growth by \(\ell=6\) is already steep.
Matroid polytopes are another natural family where the reciprocity approach may be effective.
Some Rust code, installation work, and benchmark scripts were developed with assistance from OpenAI Codex.