MiniZinc/minizinc-python

'--intermediate-solutions' command line argument

virajparimi opened this issue · 1 comments

Hi,

I have my own custom solver that works with Minizinc but I am not trying to get it working with the Python interface. The Minizinc interface does not have '--intermediate-solutions' option but the I looked through the python interface codebase and saw that it is set as part of the standard command line arguments.

Unfortunately, even though my solver can generate intermediate-solutions, for some reason the python interface is not able to use that feature with my solver. I have tried commenting that line out locally and then verified that my solver is able to use the python interface!

Hence, I wanted to ask if it is possible to make that flag set based on a user-defined parameter instead of setting it by default?

Thank you for the report. --intermediate-solutions is a valid MiniZinc flag, but it is part of the standard solver flags. You can find it in the command line documentation when you request the help for a solver that supports it. For example, minizinc --help gecode will include:

  -i, --intermediate --intermediate-solutions
    Print intermediate solutions for optimisation problems.

If your solve supports outputting intermediate solutions, then you should make sure you include -i in the standard flags of your MiniZinc Solver Configuration file: https://www.minizinc.org/doc-2.7.2/en/fzn-spec.html#solver-configuration-file (and make sure your executable correctly handles it).


This issue does, however, point out a problem. MiniZinc Python shouldn't provide this flag unless the solver supports it. I think it was my understanding that this flag would be ignored when -a and -i were not supported by a solver, but that is not the case.