Closed hakank closed 3 years ago
This should fix the case but be careful as
@constraint(model, x[2] < x[n] - x[n-1] + x[1])
fails for n = 2
which is the starting value in your example.
Thanks.
Yes, for n=2 this symmetry breaking constraint yield an infeasible solution, and I'll have to take care of this.
Ah, the error is only thrown for n=2 (which you surely have realized).
Yes. I've slightly changed the PR such that the terms with 0 coefficient get removed. Thanks again for testing it out and opening the issue!
I'm using the new ConstraintSolver v0.6.1 which allows
<
constraints to be used. Most of my previous models which used... <= ... - 1
works, but one model don't work: http://hakank.org/julia/constraints/golomb_ruler.jlThe offending constraint is
which throws this stacktrace:
It seems that the problem is that the LHS is an expression, since the following works, i.e. moving one of the two LHS terms to RHS: