FlatZinc interpreter, global cardinality, missing solutions

6 views
Skip to first unread message

Mats Carlsson

unread,
Apr 27, 2023, 11:29:17 AM4/27/23
to Gecode
The following looks like a bug. I ran this model on MiniZinc + Gecode, expecting 26 solutions, but got only 22.  Model:

include "globals.mzn";
var 1..1 union 3..3: A;
var 2..3: B;
var 2..3: C;
var 2..3: D;
var 2..5: E;
var 1..4: F;
var 2..3: G;
var 2..3: H;

constraint
  global_cardinality([A,D,1,3,3,C,1,H,B],[1,2,3],[G,F,E]) :: domain;

solve :: int_search([A,B,C,D,E,F,G,H], anti_first_fail, indomain_min) satisfy;

output ["\([A,B,C,D,E,F,G,H])\n"];


Missing solutions:

[1, 2, 3, 3, 5, 1, 3, 3]
[1, 3, 2, 3, 5, 1, 3, 3]
[1, 3, 3, 2, 5, 1, 3, 3]
[1, 3, 3, 3, 5, 1, 3, 2]


--Mats

Mikael Zayenz Lagerkvist

unread,
Apr 27, 2023, 12:09:22 PM4/27/23
to gec...@googlegroups.com
HI Mats,

I can indeed see the same behaviour, and it disappears when
- ":: domain" is removed, or
- first_fail is used instead of anti_first_fail, or
- indomain_max instead of indomain_min.

Very strange and troubling, will have to investigate this.

Thanks for letting us know.

Cheers,
Mikael
> --
> You received this message because you are subscribed to the Google Groups "Gecode" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gecode+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/gecode/69137c6c-ac3b-4939-9845-dca40fae0504n%40googlegroups.com.



--
Mikael Zayenz Lagerkvist
Reply all
Reply to author
Forward
0 new messages