[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] solving large models with glpsol
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] solving large models with glpsol |
Date: |
Sun, 21 Jul 2013 12:48:59 +0400 |
SOLVING LARGE MODELS WITH GLPSOL
Solving large models may take a long time and require a lot of memory,
so in this case it may be more convenient to split the solution process
into three stages as described below.
1. Translate the model to GLPK format as follows:
glpsol -m model.mod --wglp model.glp --check
In this case glpsol reads the model from file 'model.mod', process
it, and writes it to file 'model.glp' in GLPK format (which is
a low-level text format similar to MPS format). The option '--check'
tells glpsol not to solve the model right now.
2. Solve the model using the following command:
glpsol --glp model.glp ... -w model.sol
In this case glpsol reads the model in GLPK format from file
'model.glp', solves it, and writes its final solution to a text file
'model.sol'.
On solving the model you may try to use different options, e.g.
options to find an initial solution with a primal heuristic, options
that specify the branching technique, options that enable generating
cutting planes, etc.
If the model is of MIP class, you may save to a file not only the
final solution, but all intermediate integer feasible solutions
discovered by the solver, with the option '--save filename'. The
filename string specified in the '--save' option should contain
an asterisk (*), which will be replaced by a file serial number.
For example, if you specify '--save foo/bar*.txt', the first
solution will be written to file 'foo/bar001.txt', the second to
file 'foo/bar002.txt', etc.
3. To process the solution previously saved to a file you need to use
the following command:
glpsol -m model.mod -r model.sol [-o ...]
In this case glpsol reads the model from file 'model.mod', process
it, and reads its solution from file 'model.sol' as if the model
were solved in a normal way. This, in particular, allows to execute
model statements that follow the solve statement.
- [Help-glpk] solving large models with glpsol,
Andrew Makhorin <=