示例中的GLPK无效指示符错误

时间:2016-12-09 18:15:54

标签: ubuntu syntax-error glpk mathprog

我无法运行我在apt-get上安装的GLPK求解器(glpsol),它包含一个名为dist的示例。它抛出以下内容:

$ glpsol dist.mod 
GLPSOL: GLPK LP/MIP Solver, v4.60
Parameter(s) specified in the command line:
 dist.mod
Reading problem data from 'dist.mod'...
dist.mod:1: invalid indicator record
MPS file processing error

编辑:使用-m运行会返回另一个错误:

172 lines were read
Generating cost...
dist.mod:103: fact contains w02 which not within specified set; see (1)
MathProg model processing error

1 个答案:

答案 0 :(得分:1)

您必须指定编写modelfile的符号(GLPK支持多种问题格式)。 默认情况下,它会尝试读取示例mathprog-problem-file上的freemps-problem-file失败。

尝试使用glpsol -m dist.mod来处理mathprog示例。