The package consists of the solver and several utilities:
The three programs galena, preprocess, and convert2mps use the same frontend and read the same types of files:
There's also some code which translates a fragment of the CPLEX LP format into something that Galena might understand. Compiled correctly against Boost 1.33.
This is the preferred format. Any line beginning witih an asterisk '*' is a comment line. Each nonempty noncomment line is interpreted as a constraint or objective. Here is the EBNF grammar:
Nonterminals:
constraint ::= (op coef? lit)+ relation bound
objective ::= label (op coef? lit)+
Terminals:
label ::= (min|max):
op ::= (+|-)
coef ::= -?[0-9]+
lit ::= ~?x[0-9_]+
relation ::= ("<="|">="|"=")
bound ::= [0-9]+
Variable names start with x1. Terminals are seperated by whitespace, and contain no whitespace (strtok is used for tokenizing). Thus, ~x1 is short for (1-x1), while ~ x1 is an error. An objective with label "min:" is used for minimization. An objective with label "max:" is used for maximization.
In OPBDP, arbitrary identifiers can be used as variable names. However, to give the user some influence over the decision heuristic, variables are restricted to the xi format and numbered internally the same way as in the input.
For most normal usage, "galena <file>" is sufficient ("-" for stdin). Filetype is determined by the file extension: ".opb" for OPB, ".cnf.pb" for CNF+PB as used by PBS, all other extensions default to DIMACS CNF. As an exception, input read via stdin is assumed to be in OPB format.
All optimization problems are represented internally as maximization problems, and solved as a linear series of increasingly difficult decision problems. When a new solution is found, two numbers are shown, representing objective values assuming a maximization or minimization problems. UNSAT means that optimality is proven. Thus, bm23 has a minimum of 34, and 3blocks has a maximum of 63.
~/galena$ ./galena benchmarks/bm23.opb benchmarks/bm23.opb has 20 constraints CNF/CARD/LPB: 0 0 21 .|current optimum: 87 37 current optimum: 89 35 current optimum: 90 34 UNSAT CNF/CARD/LPB: 2068 8 21 Decisions: 2964 Implications: 15085 RUNTIME: 0.173973s 58/2148/41 ~/galena$ ./galena benchmarks/3blocks.opb benchmarks/3blocks.opb has 8781 constraints CNF/CARD/LPB: 7529 1253 0 .|current optimum: 61 -61 current optimum: 63 -63 UNSAT CNF/CARD/LPB: 9302 1259 0 Decisions: 1880 Implications: 94562 RUNTIME: 0.796878s 189/1605/0
The code is rather buggy; use is at own risk.