Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fzn-gecode, global cardinality, missing solutions #166

Open
matsc-at-sics-se opened this issue Jun 24, 2023 · 1 comment
Open

fzn-gecode, global cardinality, missing solutions #166

matsc-at-sics-se opened this issue Jun 24, 2023 · 1 comment

Comments

@matsc-at-sics-se
Copy link

On Ubuntu 22.04.2 LTS.

The following model has 26 solutions, but fzn-gecode find 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]
@matsc-at-sics-se
Copy link
Author

Here is the smallest model that I was able to find for this bug.

include "globals.mzn";
var 1..3: A;
var 1..3: B;
var 1..3: C;
var 1..2: D;
var 2..3: E;
var 2..3: G;
constraint
  global_cardinality([3,A,D,G,E],[1,2,3],[1,B,C]) :: domain;
solve :: int_search([D,A,E,B], input_order, indomain_random, complete) satisfy;
output ["\([A,B,C,D,E,G])\n"];

Missing solution:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant