iconEuler Reference

Integer Linear Programming

LPSOLVE package (ported by Peter Notebaert), and ilpsolve() routine. The full documentation is available on

http://lpsolve.sourceforge.net/5.5/Euler.htm

defaultilpsolvedll:=0;
function startlpsolve ()

  Start the LPSOLVE DLL
function ilpsolve (A, b, c, eq = -1, ..
    vlb = [], vub = [], i = "all", ..
    scalemode = 0, keep = 0, max = 0)

  Minimize f.x subject a.x<=b, vlb<=x<=vub, and integer x.
  
  This routine is contained in the lpsolve DLL, which is loaded, if
  you load the lpsolve package with "load lpsolve". The routines have
  been ported to Euler by Peter Notebaert.
  
  The function solves the linear integer problem
  
  max v = f'*x
  a*x <> b
  vlb <= x <= vub
  x[i] are integer
  
  Arguments: The first four arguments are required.
  
  f: n vector of coefficients for a linear objective function.
  a: m by n matrix representing linear constraints.
  b: m vector of right sides for the inequality constraints.
  e: m vector that determines the sense of the inequalities:
  e(i) = -1  ==> Less Than
  e(i) =  0  ==> Equals
  e(i) =  1  ==> Greater Than
  vlb: n vector of lower bounds. If empty or omitted,
  then the lower bounds are set to zero.
  vub: n vector of upper bounds. May be omitted or empty.
  xint: vector of integer variables. May be omitted or empty.
  scalemode: scale flag. Off when 0 or omitted.
  keep: Flag for keeping the lp problem after it's been solved.
  If omitted, the lp will be deleted when solved.
  
  Output: The function returns {x,obj,duals}
  
  x: Optimal value of the decision variables.
  obj: Optimal value of the objective function.
  duals: solution of the dual problem.
  
  Documentation: http://lpsolve.sourceforge.net/5.5/Euler.htm
  
  See: 
intsimplex (Integer Linear Programming),
intsimplex (Linear Programming)
function intsimplex (A:real, b:real column, c:real vector, ..
    eq=-1, max:integer=0, min:integer=1, i="all")

  Minimize c.x=b under the conditions A.x<=b, x integer, x>=0.
  
  This is the branch and bound algorithm for integer linear problems.
  It is implemented in the Euler language. There is a faster and more
  sophisticated algorithm "ilpsolve" in the package lpsolve.
  
  Minimizes or maximizes c.x with the conditions A.x <= b, or A.x >=
  b, or A.x == b, x integer. and optionally x>=0. The parameter i is a
  row vector of indices of variables, which should be positive. If
  i="all", all variables should be positive.
  
  A : real matrix (nxm)
  b : real column vector (nx1)
  c : real row vector (1xm)
  eq : real column vector with entries -1, 0, or 1 (nx1)
  max,min : flags to maximize and minimize
  i : real row vector with indices of integer variables
  
  The function returns {x,r,a}, where x is the solution of the problem
  if r=0. a is the optimal value.
  
  See: 
simplex (Euler Core),
simplex (Linear Programming),
ilpsolve (Integer Linear Programming),
ilpsolve (lpsolve)

Documentation Homepage