Coluna.jl icon indicating copy to clipboard operation
Coluna.jl copied to clipboard

Model parser for tests

Open guimarqu opened this issue 3 years ago • 0 comments

We need to build a simple formulation or a reformulation for several algorithms tests. However, even if the formulation and the reformulation are simple, they are difficult to write and read. See for instance https://github.com/atoptima/Coluna.jl/blob/2e24949f459b00d47eddebb81ae3cdabbad0c1aa/test/unit/Algorithm/colgen.jl#L1-L40

In MathOptInterface.jl, they created a parser: https://github.com/jump-dev/MathOptInterface.jl/blob/b34036eabd91affcfd2b9eb26df115d59da800e2/src/Utilities/parser.jl

It would be nice to create something on top of their parser to create a reformulation. For instance (syntax should be adapted to MOI parser if we decide to build on top of it):

"""
    master:
        min x + y + z1 + z2
        st x + y + z1 + 2*z2  >= 1
        y >= 2

    dw_sp:
        x + z1 <= 3

    dw_sp:
        x + 3z2 <= 2

    representatives:
        x
"""

where y is a master variable, x a dw sp representative, z1 a variable of the first subproblem, and z2 a variable of the second subproblem.

Advantage: test easier to understand Disadvantage: it seems to be quite a lot of work & we have to make sure there is no bug in the parser.

guimarqu avatar Aug 23 '22 09:08 guimarqu