GRÖBNER BASES AND INTEGER PROGRAMMING
J. K. VERMA
1. Introduction
These notes are prepared using the material given in the cited references [1], [2] and [3]. Our
aim has been to give a short self-contained introduction to the beautiful connection between
apparently disjoint areas of integer programming and commutative algebra.
Let S = k[x1 , x2 , . . . , xn ] denote the polynomial ring over a field k. A Gröbner basis of an
ideal is a set of polynomials in S which has several remarkable properties which enable us
to carry out standard operations on ideals, rings and modules in an algorithmic way. Every
set of polynomials in S can be transformed into a Gröbner basis of the ideal they generate.
This process generalises three important algorithms
• Gauss elimination method for solving a system of linear equations.
• Euclid’s algorithm for finding the greatest common divisor.
• The simplex method of linear programming.
There are numerous applications of Gröbner bases, to name a few, (1) graph colouring (2)
geometric theorem proving (3) systems of partial differential equations (4) contingency tables
in statistics (5) computation of groups arising in homological algebra and algebraic geometry
(6) computer aided design (7) construction of codes (8) computation of rings of invariants
(9) computation of Nash equilibrium in game theory (10) computation of integral closure of
affine domains (11) solutions of systems of polynomial equations (12) construction of free
resolutions of finite modules over polynomial ring over a field (13) computation of local and
sheaf cohomology.
2. Gröbner basis of an ideal
2.1. Term orders on monomials. In order to construct a Gröbner basis of an ideal in S,
we need to introduce a total order on the set of monomials
Mon(S) = {xa = xa11 xa22 . . . xann | a = (a1 , a2 , . . . , an ) ∈ Nn }.
Definition 2.1. By a term order on Mon(S) we mean a total order < on Mon(S) which
satisfies the following two conditions:
• 1 < xa for all nonzero a ∈ Nn .
• If xa < xb then xc xa < xc xb for all a, b, c ∈ Nn .
There are many examples of term orders. We recall some of the standard ones.
2 J. K. VERMA
(1) Lexicographic order. The lexicographic order on Mon(S) with x1 > x2 > · · · > xn
is defined as follows: Let a, b ∈ Nn . Define xa < xb if the first nonzero coordinate of
a − b from the left is negative. If x < y then the lexicographic order on all monomials
in x, y is
1 < x < x2 < x3 < · · · < y < xy < x2 y < · · · < y 2 < · · · .
(2) Degree lexicographic order. We define xa < xb in degree lexicographic order for
a = (a1 , a2 , . . . , an ) and b = (b1 , b2 , . . . , bn ) ∈ Nn if deg xa < deg xb or if deg xa =
deg xb then xa < xb in the lexicographic order.
(3) Degree reverse lexicographic order. Let α and β ∈ Nn . We say that xα < xβ
in degree reverse lexicographic if either deg xα < deg xβ or if deg xα = deg xβ then
there the first nonzero coordinate in α − β from the right is positive. In both the
monomial orders, x1 > x2 > · · · > xn .
Remark 2.2. The deglex and degrevlex orders are same for monomials in two variables.
But they differ for three variables. For example
x21 x2 x3 >deglex x1 x32 but x21 x2 x3 <degrevlex x1 x32 .
Definition 2.3. The support of a polynomial f (x) = α∈Nn aα xα is the set
P
supp(f ) = {xα | aα 6= 0}.
The initial monomial of a polynomial f (x) is defined as in(f ) = xα if xα > xβ for all
xβ ∈ supp(f ). The initial ideal of an ideal I with respect to a given monomial order
is defined by in(I) = (in(f ) | f ∈ I \ {0}). Monomials which are not in in(I) are called
standard monomials.
Example 2.4. If I = (f1 , f2 , . . . , fs ) is an ideal of S then the initial ideal of I may not
be generated by in(f1 ), in(f2 ), . . . , in(fs ). Consider the ideal I = (x21 − x2 , x1 ) in k[x1 , x2 ]
under the lexicographic order. Then in(x21 − x2 ) = x21 and in(x1 ) = x1 . Therefore (in(x21 −
x2 ), in(x1 )) = (x1 ). Note that x2 ∈ in(I) \ (in(x21 − x2 ), in(x1 )).
2.2. Gröbner basis of an ideal.
Definition 2.5. Let I be an ideal of S = k[x1 , x2 , . . . , xn ]. Fix a monomial order < on S. A
subset {g1 , g2 , . . . , gm } ⊂ I is called a Gröbner basis of I with respect to the monomial order
< if
in(I) = (in(g1 ), in(g2 ), . . . , in(gm )).
A Gröbner basis G = {g1 , g2 , . . . , gj } of I is called reduced if the coefficients of initial
monomials of polynomials in G are 1 and for all i 6= j no monomials in supp(gj ) is divisible
by in(gi ).
Theorem 2.6. Gröbner basis of I exists and it generates I.
GRÖBNER BASES AND INTEGER PROGRAMMING 3
Proof. By the Hilbert basis theorem, the ideal in(I) is finitely generated. Let
in(I) = (in(g1 ), in(g2 ), . . . , in(gm ))
for some g1 , g2 , . . . , gm ∈ I. Then G = {g1 , g2 , . . . , gm } is a Gröbner basis of I. We show
that G generates I. If I 6= (G) then the set of initial monomials of polynomials in I \ (G)
has a minimal element, say in(h). But in(h) ∈ in(I). Hence there is a g ∈ G such that
in(g) | in(h). Write in(h) = in(g)m for some monomial m. Consider f = h − mg. Then
f ∈ I \ (G) and in(f ) < in(h). This is a contradiction. Hence I = (G).
2.3. Examples of Gröbner bases.
Example 2.7. Let F be a set of univariate polynomials. Then the reduced Gröbner basis
of F is the GCD of the polynomials in F. The only monomial order in k[x] is 1 < x < x2 <
x3 < · · · . Suppose that F = {12x3 − x2 − 23x − 11, x4 − x2 − 2x − 1}. Then G = {x2 − x − 1}.
The normal form of x3 + x2 is 3x + 2. Note that 1, x are the only standard monomials.
Example 2.8. Let R = C[x, y] and x < y and use lexicographic order on monomials in
C[x, y]. Let F = {y 2 + x2 − 1, 3xy − 1}. Then G = {y + 3x3 − 3x, 9x4 − 9x2 + 1}. The normal
form of y 4 + y 3 with respect to G is 27x3 + 9x2 − 24x − 8. Note the triangular nature of G.
Using G we can find the intersection points of these two curves. dim C[x, y]/(F) = 4 and
the standard monomials are {1, x, x2 , x3 }.
2.4. Gröbner basis and division algorithm. For a polynomial f (x) ∈ k[x] and a nonzero
polynomial g(x) we have a unique remainder r(x) such that
f (x) = q(x)g(x) + r(x).
The remainder r(x) is either zero or deg r(x) < deg g(x). Therefore we may restate the
condition deg r < deg g, as: no term in r(x) is divisible by in(g(x)). This statement can be
generalised to multivariate polynomials.
Theorem 2.9. Let G = {g1 , g2 , . . . , gm } be a Gröbner basis. Then any f ∈ S can be written
as
f = q1 g1 + q2 g2 + · · · + qm gm + r
for some q1 , q2 , . . . , qm ∈ S and r = 0 or no term in r is divisible by any in(gi ) for all
i = 1, 2, . . . , m. The remainder r, which is unique, is called the normal form of f with
respect to G and we write it as r = NG (f ).
2.5. Buchberger’s Algorithm for Gröbner basis. This is based on the notion of the
S-polynomial of two nonzero polynomials.
4 J. K. VERMA
Definition 2.10. Let f, g be nonzero polynomials in S = k[x1 , x2 , . . . , xn ]. The S-polynomial
of f and g is the polynomial
lcm (in(f ), in(g)) lcm (in(f ), in(g))
S(f, g) = f− g.
c in(f ) d in(g)
Here c is the leading coefficient of f, d is the leading coefficient of g.
Theorem 2.11 (Bruno Buchberger). Let G = {g1 , g2 , . . . , gt } be a set of nonzero poly-
nomials in S. Then G is a Gröbner basis of I = (g1 , g2 , . . . , gt ) if and only if for all i 6= j,
NG (S(gi , gj )) = 0.
Buchberger’s Algorithm: Let I = (f1 , f2 , . . . , fs ) be an ideal of S. Add to F = {f1 , f2 , . . . , fs }
the normal forms of all the S-polynomials of pairs of polynomials in F with respect to F.
Repeat this until a Gröbner basis is produced.
2.6. Construction of a basis of k[x1 , x2 , . . . , xn ]/I.
Definition 2.12. A polynomial f ∈ S is called reduced with respect to a Gröbner
basis G if no term in f is divisible by in(g) for all g ∈ G. A monomial m ∈ S is called
standard with respect to G if m ∈ / in(I).
Proposition 2.13. (1) Let I be an ideal of S. Then S/I = {NG (f ) + I | f ∈ S}. Moreover
f + I = h + I if and only if NG (f ) = NG (h).
(2) The residue classes of the standard monomials constitute a basis of the k-vector space
S/I.
Proof. (1) Let f ∈ S. Then by division algorithm, then f = q+NG (f ) where q ∈ I and NG (f )
is reduced with respect to G. Hence f +I = NG (f )+I. Let f +I = h+I. Write f = q+NG (f )
and h = r + NG (h). for some q, r ∈ I. Then f − h = q − r + NG (f ) − NG (h) ∈ I. Hence
NG (f )−NG (h) ∈ I. But NG (f ), NG (h) are reduced with respect to G. Hence NG (f ) = NG (h).
(2) Since NG (f ) is a k-linear combination of the standard monomials with respect to G, the
residue classes of these form a basis of the vector space S/I.
2.7. Computation of the kernel and the image. Let k be a field. Let
φ : k[y1 , y2 , . . . , ym ] −→ k[x1 , x2 , . . . , xn ]
be a k-algebra homomorphism given by
φ(yi ) = fi where f1 , f2 , . . . , fm ∈ k[x1 , x2 , . . . , xn ].
Theorem 2.14. (1) Let K = (y1 − f1 , y2 − f2 , . . . , ym − fm ) ⊂ k[x1 , . . . , xm , y1 , . . . , yn ]. Then
ker φ = K ∩ k[y1 , y2 , . . . , ym ].
(2) Let G be a Gröbner basis of K with respect to a term order in which x1 , x2 , . . . , xn are
larger than y1 , y2 , . . . , yn . Then a Gröbner basis of ker φ is G ∩ k[y1 , y2 , . . . , ym ].
GRÖBNER BASES AND INTEGER PROGRAMMING 5
(3) Let G be a Gröbner basis of K. A polynomial f ∈ image φ if and only h := NG (f ) ∈
k[y1 , y2 , . . . , ym ] and in this case, f = φ(h).
3. Main questions about integer programming
Let r ≤ n be positive integers and A = (aij ) ∈ Zr×n having rank r. Integer programming is
concerned with study of the semigroup
MA = {x ∈ Nn | Ax = 0.}
(1) The Feasibility Problem. Is MA nonempty? If yes, find a vector in MA .
(2) The Optimization Problem. Given c = (c1 , c2 , . . . , cn ) ∈ Rn+ find v = (v1 , v2 , . . . , vn ) ∈
MA so that c.v = ni=1 ci vi is minimized.
P
(3) The Hilbert Basis Problem. Find a minimal generating set H of MA , i.e., for
each v ∈ MA there exist cu ∈ N with v = u∈H cu u. Such a set is called a Hilbert
P
basis of MA .
Theorem 3.1 (R. P. Stanley, A. Schriver). MA has unique Hilbert basis.
4. Integer programming and torus invariants
Suppose A = [γ1 , γ2 , . . . , γn ] ∈ Zr×n has rank r and γi is the ith column vector of A. The
ring
SA := k[xa | a ∈ MA ]
is called the semigroup ring associated to the matrix A. Let k ∗ denote the multiplicative
group of the field k. Consider the group of invertible diagonal matrices:
T = {diag(uγ1 , uγ2 , . . . , uγn ) | u = (u1 , u2 , . . . , ur ) ∈ (k ∗ )r } .
The group T, called a torus group, acts on S = k[x1 , x2 , . . . , xn ] via the automorphisms
τu : xi −→ uγi xi , i = 1, 2, . . . , n.
Theorem 4.1. (1) SA := k[xa | a ∈ MA ] = {f ∈ S | τu (f ) = f for all u ∈ (k ∗ )r }
(2) There is a one-to-one correspondence between MA and monomials in SA given by β 7→ xβ .
(3) A subset H ⊂ MA is its Hilbert basis if and only if {xβ | β ∈ H } is a minimal generating
set of SA as a k-algebra.
Proof. (1) and (2) Let β = (β1 , β2 , . . . , βn ) ∈ Nn . Then
τu (xβ ) = (uγ1 x1 )β1 (uγ2 x2 )β2 · · · (uγn xn )βn
= uβ1 γ1 +β2 γ2 +···+βn γn xβ
= uAβ xβ
Hence τu (xβ ) = xβ for all u ∈ (k ∗ )r if and only if β ∈ MA . Note that f ∈ S is an invariant
under the action of T if and only if each monomial in supp(f ) is also an invariant. Hence
6 J. K. VERMA
SA is the ring of invariants of the torus T acting on S.
(3) If H is a Hilbert basis of MA then we can write
X
v= cu u
u∈H
for some cu ∈ N for u ∈ H . Hence x = u∈H (xu )cu . Since SA is generated by invariant
v
Q
monomials, the set {xu | u ∈ H } generates SA as a k-algebra. The converse is proved
similarly.
5. Toric ideals are generated by binomials
Let S = k[x] := k[x1 , x2 , . . . , xn ] and A = [γ1 , γ2 , . . . , γn ] ∈ Zr×n . Each vector γi gives a
monomial tγi ∈ R = k[t±1 ±1
1 , . . . , tr ]. Define the ring homomorphism
φA : k[x] → R, φA (xi ) = tγi for all i = 1, 2, . . . , n.
Definition 5.1. The kernel of φA := IA the called the toric ideal of A.
Theorem 5.2. The toric ideal IA is spanned as a k-vector space by the binomials
{xu − xv | u, v ∈ Nn with Au = Av}.
Proof. As φA (xu ) = tAu , φA (xu −xv ) = tAu −tAv ∈ IA ⇔ Au = Av. We show that any f ∈ IA
is a k-linear combination of these binomials. Let ≺ be any term order in k[x1 , x2 , . . . , xn ]
and let f ∈ IA cannot be written as a k-linear combination of such binomials.
5.1. A Gröbner basis algorithm for existence of a solution. Choose f ∈ IA so that its
initial term in≺ (f ) = xu is minimal. Therefore φA (xu ) = tAu must cancel when we expand
φA (f ) = f (tγ1 , tγ2 , . . . , tγn ).
Hence there is a monomial xv ≺ xu in f such that Au = Av. Therefore f 0 = f − xu + xv is
not a linear combination of binomials in IA . But in≺ (f 0 ) ≺ in(f ), which is a contradiction.
Theorem 5.3 (Existence of a solution). Consider the k-algebra map
φA : k[x1 , x2 , . . . , xn ] → k[t±1 ±1 ±1
1 , t2 , . . . , tr ], φA (xi ) = t
γi
for all i.
Let G be the reduced Gröbner basis of the toric ideal of A. Then β ∈ MA if and only if
xβ − 1 ∈ G .
5.2. Existence of the optimal solution.
Proof. Suppose xβ − 1 ∈ G then φA (xβ ) = tAβ = 1. Hence Aβ = 0. Therefore β ∈ MA .
Conversely let β ∈ MA . Then xβ − 1 ∈ IA . Hence xβ + IA = 1 + IA . This means NG (xβ ) = 1.
But a monomial reduces to a monomial in any reduction step since G consists of binomials.
If in the last step xγ reduces to 1. Then xγ − 1 ∈ G .
GRÖBNER BASES AND INTEGER PROGRAMMING 7
Existence of the optimal solution. Let c = (c1 , c2 , . . . , cn ) ∈ Rn+ be a cost vector and ≺
be any term order on k[x]. Define a term order ≺c induced by the weight c. Let u, v ∈ Nn .
If c.u < c.v then write xu ≺c xv . If c.u = c.v then if xu ≺ xv then xu ≺c xv . Using this term
order, we can find the optimal solution to the integer programming problem Ax = 0.
5.3. Construction of the optimal solution.
Theorem 5.4 (Optimal solution). Let G be the reduced Gröbner basis of IA with respect
to the weighted term order ≺c . Among all the binomials xβ − 1 appearing in G , choose the
one which has smallest xβ with respect to ≺c . Then β is the optimal solution of Ax = 0.
Proof. Suppose β = (β1 , β2 , . . . , βn ) is not the optimal solution to Ax = 0. Then there exists
α = (α1 , . . . , αn ) ∈ MA with c.α < c.β. Due to the monomial order ≺c the reduction path
from xα to 1 decreases the cost corresponding to the exponent vectors of monomials occurring
at each step. Let the last monomial be xγ . Then xγ − 1 ∈ G and c.γ ≤ c.α < c.β. This is a
contradiction since xγ ≺c xβ .
5.4. Sturmfel’s Algorithm. Consider 2n+d indeterminates {t1 , t2 , . . . , td }, {x1 , x2 , . . . , xn }
and {y1 , y2 , . . . , yn } with elimination order
{t1 , t2 , . . . , td } ≺ {x1 , x2 , . . . , xn } ≺ {y1 , y2 , . . . , yn }.
Let JA = ker ψ where ψ is the k-algebra homomorphism
±1
ψ : k[x1 , x2 , . . . , xn , y1 , y2 , . . . , yn ] → k[t±1 ±1
1 , t2 , . . . , td , y1 , y2 , . . . , yn ]
ψ(x1 ) = y1 tγ1 , . . . , ψ(xn ) = yn tγn , y1 → y1 , . . . , yn → yn .
Theorem 5.5. Let the reduced Gröbner basis of JA for the elimination order ≺ be G . Then
the Hilbert basis of MA is
H = {β | xβ − y β ∈ G }.
Proof. The ideal JA is a prime ideal. It does not contain any monomial. Note that that
β ∈ MA ⇔ xβ − y β ∈ JA . Suppose that H does not span MA . Then there is a smallest
monomial xβ with respect to divisibility such that β ∈ MA but does not belong to the
semigroup generated by H . The binomial xβ − y β ∈ JA and it reduces to 0 modulo JA . The
first reduction step replaces xβ by xγ y δ where δ = β − γ is nonzero. Hence xγ y δ − y β =
y δ (xγ − y γ ) ∈ JA . Therefore (xγ − y γ ) ∈ JA and γ < β. This is a contradiction. Hence, H
is the Hilbert basis of MA .
References
[1] V. Ene and J. Herzog, Gröbner bases in commutative algebra, Amer. Math. Soc. 2012.
[2] B. Sturmfels, Algorithms in invariant theory, Springer, 1993.
[3] B. Sturmfels, Gröbner bases and convex polytopes, Amer. Math. Soc. 1995.