0

I had a brief exposure to CP and MiniZinc but I'm no expert.

I have a CP model, which I cannot post here ATM, implemented in MiniZinc. I need to generate all the feasible solution for the problem. We expect to have just a "few" ones, say less than 1000, more than 100.

I tried to solve the model with the -a flag passed to minizinc ver. 1.6 but I notice a lot of solutions being printed are identical.

Here they refer to "projection". In another paper I read they used some "backtracking mechanism".

It's still not clear to me.

My questions then are:

  1. what is the best way to generate only unique solutions from a CP model?
  2. Is there a standard mechanism implemented in CP libraries like SCIP or Gecode? Does it have a common name?
  3. Is it computationally efficient?
  4. does minizinc support that? How do I access that feature?
a.tavs
  • 3
  • 1

1 Answers1

4

Normally, CP systems give you just distinct solutions. I suspect that you have decision variables that are not printed (not in the output section) and you don't see that if these values are included in the solution it would be unique solutions.

In the question you linked to (this recent discussion), it is mentioned that Gecode's FlatZinc solver (at least the SVN version) now generates distinct solutions given a subset of decision variables in the output section. Other FlatZinc solver don't seem to have this feature.

If that doesn't answer your questions, please give more details of the model and example of the output (including the output section).

Community
  • 1
  • 1
hakank
  • 6,629
  • 1
  • 17
  • 27
  • Indedd. In my model I wrote a MIP-like constraint of the form `a[t] >= b[t]-b[t-1]` to indicate that a[t] measures the changes between b's values from time t-1 to t. I replaced it with `a[t] = max(0, b[t]-b[t-1])` and works as expected. I wonder though if there isn't a better way to express the constraint in a more efficient way . – a.tavs Oct 02 '14 at 14:50