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

Subcircuit of length 1? #811

Open
Wout4 opened this issue May 10, 2024 · 2 comments
Open

Subcircuit of length 1? #811

Wout4 opened this issue May 10, 2024 · 2 comments

Comments

@Wout4
Copy link

Wout4 commented May 10, 2024

I am wondering about the semantics of subcircuit.
I thought there had to be a subcircuit of at least length 2 in the given array, but solving the following model in the IDE shows that an array where every element is self referencing is also a valid subcircuit. subcircuit([1,2,3]) is true
Is this intended?

include "globals.mzn";
int: n = 3;
array [1..n] of var 1..n: q;
constraint subcircuit(q);
constraint q[1] = 1;
constraint q[2] = 2;

solve satisfy;
@matsc-at-sics-se
Copy link

AFAIK the constraint does not require there to be a subcircuit of length at least 2.

@Wout4
Copy link
Author

Wout4 commented May 17, 2024

I think I am confused because the documentation says: Constrains the elements of x to define a subcircuit where x [ i ] = j means that j is the successor of i and x [ i ] = i means that i is not in the circuit. so if x[i] = i for all x, then there is no circuit?

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

2 participants