Display variables using CBC MPS input in NEOS

342 views Asked by At

Am trying to use NEOS to solve a linear program using MPS input.

The MPS file is fine, but apparently you need a "paramaters file" as well to tell the solver what to do (min/max etc.). However I can't find any information on this online anywhere.

So far I have got NEOS to solve a maximization problem and display the objective function. However I cannot get it to display the variables.

Does anyone know what code I should add to the paramters file to tell NEOS/CBC to display the resulting variables?

1

There are 1 answers

2
vitaut On

The parameter file consists of a list of Cbc (standalone) commands in a file (one per line). The format of the commands is (quoting the documentation):

One command per line (and no -)
abcd? gives list of possibilities, if only one + explanation
abcd?? adds explanation, if only one fuller help(LATER)
abcd without value (where expected) gives current value
abcd value or abcd = value sets value

The commands are the following:

?  dualT(olerance)  primalT(olerance)  inf(easibilityWeight)
integerT(olerance)  inc(rement)  allow(ableGap)  ratio(Gap)
fix(OnDj)  tighten(Factor)  log(Level)  slog(Level)
maxN(odes)  strong(Branching)  direction  error(sAllowed)
gomory(Cuts)  probing(Cuts)  knapsack(Cuts)  oddhole(Cuts)
clique(Cuts)  round(ingHeuristic)  cost(Strategy)  keepN(ames)
scaling  directory  solver  import
export  save(Model)  restore(Model)  presolve
initialS(olve)  branch(AndBound)  sol(ution)  max(imize)
min(imize)  time(Limit)  exit  stop
quit  -  stdin  unitTest
miplib  ver(sion)

To see the solution values, you should include the line sol - after the min or max line of your parameter file.

If this doesn't work you can submit the problem to NEOS in AMPL format via this page. In addition to model and data files, it accepts a commands file where you can use statements to solve the problem and display the solution, for example:

solve;
display _varname, _var;

This post describes how to convert MPS to AMPL.