@c ---content LibInfo---
@comment This file was generated by doc2tex.pl from d2t_singular/intprog_lib.doc
@comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/intprog_lib.doc INSTEAD
@c library version: (1.5,2001/02/06)
@c library file: ../Singular/LIB/intprog.lib
@cindex intprog.lib
@cindex intprog_lib
@table @asis
@item @strong{Library:}
intprog.lib
@item @strong{Purpose:}
      Integer Programming with Groebner Basis Methods
@item @strong{Author:}
Christine Theis, email: ctheis@@math.uni-sb.de

@end table

@strong{Procedures:}
@menu
* solve_IP:: procedures for solving Integer Programming problems
@end menu
@c ---end content LibInfo---

@c ------------------- solve_IP -------------
@node solve_IP,,, intprog_lib
@subsubsection solve_IP
@cindex solve_IP
@c ---content solve_IP---
Procedure from library @code{intprog.lib} (@pxref{intprog_lib}).

@table @asis
@item @strong{Usage:}
solve_IP(A,bx,c,alg); A intmat, bx intvec, c intvec, alg string.
solve_IP(A,bx,c,alg); A intmat, bx list of intvec, c intvec,
alg string.
@*solve_IP(A,bx,c,alg,prsv); A intmat, bx intvec, c intvec,
alg string, prsv intvec.
@*solve_IP(A,bx,c,alg,prsv); A intmat, bx list of intvec, c intvec,
alg string, prsv intvec.

@item @strong{Return:}
same type as bx: solution of the associated integer programming
problem(s) as explained in

   @ref{Toric ideals and integer programming}.

@item @strong{Note:}
This procedure returns the solution(s) of the given IP-problem(s)
or the message `not solvable'.
@*One may call the procedure with several different algorithms:
@*- the algorithm of Conti/Traverso (ct),
@*- the positive variant of the algorithm of Conti/Traverso (pct),
@*- the algorithm of Conti/Traverso using elimination (ect),
@*- the algorithm of Pottier (pt),
@*- an algorithm of Bigatti/La Scala/Robbiano (blr),
@*- the algorithm of Hosten/Sturmfels (hs),
@*- the algorithm of DiBiase/Urbanke (du).
The argument `alg' should be the abbreviation for an algorithm as
above: ct, pct, ect, pt, blr, hs or du.

`ct' allows computation of an optimal solution of the IP-problem
directly from the right-hand vector b.
@*The same is true for its `positive' variant `pct' which may only be
applied if A and b have nonnegative entries.
@*All other algorithms need initial solutions of the IP-problem.

If `alg' is chosen to be `ct' or `pct', bx is read as the right hand
vector b of the system Ax=b. b should then be an intvec of size m
where m is the number of rows of A.
@*Furthermore, bx and A should be nonnegative if `pct' is used.
If `alg' is chosen to be `ect',`pt',`blr',`hs' or `du',
bx is read as an initial solution x of the system Ax=b.
bx should then be a nonnegative intvec of size n where n is the
number of columns of A.

If `alg' is chosen to be `blr' or `hs', the algorithm needs a vector
with positive coefficients in the row space of A.
@*If no row of A contains only positive entries, one has to use the
versions of solve_IP which take such a vector prsv as an argument.

solve_IP may also be called with a list bx of intvecs instead of a
single intvec.

@end table
@strong{Example:}
@smallexample
@c computed example solve_IP d2t_singular/intprog_lib.doc:85 
LIB "intprog.lib";
// 1. call with single right-hand vector
intmat A[2][3]=1,1,0,0,1,1;
intvec b1=1,1;
intvec c=2,2,1;
intvec solution_vector=solve_IP(A,b1,c,"pct");
solution_vector;"";
@expansion{} 0,1,0
@expansion{} 
// 2. call with list of right-hand vectors
intvec b2=-1,1;
list l=b1,b2;
l;
@expansion{} [1]:
@expansion{}    1,1
@expansion{} [2]:
@expansion{}    -1,1
list solution_list=solve_IP(A,l,c,"ct");
solution_list;"";
@expansion{} [1]:
@expansion{}    0,1,0
@expansion{} [2]:
@expansion{}    not solvable
@expansion{} 
// 3. call with single initial solution vector
A=2,1,-1,-1,1,2;
b1=3,4,5;
solve_IP(A,b1,c,"du");"";
@expansion{} 0,7,2
@expansion{} 
// 4. call with single initial solution vector
//    and algorithm needing a positive row space vector
solution_vector=solve_IP(A,b1,c,"hs");"";
@expansion{} ERROR: The chosen algorithm needs a positive vector in the row space of t\
   he matrix.
@expansion{} 0
@expansion{} 
// 5. call with single initial solution vector
//     and positive row space vector
intvec prsv=1,2,1;
solution_vector=solve_IP(A,b1,c,"hs",prsv);
solution_vector;"";
@expansion{} 0,7,2
@expansion{} 
// 6. call with list of initial solution vectors
//    and positive row space vector
b2=7,8,0;
l=b1,b2;
l;
@expansion{} [1]:
@expansion{}    3,4,5
@expansion{} [2]:
@expansion{}    7,8,0
solution_list=solve_IP(A,l,c,"blr",prsv);
solution_list;
@expansion{} [1]:
@expansion{}    0,7,2
@expansion{} [2]:
@expansion{}    7,8,0
@c end example solve_IP d2t_singular/intprog_lib.doc:85
@end smallexample
@c inserted refs from d2t_singular/intprog_lib.doc:120
@ifinfo
@menu
See also:
* Integer programming::
* intprog_lib::
* toric_lib::
@end menu
@end ifinfo
@iftex
@strong{See also:}
@ref{Integer programming};
@ref{intprog_lib};
@ref{toric_lib}.
@end iftex
@c end inserted refs from d2t_singular/intprog_lib.doc:120

@c ---end content solve_IP---
