The basic idea behind this package is to make the linear optimization program GLPK usable in/with ApCoCoA.
The package GLPK contains various functions that let you make use of the GLPK library, rather the stand-alone LP/MIP Solver glpsol.
Important: The GLPK-Program glpsol must be in the ApCoCoA package directory /binaries/glpk/examples and you must have the permissions to read and write in this directory.
The source code of GLPK can be downloaded at [1].
Usage
Let and . Let be linear polynomials and let . Let be the system of polynomial (in)equations
Then the function GLPK.LPSolve can be used to find solution to such that in the following way.
- Let
EQ
be the list , let LE
be the list , and let GE
be the list .
- Let
l
and u
be lists with l[i]
if (resp. u[i]
if ) and l[i] = ""
if (resp. u[i] = ""
if ). Furthermore, we set B := [ [l[1],u[1]], [l[2],u[2]], ..., [l[n],u[n]] ]
.
- Choose a string
Method
from [ "InterP", "Simplex" ]
depending on the method you want GLPK to use for solving the problem ("InterP"
stands for the inter-point-method and "Simplex"
for the simplex method)
- Choose a string
MinMax
from [ "Min", "Max" ]
depending on whether you want to fulfill or .
Then call
LPSolve(c,EQ,LE,GE,B,Method,MinMax)
to get the desired solution as a list b = [b1,...,bn]
.