Manuscript Offprint
arXiv:2610.08466Faster dynamic programming for tridiagonal maximum-entropy sampling
Abstract
The maximum-entropy sampling problem (MESP) seeks, for an order-n covariance matrix C, a principal submatrix of order s with maximum log-determinant. Mostly for convenience, we assume that C is nonsingular. Al-Thani and Lee (2023) solved MESP in time when C or is tridiagonal. We show that the inner maximization of their recursion depends only on a prefix of the index set and that no piece of a solution is longer than s; this gives an -time algorithm that returns the optimal value for every budget . When is tridiagonal, C is, up to scaling, the covariance matrix of an Ornstein–Uhlenbeck process observed at unevenly spaced times, and MESP becomes choosing points on a line under a concave gap function with the Monge property; this gives an -time algorithm and, in the first-order autoregressive case, a closed-form solution. Given only C, we solve MESP in time whenever C or is tridiagonal, up to a symmetric permutation, and we recognize these cases within the same bound. For spiders, we make explicit, and sharpen, the dependence on the number of legs, and, drawing on a hardness result of Ohsaka for stars, we observe that, unless P = NP, the exponent of the running time must grow with the number of legs.
Keywords: maximum-entropy sampling, dynamic programming, tridiagonal matrix, determinant, Monge property, autoregressive process, spider, nonlinear combinatorial optimization
Email addresses: fampa@cos.ufrj.br (M. Fampa), jonxlee@umich.edu (J. Lee)
1. Introduction
Let be an order- symmetric positive-semidefinite matrix, the covariance matrix of a Gaussian random vector , where , and let . We write , and we write for the principal submatrix of indexed by . The maximum-entropy sampling problem (MESP) [1] is
(MESP)
The input to MESP is the matrix and the integer . We exclude because it is trivial: , which we compute in time when or is tridiagonal (by Lemma 2, or by the preprocessing of Section 5). We still use the notation for every , with . We assume that is nonsingular. When we exploit the structure of , we never invert by a general-purpose method or form a dense , and we account for the cost of every quantity that we derive from . We state running times in the arithmetic model, in which each addition, subtraction, multiplication, division, and comparison of real numbers costs time; we do not use logarithms or exponentials as primitive operations (see Section 2). MESP is NP-hard [2]; see [3] for a comprehensive treatment. [4] (see also, [5]) established the first significant polynomial-solvable case of MESP: when (or , or a symmetric permutation of either) is tridiagonal, they solve MESP by dynamic programming in time. Their algorithm is also a building block for spider-structured matrices and for upper bounds that come from tridiagonal masks (see [4]).
Contribution. We demonstrate that the recursion of [4] performs redundant work in two places. First, its inner maximization ranges over all earlier pieces, although it depends only on a prefix of and on a budget; therefore, it collapses to a single running maximum, computed once and reused. Second, no piece is longer than s. The resulting algorithm (Algorithm 1) runs in time and uses memory (Theorem 4).
In Section 5, we treat the case in which is tridiagonal directly, rather than by complementation. Every such C is, up to scaling, the covariance matrix of an Ornstein–Uhlenbeck process observed at unevenly spaced times — a classical fact, in several equivalent forms (see [6, 7, 8]) — and, from this viewpoint, MESP becomes the problem of choosing s of those times to maximize a sum of node weights and of a concave function of consecutive gaps. This viewpoint gives a simple closed-form solution in the first-order autoregressive case (Proposition 7), an -time algorithm based on the Monge property (Theorem 8), and, together with Theorem 4, an -time algorithm whenever or is tridiagonal (Corollary 10).
Two structures ( tridiagonal or tridiagonal) and two families of methods (that of [4] and ours) give four combinations. Table 1 previews the running times and memory requirements; in each structure, our best bound is , compared with .
Table 1: Running time and memory, given as input. The rows are grouped by the structure of . Within each group, the column “Applied to” gives the matrix on which the method is run, and “Budget” gives the corresponding budget; for example, when is tridiagonal, Theorem 8 is run on , whose inverse is tridiagonal, with budget . Every bound includes the preprocessing that computes the needed entries of or (Section 5); if it is not known in advance whether is tridiagonal, deciding this costs time (Proposition 9, and Remark 11 for symmetric permutations). Both bounds of Corollary 10 are , and both bounds of Al-Thani and Lee are .
| Method | Applied to | Budget | Time | Memory |
|---|---|---|---|---|
| Structure: tridiagonal | ||||
| Al-Thani and Lee [4] | ||||
| Theorem 4 | ||||
| Theorem 8 | ||||
| Corollary 10 | better of the two | |||
| Structure: tridiagonal | ||||
| Al-Thani and Lee [4] | ||||
| Theorem 4 | ||||
| Theorem 8 | ||||
| Corollary 10 | better of the two | |||
In Section 6, we turn to spiders. We show that the legs interact only through the body and, when the body is chosen, only through a single scalar Schur complement. This observation yields an explicit running time that is linear in and exponential only in the number of legs (Theorem 14), and it isolates the source of hardness: stars (spiders with legs) are exactly the case in which that scalar coupling is unrestricted, and MESP is NP-hard on stars [9]. When the support graph of is a spider instead, the same holds with budget , and we can recognize this case, and find the spider, in time (Appendix A).
Following [4], we decompose each uniquely into maximal runs of consecutive integers, its pieces , ordered from left to right. At least one index outside separates consecutive pieces. Because is tridiagonal, is therefore block diagonal, and we have the following result.
Lemma 1 ([4]).
We obtain interval log-determinants from the three-term determinant recursion [10], written as a ratio of consecutive leading principal minors.
Lemma 2. Let , and, for , let . Then and .
Proof. The quantities are the pivots of Gaussian elimination, that is, the ratios of consecutive leading principal minors of . These minors are positive because is positive definite.
For with , we obtain all of the values that we need from Lemma 2, in total time.
Model of computation. We write our recursions with logarithms because they turn products of determinants into sums, but no algorithm in this paper needs to evaluate a logarithm or an exponential. Each one only adds and compares sums of logarithms of positive numbers, and, because log is increasing, it can instead multiply and compare the corresponding products, with 0 in place of and with the same number of operations; in particular, every comparison made by SMAWK in Section 5 has the same outcome. Concretely, in Section 4, the dynamic program becomes a max-times recursion over the determinants , which the recurrence , with and , gives without division. In Section 5, and become and , where by Lemma 5; from the prefix products of the , each costs time. In Section 6 and Appendix A,
is times a ratio of two determinants, and becomes , a product; in Remark 11 and Appendix A, we compare the values and by comparing the squares . The algorithms thus return an optimal and . In floating-point practice, logarithms avoid overflow and underflow, which is why we keep them in the exposition and in Remark 12.
3. The dynamic program of Al-Thani and Lee
For and , Al-Thani and Lee [4] define
with boundary values and, for ,
(1)
where the constraint ensures that index is not chosen, so that is a maximal piece. Finally, .
Cost. There are triples , and evaluating (1) requires scanning pairs for each of them, for a total of time, as Al-Thani and Lee [4] state. Even if we restrict attention to outer pieces with (so that only triples remain) but still scan all pairs , the cost is ; if we also restrict the inner pieces to (so that only pairs remain for each triple), the cost is still . In either case, storing requires memory.
4. The faster dynamic program
Key observation. The maximum in (1) depends on only through the pair , where : it is the best value of a -subset of , that is, of a -subset of that omits . It does not depend on , and as increases, the family of admissible pieces only grows. Hence, the maximum is a running (prefix) maximum: we can tabulate it once per pair , each entry in time from earlier entries, instead of recomputing it once per triple in time. The outer maximization still costs time per state, so the total is (Theorem 4).
To make this precise, for and , we define
where the condition is vacuous for , and where . Thus, tabulates the inner maximum, and .
Proposition 3. For all and , we have .
Proof. Let . If , then (take ), in agreement with the boundary value. If , then the set ranges exactly over the -subsets of , whose best value is by definition. By Lemma 1, splits accordingly.
Theorem 4. Let , for , and for . Then, for and ,
and . Moreover, we can compute these tables in time and memory, and they yield for every .
Proof. Correctness of (2). A set with is a subset of that either omits or contains .
Correctness of (3). If , then has a unique last piece with , and is a -subset of that omits . By Lemma 1, , and maximizing over gives . Conversely, every term in (3) is the value of a feasible . (Equivalently, (3) is the maximum over of the identity in Proposition 3.) Every -subset of either omits or contains ; this gives the formula for , and the same argument for gives .
Complexity. By Lemma 2, the values with cost time. Each of the entries costs time, and each of the entries requires scanning at most lengths, for time in total. We store only L, g, H, and two tables of argmax pointers (the maximizing in (3) and the maximizing branch in (2)); from these pointers, we recover an optimal
S by traceback in time. If only the optimal values are needed, the working memory beyond the input drops to : because reads only for , we keep just the most recent s rows of g and the most recent row of H, and we generate the values for afresh for each i, in time, by running the pivot recursion of Lemma 2 backward from i (that is, on C with its indices reversed).
Algorithm 1 dynamic program for tridiagonal MESP
Require: and , defining a tridiagonal positive-definite matrix ; an integer
1: for do ▷ interval log-determinants (Lemma 2)
2: for do
3: if , else
4: , where
5: end for
6: end for
7: ; for ; for
8: for do
9: for do
10:
11:
12: end for
13: end for
14: return and, by traceback, an optimal
5. Tridiagonal precision matrices
Throughout this section, is an order- positive-definite matrix whose inverse is tridiagonal. The input remains . When is tridiagonal, we apply the results of this section with ; when is tridiagonal, we apply them with and budget , through the identity . In both cases, the algorithms use only entries of , and we compute these entries from in time without forming (see the paragraph before Corollary 10). If for some , then is block diagonal, the inverse of each block is tridiagonal, and we treat the blocks separately and combine them by the knapsack-type recursion of Remark 15. We therefore assume that for .
In this section, denotes a Gaussian random vector with covariance matrix (so it is the vector of the introduction when ). We write and for the correlation of consecutive variables.
The following representation is classical, in several equivalent forms (see [6, 7, 8]); we state it in the form that we use, and we include a short proof for the convenience of the reader.
Lemma 5 (Ornstein–Uhlenbeck representation). Suppose, as above, that for . Then, for , we have , and, for , the correlation of and is . Consequently, if we let and for , then for all .
Proof. For , the vertex separates from in , a path, so, by the global Markov property of Gaussian graphical models [11, Corollary 6.4, Proposition 6.6, and Theorem 4.6], and are conditionally independent given . For Gaussian variables, this conditional independence means that vanishes, that is, , and induction on gives the product formula. Positive definiteness of gives . If , then the product formula gives for all ; then , and hence , is block diagonal, contrary to .
Therefore, up to the signs and scales of its components, the vector is a stationary Ornstein–Uhlenbeck process (see [8]), observed at the times (in general, unevenly spaced). For , let . Because , the function is strictly increasing and strictly concave on .
The next result follows from Lemma 5 and the chain rule for Gaussian entropy (see [12]); cf. [7] for determinants of submatrices of matrices with tridiagonal inverse.
Lemma 6. For , we have
Proof. By the chain rule for Gaussian entropy, . By the Markov property, conditioning on is equivalent to conditioning on alone, and by Lemma 5.
From Lemma 6, MESP for M is the problem of choosing s of the points to maximize a sum of node weights and of a concave, increasing function of the consecutive gaps. When the node weights are equal and the points are evenly spaced, an elementary balancing argument gives a closed form.
Proposition 7. Let , let , and let , the covariance matrix of a stationary first-order autoregressive process; its inverse is times the tridiagonal matrix with diagonal and off-diagonal entries . Then and, for , with and ,
Moreover, if and , then is optimal if and only if , , and every gap between consecutive elements of equals or .
Proof. If , then , and the formula gives because . Let . Then and for all and , so with . By Lemma 6, , where and is strictly increasing and strictly concave. The gaps are positive integers with , and every such sequence of gaps arises from some . Because is strictly increasing, an optimal has and , so that . If two gaps satisfy , then replacing them by and strictly increases the objective, because strict concavity gives . Hence, at an optimum, all gaps lie in , and summing to forces exactly gaps of and gaps of ; every ordering of these gaps attains the same value.
The argument above is elementary, and the formula may well be known; we have not found it in the literature. Because only appears, the case is identical to the case . When divides , the optimal design is the evenly spaced one, and z(M, s) = s \log \kappa + (s-1) \log \left(1 - \rho^2^{(n-1)/(s-1)}\right).
For general tridiagonal , the node weights and the spacings vary, and we use dynamic programming. We write and for .
Theorem 8. For and , let be the greatest value of over sets with and . Then and, for ,
and . Moreover, for , the gap function satisfies the Monge inequality (see [13])
so we can compute for every , and an optimal , in time.
Proof. The recursion follows from Lemma 6, because the last term of the gap sum involves only max S and the preceding element of S. For (5), let . The pairs and have the same sum, and the second pair is more spread out, because ; concavity of therefore gives .
For fixed , consider the matrix with rows and columns , where if (a defined entry) and if , for a constant that we choose below. We claim that
Let be the greatest absolute value of a defined entry, and let . Because is defined whenever any of the other three entries is, and is defined whenever is, exactly six patterns of defined entries can occur. We write , so that for , and we use the fact that for and .
(1) All four entries are defined . The terms and cancel, and (6) is (5).
(2) Only is undefined. The left-hand side is at least , and the right-hand side is at most , which is less than .
(3) Exactly and are undefined. Then (6) reads , and, because , the difference of the two sides is at least .
(4) Exactly and are undefined. Symmetrically, the inequality reads , and, because , the difference is at least .
(5) Only is defined. With , , and , we have , and the difference of the two sides is .
(6) No entry is defined. With , , and , the difference of the two sides is .
Inequality (6) implies that, for , if column is at least as good as column in row , then it is also at least as good in row ; that is, is totally monotone for row maxima. Every row contains a defined entry (column ), and every defined entry exceeds every undefined one, so the row maxima of are the maxima in (4). The so-called “SMAWK algorithm” (see [14]) finds all row maxima of with evaluations of entries. In an implementation, we compare entries lexicographically, by the pair for an undefined entry and for a defined one, so and never need to be computed. This is valid because SMAWK accesses only through comparisons of two entries in the same row, and, for every , each such comparison has the same outcome under both orders: two defined entries compare by value; a defined entry exceeds an undefined one, because ; and two undefined entries compare by in both. Hence, SMAWK makes the same choices as on , for which the argument above holds for every . Over , the total time is , and storing the maximizing for each gives an optimal by traceback.
Input and preprocessing. The quantities and depend only on the diagonal and the first superdiagonal of , and we obtain all of the entries that we need from the input in time.
(a) If is tridiagonal and , then we read the entries and and invert nothing. If, instead, we wish to apply Theorem 4 to , then Proposition 9 gives all of , namely its nonzero entries, and from the same entries of in time.
(b) If is tridiagonal and , then, with forward pivots , (that is, in Lemma 2) and backward pivots , , we have , , and .
Forming a dense , or inverting by a general-purpose method, would be wasteful. When C is tridiagonal, is, in general, dense (by Lemma 5, every correlation is a product of nonzero factors), so merely writing it down costs time, at least as much as the cost of the entire dynamic program of Theorem 8; a general-purpose inversion costs time, more than the cost of applying Theorem 4 to C directly, for every s. When is tridiagonal, C is dense, and a general-purpose inversion of C would again cost time, far more than the cost of Theorem 8. We need not know in advance whether is tridiagonal: in time, which is linear in the size of the input C, we can determine whether C is nonsingular with a tridiagonal inverse and, if it is, write down . The following characterization is classical in other forms (see [6] and the review [7]); we state it in the form that we use and include a short proof.
Proposition 9. Let C be an order-n symmetric positive-semidefinite matrix. Then C is nonsingular and is tridiagonal if and only if the following two conditions hold:
(i) for , and for , where and ;
(ii) for all .
In that case, with , the nonzero entries of are (without the second term when ) and , and . Consequently, we can check (i) and (ii), and, if they hold, write down and , in time.
Proof. Suppose that is nonsingular, hence positive definite, and that is tridiagonal. Then , and , so (i) holds. Condition (ii) holds by the conditional-independence argument in the proof of Lemma 5, because separates from in , a subgraph of a path.
Conversely, suppose that (i) and (ii) hold. Let be Gaussian with variance , and let for , where are independent Gaussian random variables, independent of , with variances . Let be the covariance matrix of . By induction on , we have and . For , we have , and (ii) gives the same recursion for ; hence, by induction on , we have . Writing , we have , where is unit lower bidiagonal with subdiagonal entries , so , which is positive definite, tridiagonal, and has the stated entries; moreover, because .
Condition (i) costs time, condition (ii) consists of tests that each cost time, and the formulas for and cost time.
Corollary 10. Given as input, if is known to be tridiagonal, then we can compute in time, and if is tridiagonal, then we can compute in time; these bounds include all preprocessing. If it is not known in advance whether is tridiagonal, then deciding this costs an additional time (Proposition 9). More generally, if or is a symmetric permutation of a tridiagonal matrix, then finding such a permutation, or deciding that none exists, costs time (Remark 11), after which the same bounds apply. In all cases, the running time is .
Proof. If is tridiagonal, then we apply Theorem 8 with , or Theorem 4 to with budget , using (a). If is tridiagonal, then we apply Theorem 4 to , or Theorem 8 with and budget , using (b). In each case, the preprocessing costs time. When is block diagonal, merging the tables of the blocks costs, in total, at most the budget times the sum of the block orders; this cost is within the same bounds. Finally, and .
Remark 11 (Inverse and permuted tridiagonal matrices). When is tridiagonal, Algorithm 1, applied to with budget , runs in time, by the identity (see [4]); Corollary 10 records how to combine this with Theorem 8.
Symmetric permutations need more care. If is a symmetric permutation of a tridiagonal matrix, then we recognize that its support graph is a disjoint union of paths, and find the order along each path, in time linear in the size of . If, instead, is a symmetric permutation of a tridiagonal matrix, then the support graph of is not visible from the dense input , but Lemma 5 recovers it. The blocks of are the connected components of the support graph of , and, by Lemma 5, every entry of within a block is nonzero; so we compute the components in time, and we reject if some component is not a clique. Within a component, by Lemma 5, is the distance between the points of and in the unknown order along the path, so is a line metric on distinct points. Hence, the vertex farthest from an arbitrary vertex is an endpoint of the path, and sorting the component by distance from that endpoint, in time, recovers the order along the path, up to reversal. Finally, for each component, we test the conditions of Proposition 9 in this order, in total time. If they hold, then is tridiagonal in the resulting order; if they fail, then no symmetric permutation of is tridiagonal, because any such permutation would induce the same order, up to reversal, on each component. Thus, recognizing the case in which is a permuted tridiagonal matrix fits within the same bound as Proposition 9.
Figure 1 collects the resulting recipe: which structure to test, which regime of s we are in, and which method to apply in each case.

Figure 1: How to solve MESP in time when or is tridiagonal, up to a symmetric permutation; in the permuted case, we first reorder by the permutation found as in Remark 11. Each branch also needs the preprocessing described above: the band of and for the branch that applies Theorem 8 to , and the tridiagonal matrix itself for the branch that applies Theorem 4 to . If the matrix in use is block diagonal, then we treat the blocks separately and combine them as in Remark 15.
Remark 12 (Neither method dominates). When is tridiagonal, Theorem 4 applies to itself, with budget , at a cost of . Theorem 8 does not apply to itself, because a tridiagonal does not, in general, have a tridiagonal inverse; it applies only to , with budget , at a cost of . The first method is faster when , that is, roughly when (for example, versus time when ), and the second method is faster otherwise (for example, versus time when ). Moreover, Theorem 4 yields for every , whereas the route through yields for every . Symmetrically, when is tridiagonal, Theorem 8 is faster unless .
These crossovers are asymptotic, and the constants move them substantially. In matched implementations of the two dynamic programs, we observed crossovers near and, symmetrically, near ; that is, the range in which Theorem 4 is preferable is about eight times wider, in s, than the asymptotic rule suggests. Two specific effects account for much of this. First, an inner step of Theorem 4 is one addition and one comparison of tabulated values, whereas an inner step of Theorem 8 evaluates , and the arguments are all distinct, so nothing can be tabulated; still, in our implementation, a logarithm or an exponential costs only about twice an addition, so this effect alone is small. Second, and more important, the SMAWK algorithm evaluates roughly 13 entries per row of each layer, rather than the one evaluation per state of Theorem 4. The product of these two factors, about 25, enters the crossover under a square root.
6. Spiders with few legs
Following [4], a spider with legs is a tree with one vertex of degree , the body, such that deleting the body leaves paths, the legs. Suppose that is a spider with body 1 and legs of orders , so that . We index the vertices of leg as , in order of increasing distance from the body, and we write for the entry that joins the body to leg . For , we let and , a tridiagonal matrix. As in Section 2, denotes the log-determinant of on , with .
Lemma 13. Let .
(a) If , then , where is the vertex set of leg .
(b) If , let be the greatest with , let , and let . Then and
where and, for , ; here, each is nonsingular and the argument of the logarithm is positive, because is positive definite.
Proof. (a) Without the body, no nonzero entry of joins two legs, so is block diagonal over the legs. (b) For each , if , then vertex is not in , and if , then is empty. In either case, as in Lemma 1, no nonzero entry of joins to or to for , and is block diagonal with blocks and . We order with the body first and write with , where has entry in the first position of block (when ) and zeros elsewhere. Taking the Schur complement of gives ; because and its principal submatrix are positive definite, . Moreover, . Finally, is the ratio of the determinant of with its first row and column deleted to ; this identity gives the exponential form of .
From Lemma 13, the legs interact in only two ways: through the total budget and, when the body is chosen, through the single scalar inside one logarithm. Everything else is separable across legs.
Leg tables. For each leg , for , and for , let be the greatest value of over sets with ; for , we set and for . If we list the vertices of leg in reverse order, from the tip toward the body, then the sets are exactly the prefixes, so Theorem 4, applied to this reversed path, gives for all and at once, in time. The same pass, together with Lemma 2, gives every , , and with in time.
Theorem 14. Suppose that is a spider with legs, and let . Then , where
We can compute in time, where ; for fixed , this is .
Proof. The two formulas follow from Lemma 13: in case (a), the legs are independent, and in case (b), once we fix , the sets are arbitrary subsets of whose sizes sum to . Every inner maximum over is a knapsack-type merge of tables of length , built by pairwise merges; a pairwise merge costs time, or time if we need it at only one budget. The leg tables cost time, and costs time.
For , we enumerate in lexicographic order, by depth-first search over the prefixes of its elements, and we keep, for the current prefix, the merge of together with the partial sums of and . Extending a prefix of length by one component costs one pairwise merge, time. For a complete , the last merge is needed only at the single budget , so it costs time, and (7) costs time from the partial sums. Prefixes of length are nonnegative integer vectors with components that sum to at most , so there are at most of them, and ; moreover, each extends (by zeros) to an element of , so there are at most of them for each . For , the same count gives , so the cost per element of is within the stated bound.
[4] established polynomial solvability for fixed by counting pieces that contain the body. Theorem 14 makes the dependence explicit: the running time is linear in , the dependence on is confined to the body-containing case, and the case costs only time for every . By the identity , the same conclusions hold, with budget , when is a known spider. Theorem 14 applied to reads only the diagonal of and its entries on the edges of the spider, and these, together with , cost time to compute from the entries of in the same positions, by the standard formulas for a tree-structured precision matrix [11, Eqs. (6.58)–(6.59) and Section 8.2.1]:
where the sums run over the edges of the spider, each inverse is padded with zeros to order , and is the degree of in the spider. If the spider is not known, then recognizing it, and computing the same quantities, costs time (Appendix A).
Stars and hardness. A star is a spider in which every leg has order one, so that and C is an arrowhead matrix [4]. Writing for the diagonal entry of leaf i, we have , and (7) reduces to
for every set of leaves. The case is trivial on a star (we choose the leaves with the greatest ), so all of the difficulty lies in the scalar coupling. That difficulty is genuine. Ohsaka [9, Theorem 3.1] proved that “Determinant Maximization on arrowhead matrices is NP-hard and W[1]-hard when parameterized by ,” where the input is a rational positive-semidefinite matrix and an integer , the task is to find a principal submatrix of maximum determinant [9, Problem 2.1], and an arrowhead matrix is one whose support graph is a star. Because log is increasing, this problem is MESP, and is our . Although the theorem is stated for positive-semidefinite input, the matrices that its reduction produces are positive definite. They are Gram matrices of vectors , of order , such that is positive on coordinates and zero elsewhere, and, for , is positive on coordinates and and zero elsewhere: the vectors of [9, Eq. (3.3)] have this sign pattern, because the parameters there and the numbers are positive [9, Problem 3.3], and the rational vectors of [9, Lemma 3.7] approximate them entrywise within a factor with , so they keep it. Coordinate is nonzero only in , so a linear combination of that vanishes has a zero coefficient on each with , and then on , because . Hence, these vectors are linearly independent, their Gram matrix is positive definite, and MESP remains NP-hard, and W[1]-hard with respect to , on nonsingular for which is a star; see also [15]. We draw two consequences.
(i) An -vertex star is a spider with legs. Hence, unless , if an algorithm for MESP on spiders runs in time at most on every spider with legs, for some function , then is unbounded; because , the same holds for bounds of the form with constant. For fixed , Theorem 14 gives time, whose exponent grows with ; some such growth is therefore unavoidable.
(ii) On a star, , so Theorem 14 runs in time . By the W[1]-hardness result, we cannot expect a running time of the form on stars, unless the parameterized complexity classes FPT and W[1] coincide.
The greedy algorithm of [4, Section 3] for arrowhead matrices applies precisely to the body-containing case above, and their sufficient condition identifies instances on which the scalar coupling does not disturb the greedy order.
7. Closing remarks
Remark 15 (All budgets at once). The tables of Theorems 4 and 8 contain the whole vector . This vector is exactly the input that we need in order to combine independent blocks by a knapsack-type recursion,
with and for , where ranges over and is the order of ; then . This recursion covers so-called “-tridiagonal matrices” (see [16]), whose support graph consists of disjoint paths. We use the same recursion for spiders in Section 6.
Remark 16 (Beyond tridiagonal matrices). Lemma 1 is the reason that it suffices to consider distinct “last pieces” per prefix. For -diagonal matrices with , pieces separated by fewer than unchosen indices interact, and the number of possible pieces grows exponentially. Whether MESP is polynomially solvable for fixed bandwidth appears to be wide open.
Acknowledgments. M. Fampa was supported in part by grant 304340/2026-0 from CNPq. J. Lee was supported in part by grant FA9550-22-1-0172 from AFOSR.
CRediT authorship contribution statement. Both authors contributed equally in all aspects of this work.
Data availability. No data was used for the research described in the article.
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process. During the preparation of this work, the authors used Claude to assist in developing and checking the work. The authors take full responsibility for the content of the published article.
Appendix A. Recognizing an unknown spider
Here, is positive definite and given as a dense matrix, is a Gaussian random vector with covariance matrix , and we write for .
Proposition A.1. In time, we can decide whether is a tree and, if it is, find the tree, the diagonal of and its entries on the edges of the tree, and . In particular, within the same time, we can decide whether is a spider.
Proof. We proceed in three steps.
(1) If for some , then we reject. Otherwise, by Prim's algorithm for dense graphs, we compute in time a spanning tree of the complete graph on that has maximum weight for the weights ; the algorithm only compares these weights, each available in time.
(2) We compute and from the formulas that follow Theorem 14, with in place of the spider: is supported on the diagonal and the edges of , and the computation costs time.
(3) We check whether . Row of has nonzero entries, so the product costs time. If the check fails, then we reject; otherwise, we report , , and . Deciding whether is a spider then costs time.
Soundness. If the check in (3) passes, then . The entry of on an edge of comes only from the inverse for that edge, so it equals , which is nonzero by (1). Hence, , and by the second formula.
Completeness. Suppose that is a tree . As in the soundness argument, the formulas for give for every edge of , so ; also, because is positive definite. Let be the path in from to . Because separates from in , the global Markov property of Gaussian graphical models [11, Corollary 6.4, Proposition 6.6, and Theorem 4.6] gives that and are conditionally independent given , so ; by induction on , . Hence, no is zero, and (1) does not reject. Moreover, is a tree metric on with positive edge lengths: if is not an edge of , then , and exceeds for every . So every edge outside is strictly the lightest, in the weights , on the cycle that it closes with , and is the unique maximum-weight spanning tree. Hence, in (1), the formulas in (2) give and , and the check in (3) passes.
The tree in (1) is the tree of [17] (see also [11, Corollary 8.4]), because the mutual information of and increases with . When is a path, this procedure gives another way to find the order in Remark 11. No algorithm can run in time in the worst case, because an entry of that it does not read could be changed, by an amount small enough to keep positive definite, so that is no longer a tree.
References
[1] M. C. Shewry, H. P. Wynn, Maximum entropy sampling, Journal of Applied Statistics 14 (2) (1987) 165–170, https://doi.org/10.1080/02664768700000020.
[2] C.-W. Ko, J. Lee, M. Queyranne, An exact algorithm for maximum entropy sampling, Operations Research 43 (4) (1995) 684–691, https://doi.org/10.1287/opre.43.4.684.
[3] M. Fampa, J. Lee, Maximum-Entropy Sampling: Algorithms and Application, Springer, 2022, https://doi.org/10.1007/978-3-031-13078-6.
[4] H. Al-Thani, J. Lee, Tridiagonal maximum-entropy sampling and tridiagonal masks, Discrete Applied Mathematics 337 (2023) 120–138, https://doi.org/10.1016/j.dam.2023.04.020.
[5] H. Al-Thani, J. Lee, Tridiagonal maximum-entropy sampling and tridiagonal masks, Procedia Computer Science 195 (2021) 127–134, https://doi.org/10.1016/j.procs.2021.11.018.
[6] W. W. Barrett, A theorem on inverse of tridiagonal matrices, Linear Algebra and its Applications 27 (1979) 211–217, https://doi.org/10.1016/0024-3795(79)90043-0.
[7] G. Meurant, A review on the inverse of symmetric tridiagonal and block tridiagonal matrices, SIAM Journal on Matrix Analysis and Applications 13 (3) (1992) 707–728, https://doi.org/10.1137/0613045.
[8] J. L. Doob, The Brownian movement and stochastic equations, Annals of Mathematics 43 (2) (1942) 351–369, https://doi.org/10.2307/1968873.
[9] N. Ohsaka, On the parameterized intractability of determinant maximization, Algorithmica 86 (2024) 1731–1763, https://doi.org/10.1007/s00453-023-01205-0.
[10] G. H. Golub, C. F. Van Loan, Matrix Computations, 4th Edition, Johns Hopkins University Press, Baltimore, MD, USA, 2013, https://www.pres.s.jhu.edu/books/title/10678/matrix-computations.
[11] S. L. Lauritzen, Graphical Models, 2nd Edition, Oxford University Press, Oxford, 2026, https://doi.org/10.1093/9780191775284.001.0001.
[12] T. M. Cover, J. A. Thomas, Elements of Information Theory, 2nd Edition, Wiley-Interscience, Hoboken, NJ, 2006, https://doi.org/10.1002/047174882X.
[13] R. E. Burkard, B. Klinz, R. Rudolf, Perspectives of Monge properties in optimization, Discrete Applied Mathematics 70 (2) (1996) 95–161, https://doi.org/10.1016/0166-218X(95)00103-X.
[14] A. Aggarwal, M. M. Klawe, S. Moran, P. W. Shor, R. E. Wilber, Geometric applications of a matrix-searching algorithm, Algorithmica 2 (1987) 195–208, https://doi.org/10.1007/BF01840359.
[15] M. Fampa, J. Lee, Recent advances in maximum-entropy sampling, Kuwait Journal of Science 53 (1) (2026) 100527, https://doi.org/10.1016/j.kjs.2025.100527.
[16] C. M. da Fonseca, F. Yilmaz, Some comments on k-tridiagonal matrices: determinant, spectra, and inversion, Applied Mathematics and Computation 270 (2015) 644–647, https://doi.org/10.1016/j.amc.2015.08.088.
[17] C. K. Chow, C. N. Liu, Approximating discrete probability distributions with dependence trees, IEEE Transactions on Information Theory 14 (3) (1968) 462–467, https://doi.org/10.1109/TIT.1968.1054142.