
Appendix A
Maple Code for Buchberger’s
Algorithm
What follows is very basic Maple code designed solely to illustrate Buch-
berger’s algorithm to compute a Gröbner basis using S-polynomials. This code
has not been optimized in any way whatsoever, but minimal comments are
included (both inside and outside the code) to explain its structure.
The basic idea is to start by generating random polynomials using Maple’s
randpoly function and then convert each polynomial to a list of terms, in
which each term in a list of two items, a coefficient and a list of exponents.
All remaining computations are done using this list structure to represent
polynomials, and