Difference between revisions of "Package glpk"
From ApCoCoAWiki
Andraschko (talk | contribs) (Created page with "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 o...") |
(No difference)
|
Revision as of 11:02, 1 November 2020
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 , letLE
be the list , and letGE
be the list . - Let
l
andu
be lists withl[i]
if (resp.u[i]
if ) andl[i] = ""
if (resp.u[i] = ""
if ). Furthermore, we setB := [ [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]
.