We study the problem of minimizing c · x subject to A · x = b, x ⩾ 0 and x integral, for a fixed matrix A. Two cost functions c and c′ are considered equivalent if they give the same optimal solutions for each b. We construct a polytope St(A) whose normal cones are the equivalence classes. Explicit inequality presentations of these cones are given by the reduced Gröbner bases associated with A. The union of the reduced Gröbner bases as c varies (called the universal Gröbner basis) consists precisely of the edge directions of St(A). We present geometric algorithms for computing St(A), the Graver basis, and the universal Gröbner basis.