A comparison of three heuristics to choose the variable ordering for CAD

A comparison of three heuristics to choose the variable ordering for CAD
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Cylindrical algebraic decomposition (CAD) is a key tool for problems in real algebraic geometry and beyond. When using CAD there is often a choice over the variable ordering to use, with some problems infeasible in one ordering but simple in another. Here we discuss a recent experiment comparing three heuristics for making this choice on thousands of examples.


💡 Research Summary

This paper investigates the impact of variable ordering on the performance of Cylindrical Algebraic Decomposition (CAD), a fundamental algorithm for real algebraic geometry and quantifier elimination. Three heuristics for selecting a variable ordering are compared: Brown’s heuristic, the sum‑of‑total‑degrees (sotd) heuristic, and the number‑of‑distinct‑real‑roots (ndrr) heuristic. Brown’s method uses only simple statistics of the input polynomials—overall degree, maximal degree of terms containing each variable, and the count of terms containing each variable—to break ties and choose the variable to eliminate first. Because it inspects only the input, it incurs virtually no computational overhead. The sotd heuristic constructs the full set of projection polynomials for each possible ordering and selects the ordering whose projection set has the smallest sum of total degrees across all monomials, thereby measuring the algebraic complexity introduced during projection. The ndrr heuristic also builds the full projection set but evaluates each ordering by the total number of distinct real roots of the univariate projection polynomials, directly reflecting the real‑geometric difficulty of the problem; however, root isolation is computationally expensive.

The experimental study uses 7 001 three‑variable existential (SAT) problems drawn from the nlsat benchmark suite. For each problem, the authors also consider a quantifier‑free version obtained by stripping all quantifiers, yielding a second dataset. All experiments are performed with Qepcad‑B, and for each problem the six possible variable orderings are executed; the number of cells produced by CAD is recorded as the primary performance metric (rather than wall‑clock time) to focus on the theoretical impact of ordering. An ordering that yields the smallest cell count is deemed optimal for that problem.

Results show that Brown’s heuristic most frequently selects an optimal ordering: 60.29 % of quantifier‑free problems and 65.75 % of quantified problems. The sotd heuristic attains optimality in 51.71 % and 57.13 % of the respective datasets, while ndrr reaches 64.61 % and 73.79 %. Thus, ndrr appears to be the best selector for quantified problems, whereas Brown dominates for both categories in terms of raw optimal‑selection frequency.

To assess average savings, the authors compute, for each problem, the mean cell count across all six orderings, the difference between this mean and the cell count of the ordering chosen by each heuristic, and the percentage reduction relative to the mean. For the subset of problems that did not time out under any ordering (5 262 quantifier‑free and 5 332 quantified instances), sotd achieves the highest average reduction—27.32 % for quantifier‑free and 19.47 % for quantified problems—while Brown’s average reduction is negligible (‑0.20 % and 4.15 %). ndrr shows the lowest average savings, even negative in some cases, indicating that although it sometimes picks the optimal ordering, its selections are often close to the average performance.

The study also examines timeout avoidance. When at least one ordering exceeds the time limit, ndrr avoids timeout most often for quantified problems (512 instances), whereas Brown avoids it most often for quantifier‑free problems (594 instances). This suggests that ndrr’s real‑root analysis can be advantageous for particularly hard instances, despite its higher computational cost.

In conclusion, the paper highlights that the “best” heuristic depends on the evaluation criterion. Brown’s heuristic, despite being informal and computationally cheap, provides the highest frequency of optimal selections. Sotd, while more expensive, yields larger average cell‑count reductions, making it attractive when overall efficiency is the goal. Ndrr, the most costly, can be beneficial for difficult quantified problems where avoiding timeouts is critical. The authors note that their benchmark set differs from typical CAD applications and recommend further testing on broader problem families. Future work includes exploring greedy strategies, hybrid combinations of heuristics, and the development of new ordering selection methods that balance computational overhead with predictive accuracy.


Comments & Academic Discussion

Loading comments...

Leave a Comment