Performance of Buchbergers Improved Algorithm using Prime Based Ordering
Prime-based ordering which is proved to be admissible, is the encoding of indeterminates in power-products with prime numbers and ordering them by using the natural number order. Using Eiffel, four versions of Buchberger’s improved algorithm for obtaining Groebner Bases have been developed: two total degree versions, representing power products as strings and the other two as integers based on prime-based ordering. The versions are further distinguished by implementing coefficients as 64-bit integers and as multiple-precision integers. By using primebased power product coding, iterative or recursive operations on power products are replaced with integer operations. It is found that on a series of example polynomial sets, significant reductions in computation time of 30% or more are almost always obtained.
💡 Research Summary
The paper introduces a novel monomial ordering, termed “prime‑based ordering,” and evaluates its impact on the performance of Buchberger’s improved algorithm for computing Gröbner bases. The core idea is to assign each indeterminate (x_i) a distinct prime number (p_i). A monomial (t = x_1^{\alpha_1}\dots x_n^{\alpha_n}) is then encoded as the integer (n_t = \prod_{i=1}^n p_i^{\alpha_i}). Ordering monomials by the natural order of these integers yields an admissible total order: it satisfies the two required properties (1) (t\neq 1 \Rightarrow 1<t) and (2) (s<t \Rightarrow s\cdot u < t\cdot u). The authors prove these properties formally, establishing that the prime‑based order is a legitimate term order distinct from lexicographic, graded‑lexicographic, or pure total‑degree orders.
To assess practical benefits, four implementations of Buchberger’s improved algorithm were built in Eiffel:
- String‑based total‑degree order, 64‑bit rational coefficients – monomials stored as character strings (e.g., “aaabbc” for (x^3y^2z)).
- String‑based total‑degree order, GMP multiple‑precision coefficients – same monomial representation, but coefficients use the GNU MP library.
- Prime‑based integer order, 64‑bit rational coefficients – monomials stored as a single integer (the prime image), enabling all monomial operations (multiplication, division, LCM, GCD, comparison) to be performed as ordinary integer arithmetic.
- Prime‑based integer order, GMP multiple‑precision coefficients – combines integer monomial encoding with arbitrary‑size coefficients.
The string‑based versions require iterative or recursive manipulation of the underlying character structures for each monomial operation, whereas the prime‑based versions replace these with single‑step integer operations, dramatically reducing computational overhead and improving cache locality.
A comprehensive benchmark suite was assembled, comprising twelve well‑known polynomial systems (Cyclic 4/5, Gerdt 1‑3, Katsura 4, Arnold 1‑2, Parametric Curve, etc.) together with three handcrafted examples. Execution times were measured for each of the four implementations, both with 64‑bit coefficients and with GMP coefficients. The results show that the prime‑based implementations consistently outperform the string‑based ones in the majority of cases. Typical speed‑ups exceed 30 % (equivalent to a 40 % reduction in runtime), and the most dramatic case (Gerdt 1) achieved a 96.8 % reduction, i.e., roughly a 30‑fold speed‑up. In addition to time savings, the prime‑based ordering often yields a Gröbner basis with fewer polynomials (e.g., 36 versus 56 for Gerdt 1), reducing memory consumption.
However, the performance gain is not universal. The ordering of variables influences the prime‑based encoding: different permutations of the indeterminates lead to different integer images and thus different ordering relations. Experiments on “Example 2” with three variables showed that prime‑based ordering was faster than the best total‑degree ordering in all permutations, with speed‑ups ranging from 30 % to 46 %. In one permutation the prime‑based version was 16.7 % slower. For the five‑variable “Katsura 4” case, only the GMP implementations succeeded (64‑bit overflow), and the prime‑based version was about 17.6 % faster than the best total‑degree variant. Conversely, a few instances (notably one permutation of “Example 2”) exhibited the opposite trend, indicating that variable ordering must be considered when selecting an ordering strategy.
Implementation challenges were also documented. When coefficients were limited to 64‑bit rational pairs, overflow occurred for several benchmarks, necessitating the use of GMP. The integration of GMP with Eiffel introduced a subtle bug: the Eiffel garbage collector, when active, could reclaim GMP objects during a reduction step, causing segmentation faults. Disabling garbage collection eliminated the crashes but led to excessive memory consumption and, in some cases, disk swapping, which negated the performance benefits. These observations highlight the need for careful memory‑management strategies when coupling high‑level object‑oriented languages with low‑level multiple‑precision libraries.
Correctness of all four implementations was verified by checking Buchberger’s criteria (the S‑polynomial reductions to zero) and by cross‑validation with Gröbner bases produced by Maple’s built‑in package. The authors also identified a previously undocumented flaw in Buchberger’s original algorithm description: the set of polynomial pairs was not updated after a new polynomial was added during the Subalgorithm NewBasis. Fixing this bug restored consistency across all implementations.
In conclusion, the paper demonstrates that prime‑based ordering is a mathematically sound term order that, when combined with integer‑based monomial encoding, can substantially accelerate Buchberger’s improved algorithm. The approach reduces both the number of arithmetic operations on monomials and the size of the resulting bases. Nevertheless, the benefits depend on variable ordering and coefficient size, and practical deployment must address memory‑management issues arising from the interaction between Eiffel and GMP. Future work is suggested on automated variable‑ordering heuristics, tighter integration of multiple‑precision arithmetic, and exploration of prime‑based ordering in other computer‑algebra systems.
Comments & Academic Discussion
Loading comments...
Leave a Comment