@menu * Toric ideals:: Definition and computation. * Integer programming:: An algorithm using toric ideals. * Relevant References:: @end menu @node Toric ideals, Integer programming, , Toric ideals and integer programming @subsection Toric ideals @cindex toric ideals @cindex ideal, toric @tex Let $A$ denote an $m\times n$ matrix with integral coefficients. For $u \in Z\!\!\! Z^n$, we define $u^+,u^-$ to be the uniquely determined vectors with nonnegative coefficients and disjoint support (i.e., $u_i^+=0$ or $u_i^-=0$ for each component $i$) such that $u=u^+-u^-$. For $u\geq 0$ component-wise, let $x^u$ denote the monomial $x_1^{u_1}\cdot\ldots\cdot x_n^{u_n}\in K[x_1,\ldots,x_n]$. The ideal $$ I_A:=(x^{u^+}-x^{u^-} | u\in\ker(A)\cap Z\!\!\! Z^n)\ \subset K[x_1,\ldots,x_n] $$ is called a \bf toric ideal. \rm The first problem in computing toric ideals is to find a finite generating set: Let $v_1,\ldots,v_r$ be a lattice basis of $\ker(A)\cap Z\!\!\! Z^n$ (i.e, a basis of the $Z\!\!\! Z$-module). Then $$ I_A:=I:(x_1\cdot\ldots\cdot x_n)^\infty $$ where $$ I= $$ @end tex @ifinfo Let A denote an mxn matrix with integral coefficients. For u in Z^n, we define u+,u- to be the uniquely determined vectors with nonnegative coefficients and disjoint support (i.e., u+[i]=0 or u-[i]=0 for each component i) such that u = u+ - u-. For u>=0 component-wise, let x^u denote the monomial x(1)^u[1] *@dots{}* x(n)^u[n] in K[x(1),@dots{},x(n)]. The ideal in K[x(1),@dots{},x(n)] @* @display I(A):= ( x^u+ - x^u- | u in ker(A), u in Z^n ) @end display is called a @strong{toric ideal}. The first problem in computing toric ideals is to find a finite generating set: Let v(1),@dots{},v(r) be a lattice basis of ker(A) as a subset of Z^n (i.e., a basis of the Z-module). Then @* @display I(A):= sat( I, x[1] *@dots{}* x[n]) @end display where @* @display I= ( x^v(i)+ - x^v(i)- | i=1,@dots{},r ). @end display @end ifinfo The required lattice basis can be computed using the LLL-algorithm (@pxref{[Coh93]}). For the computation of the saturation, there are various possibilities described in the @tex section Algorithms. @end tex @ifinfo menu entry Algorithms. @end ifinfo @menu * Algorithms:: Various algorithms for computing toric ideals. * Buchberger algorithm:: Specializing it for toric ideals. @end menu @node Algorithms, Buchberger algorithm, , Toric ideals @subsection Algorithms The following algorithms are implemented in @ref{toric_lib}. @menu * Conti and Traverso:: * Pottier:: * Hosten and Sturmfels:: * Di Biase and Urbanke:: * Bigatti and La Scala and Robbiano:: @end menu @node Conti and Traverso, Pottier, , Algorithms @subsubsection The algorithm of Conti and Traverso @cindex Conti-Traverso algorithm @cindex algorithm of Conti and Traverso The algorithm of Conti and Traverso (@pxref{[CoTr91]}) @tex computes $I_A$ via the extended matrix $B=(I_m|A)$, where $I_m$ is the $m\times m$ unity matrix. A lattice basis of $B$ is given by the set of vectors $(a^j,-e_j)\in Z\!\!\! Z^{m+n}$, where $a^j$ is the $j$-th row of $A$ and $e_j$ the $j$-th coordinate vector. We look at the ideal in $K[y_1,\ldots,y_m,x_1,\ldots,x_n]$ corresponding to these vectors, namely $$ I_1=.$$ We introduce a further variable $t$ and adjoin the binomial $t\cdot y_1\cdot\ldots\cdot y_m -1$ to the generating set of $I_1$, obtaining an ideal $I_2$ in the polynomial ring $K[t, y_1,\ldots,y_m,x_1,\ldots,x_n]$. $I_2$ is saturated w.r.t. all variables because all variables are invertible modulo $I_2$. Now $I_A$ can be computed from $I_2$ by eliminating the variables $t,y_1,\ldots,y_m$. @end tex @ifinfo computes I(A) via the extended matrix B= ( I | A ), where I is the mxm unity matrix. A lattice basis of B is given by the set of vectors (a^j,-e_j) in Z^(m+n), where a^j is the j-th row of A and e_j the j-th coordinate vector. We look at the ideal in K[y(1),@dots{},y(m),x(1),@dots{},x(n)] corresponding to these vectors, namely @* @display I1= ( y^(a_j)+ - x(j) * y^(a_j)- | j=1,@dots{},n ). @end display We introduce a further variable t and adjoin the binomial t * y(1) *@dots{}* y(m) -1 to the generating set of I1, obtaining an ideal I2 in the polynomial ring K[t,y(1),@dots{},y(m),x(1),@dots{},x(n)]. I2 is saturated w.r.t.@: all variables because all variables are invertible modulo I2. Now I(A) can be computed from I2 by eliminating the variables t,y(1),@dots{},y(m). @end ifinfo Because of the big number of auxiliary variables needed to compute a toric ideal, this algorithm is rather slow in practice. However, it has a special importance in the application to integer programming (@pxref{Integer programming}). @node Pottier, Hosten and Sturmfels, Conti and Traverso, Algorithms @subsubsection The algorithm of Pottier @cindex Pottier algorithm @cindex algorithm of Pottier The algorithm of Pottier (@pxref{[Pot94]}) starts by computing a lattice @tex basis $v_1,\ldots,v_r$ for the integer kernel of $A$ using the LLL-algorithm. The ideal corresponding to the lattice basis vectors $$ I_1= $$ is saturated -- as in the algorithm of Conti and Traverso -- by inversion of all variables: One adds an auxiliary variable $t$ and the generator $t\cdot x_1\cdot\ldots\cdot x_n -1$ to obtain an ideal $I_2$ in $K[t,x_1,\ldots,x_n]$ from which one computes $I_A$ by elimination of $t$. @end tex @ifinfo basis v(1),@dots{},v(r) for the integer kernel of A using the LLL-algorithm. The ideal corresponding to the lattice basis vectors @* @display I1= ( x^v(i)+ - x^v(i)- | i=1,@dots{},r ) @end display is saturated -- as in the algorithm of Conti and Traverso -- by inversion of all variables: One adds an auxiliary variable t and the generator t * x(1) *@dots{}* x(n) -1 to obtain an ideal I2 in K[t,x(1),@dots{},x(n)] from which one computes I(A) by elimination of t. @end ifinfo @node Hosten and Sturmfels, Di Biase and Urbanke, Pottier, Algorithms @subsubsection The algorithm of Hosten and Sturmfels @cindex Hosten-Sturmfels algorithm @cindex algorithm of Hosten and Sturmfels The algorithm of Hosten and Sturmfels (@pxref{[HoSt95]}) allows to @tex compute $I_A$ without any auxiliary variables, provided that $A$ contains a vector $w$ with positive coefficients in its row space. This is a real restriction, i.e., the algorithm will not necessarily work in the general case. A lattice basis $v_1,\ldots,v_r$ is again computed via the LLL-algorithm. The saturation step is performed in the following way: First note that $w$ induces a positive grading w.r.t. which the ideal $$ I= $$ corresponding to our lattice basis is homogeneous. We use the following lemma: Let $I$ be a homogeneous ideal w.r.t. the weighted reverse lexicographical ordering with weight vector $w$ and variable order $x_1 > x_2 > \ldots > x_n$. Let $G$ denote a Groebner basis of $I$ w.r.t. this ordering. Then a Groebner basis of $(I:x_n^\infty)$ is obtained by dividing each element of $G$ by the highest possible power of $x_n$. From this fact, we can succesively compute $$ I_A= I:(x_1\cdot\ldots\cdot x_n)^\infty =(((I:x_1^\infty):x_2^\infty):\ldots :x_n^\infty); $$ in the $i$-th step we take $x_i$ as the smallest variable and apply the lemma with $x_i$ instead of $x_n$. This procedure involves $n$ Groebner basis computations. Actually, this number can be reduced to at most $n/2$ @end tex @ifinfo compute I(A) without any auxiliary variables, provided that A contains a vector w with positive coefficients in its row space. This is a real restriction, i.e., the algorithm will not necessarily work in the general case. A lattice basis v(1),@dots{},v(r) is again computed via the LLL-algorithm. The saturation step is performed in the following way: First note that w induces a positive grading w.r.t.@: which the ideal @* @display I= ( x^v(i)+ - x^v(i)- | i=1,@dots{},r ) @end display corresponding to our lattice basis is homogeneous. We use the following lemma: Let I be a homogeneous ideal w.r.t.@: the weighted reverse lexicographical ordering with weight vector w and variable order x(1) > x(2) > @dots{} > x(n). Let G denote a Groebner basis of I w.r.t.@: this ordering. Then a Groebner basis of sat(I,x(n)) is obtained by dividing each element of G by the highest possible power of x(n). From this fact, we can succesively compute @* @display I(A)= sat(I, x(1) *@dots{}* x(n)) @ @ @ @ = sat(@dots{}(sat(sat(I,x(1)), x(2)), @dots{}, x(n))); @end display in the i-th step we take x(i) as the cheapest variable and apply the lemma with x(i) instead of x(n). This procedure involves n Groebner basis computations. Actually, this number can be reduced to at most n/2 @end ifinfo (@pxref{[HoSh98]}), and the single computations -- except from the first one -- show to be easy and fast in practice. @node Di Biase and Urbanke, Bigatti and La Scala and Robbiano, Hosten and Sturmfels, Algorithms @subsubsection The algorithm of Di Biase and Urbanke @cindex Di Biase-Urbanke algorithm @cindex algorithm of Di Biase and Urbanke Like the algorithm of Hosten and Sturmfels, the algorithm of Di Biase and Urbanke (@pxref{[DBUr95]}) performs up @tex to $n/2$ Groebner basis computations. It needs no auxiliary variables, but a supplementary precondition; namely, the existence of a vector without zero components in the kernel of $A$. The main idea comes from the following observation: Let $B$ be an integer matrix, $u_1,\ldots,u_r$ a lattice basis of the integer kernel of $B$. Assume that all components of $u_1$ are positive. Then $$ I_B=, $$ i.e., the ideal on the right is already saturated w.r.t. all variables. The algorithm starts by finding a lattice basis $v_1,\ldots,v_r$ of the kernel of $A$ such that $v_1$ has no zero component. Let $\{i_1,\ldots,i_l\}$ be the set of indices $i$ with $v_{1,i}<0$. Multiplying the components $i_1,\ldots,i_l$ of $v_1,\ldots,v_r$ and the columns $i_1,\ldots,i_l$ of $A$ by $-1$ yields a matrix $B$ and a lattice basis $u_1,\ldots,u_r$ of the kernel of $B$ that fulfill the assumption of the observation above. It is then able to compute a generating set of $I_A$ by applying the following ``variable flip'' successively to $i=i_1,\ldots,i_l$: Let $>$ be an elimination ordering for $x_i$. Let $A_i$ be the matrix obtained by multiplying the $i$-th column of $A$ by $-1$. Let $$\{x_i^{r_j} x^{a_j} - x^{b_j} | j\in J \}$$ be a Groebner basis of $I_{A_i}$ w.r.t. $>$ (where $x_i$ is neither involved in $x^{a_j}$ nor in $x^{b_j}$). Then $$\{x^{a_j} - x_i^{r_j} x^{b_j} | j\in J \}$$ is a generating set for $I_A$. @end tex @ifinfo to n/2 Groebner basis computations. It needs no auxiliary variables, but a supplementary precondition; namely, the existence of a vector without zero components in the kernel of A. The main idea comes from the following observation: Let B be an integer matrix, u(1),@dots{},u(r) a lattice basis of the integer kernel of B. Assume that all components of u(1) are positive. Then @* @display I(B)= ( x^u(i)+ - x^u(i)- | i=1,@dots{},r ), @end display i.e., the ideal on the right is already saturated w.r.t.@: all variables. The algorithm starts by finding a lattice basis v(1),@dots{},v(r) of the kernel of A such that v(1) has no zero component. Let @{ i1,@dots{},il @} be the set of indices i with v(1)_i <0. Multiplying the components i1,@dots{},il of v(1),@dots{},v(r) and the columns i1,@dots{},il of A by -1 yields a matrix B and a lattice basis u(1),@dots{},u(r) of the kernel of B that fulfill the assumption of the observation above. We are then able to compute a generating set of I(A) by applying the following ``variable flip'' successively to i=i1,@dots{},il: Let > be an elimination ordering for x(i). Let A(i) be the matrix obtained by multiplying the i-th column of A with -1. Let @* @display @{ x(i)^r(j) * x^a(j) - x^b(j) | j in J @} @end display be a Groebner basis of I(A(i)) w.r.t.@: > (where x(i) is neither involved in x^a(j) nor in x^b(j)). Then @* @display @{ x^a(j) - x(i)^r(j) * x^b(j) | j in J @} @end display is a generating set for I(A). @end ifinfo @node Bigatti and La Scala and Robbiano, , Di Biase and Urbanke, Algorithms @subsubsection The algorithm of Bigatti, La Scala and Robbiano @cindex Bigatti-La Scala-Robbiano algorithm @cindex algorithm of Bigatti, La Scala and Robbiano The algorithm of Bigatti, La Scala and Robbiano (@pxref{[BLR98]}) combines the ideas of the algorithms of Pottier and of Hosten and Sturmfels. The computations are performed on a graded ideal with one auxiliary @tex variable $u$ and one supplementary generator $x_1\cdot\ldots\cdot x_n - u$ (instead of the generator $t\cdot x_1\cdot\ldots\cdot x_n -1$ in the algorithm of Pottier). The algorithm uses a quite unusual technique to get rid of the variable $u$ again. @end tex @ifinfo variable u and one supplementary generator x(1) *@dots{}* x(n) -u (instead of the generator t * x(1) *@dots{}* x(n) -1 in the algorithm of Pottier). The algorithm uses a quite unusual technique to get rid of the variable u again. @end ifinfo There is another algorithm of the authors which tries to parallelize the computations (but which is not implemented in this library). @node Buchberger algorithm, , Algorithms, Toric ideals @subsection The Buchberger algorithm for toric ideals @cindex Buchberger algorithm for toric ideals Toric ideals have a very special structure that allows us to improve the Buchberger algorithm in many aspects: They are prime ideals and generated by binomials. Pottier used this fact to describe all operations of the Buchberger algorithm on the ideal generators in terms of vector additions and subtractions. Some other strategies like multiple reduction (@pxref{[CoTr91]}) or the use of bit vectors to represent the support of a monomial (@pxref{[Big97]}) may be applied to more general ideals, but show to be especially useful in the toric case. @node Integer programming, Relevant References, Toric ideals, Toric ideals and integer programming @subsection Integer programming @cindex integer programming @tex Let $A$ be an $m\times n$ matrix with integral coefficients, $b\in Z\!\!\! Z^m$ and $c\in Z\!\!\! Z^n$. The problem $$ \min\{c^T x | x\in Z\!\!\! Z^n, Ax=b, x\geq 0\hbox{ component-wise}\} $$ is called an instance of the \bf integer programming problem \rm or \bf IP problem. \rm The IP problem is very hard; namely, it is NP-complete. For the following discussion let $c\geq 0$ (component-wise). We consider $c$ as a weight vector; because of its nonnegativity, $c$ can be refined into a monomial ordering $>_c$. It turns out that we can solve such an IP instance with the help of toric ideals: First we assume that an initial solution $v$ (i.e., $v\in Z\!\!\! Z^n, v\geq 0, Av=b$) is already known. We obtain the optimal solution $v_0$ (i.e., with $c^T v_0$ minimal) by the following procedure: @end tex @c \begin{itemize} @c \item (1) Compute the toric ideal $I_A$ using one of the algorithms in the @c previous section. @c \item (2) Compute the reduced Groebner basis $G_c$ of $I_A$ w.r.t. @c $>_c$. @c \item (3) Reduce $x^v$ modulo $G_c$ using the Hironaka division algorithm. @c If the result of this reduction is $x^{v_0}$, then $v_0$ is an @c optimal solution of the given instance. @c \end{itemize} @ifinfo Let A be an mxn matrix with integral coefficients, b in Z^m and c in Z^n. The problem @* @display min @{ c*x | x in Z^n, A*x=b, x>=0 component-wise @} @end display is called an instance of the @strong{integer programming problem} or @strong{IP problem}. The IP problem is very hard; namely, it is NP-complete. For the following discussion let c>=0 (component-wise). We consider c as a weight vector; because of its nonnegativity, c can be refined into a monomial ordering >_c. It turns out that we can solve such an IP instance with the help of toric ideals: First we assume that an initial solution v (i.e., v in Z^n, v>=0, A*v=b) is already known. We obtain the optimal solution v(opt) (i.e., with c*v(opt) minimal) by the following procedure: @end ifinfo @itemize @bullet @item (1) Compute the toric ideal I(A) using one of the algorithms in the previous section. @item (2) Compute the reduced Groebner basis G(c) of I(A) w.r.t.@: @math{>_c}. @item (3) Reduce @math{x^v} modulo G(c) using the Hironaka division algorithm. If the result of this reduction is @math{x^{v_0}}, then @math{v_0} is an optimal solution of the given instance. @end itemize If no initial solution is known, we are nevertheless able to solve the problem with similar techniques. For this purpose we replace our instance by an extended instance with the matrix used in the Conti-Traverso algorithm. Indeed, the Conti-Traverso algorithm offers the possibility to verify solvability of a given instance and to find an initial solution in the case of existence (but none of the other algorithms does!). Details can be found in [CoTr91] and [The99]. An implementation of the above algorithm and some examples can be found in @ref{intprog_lib}. Classical methods for solving IP instances like Branch-and-Bound methods seem to be faster in general than the methods using toric ideals. But the latter have one great advantage: If one wants to solve various instances that differ only by the vector @math{b}, one has to perform steps (1) and (2) above only once. As the running time of step (3) is very short, solving all the instances is not much harder than solving one single instance. For a detailed discussion see [The99]. @node Relevant References, , Integer programming, Toric ideals and integer programming @subsection Relevant References @itemize @bullet @item [Big97] Bigatti, A.M.: @anchor{[Big97]} Computation of Hilbert-Poincare series. Journal of Pure and Applied Algebra (1997) 199, 237-253 @item [BLR98] Bigatti, A.M.; La Scala, R.; Robbiano, L.: @anchor{[BLR98]} Computing toric ideals. Journal of Symbolic Computation (to appear) @item [Coh93] Cohen, H.: @anchor{[Coh93]} A Course in Computational Algebraic Number Theory. Springer (1997) @item [CoTr91] Conti, P.; Traverso, C.: @anchor{[CoTr91]} Buchberger algorithm and integer programming. Proceedings AAECC-9 (new Orleans), Springer LNCS (1991) 539, 130-139 @item [DBUr95] Di Biase, F.; Urbanke, R.: @anchor{[DBUr95]} An algorithm to calculate the kernel of certain polynomial ring homomorphisms. Experimental Mathematics (1995) 4, 227-234 @item [HoSh98] Hosten, S.; Shapiro, J.: @anchor{[HoSh98]} Primary decomposition of lattice basis ideals. (to appear) @item [HoSt95] Hosten, S.; Sturmfels, B.: @anchor{[HoSt95]} GRIN: An implementation of Groebner bases for integer programming. in Balas, E.; Clausen, J. (editors): Integer Programming and Combinatorial Optimization. Springer LNCS (1995) 920, 267-276 @item [Pot94] Pottier, L.: @anchor{[Pot94]} Groebner bases of toric ideals. Rapport de recherche 2224 (1997), INRIA Sophia Antipolis @item [Stu96] Sturmfels, B.: @anchor{[Stu96]} Groebner Bases and Convex Polytopes. University Lecture Series, Volume 8 (1996), American Mathematical Society @item [The99] Theis, C.: @anchor{[The99]} Der Buchberger-Algorithmus fuer torische Ideale und seine Anwendung in der ganzzahligen Optimierung. Diplomarbeit, Universitaet des Saarlandes (1999), Saarbruecken (Germany) @end itemize