I am trying to explore a riddle with MiniZinc. I have a weighing platter, and I need 4 weighs satisfying two constraints:
But the second constraint is in my mind rephrased as "there exists a combination of the weights so that..." and this seems difficult/inadapted for me in MiniZinc. Is there a natural way to express this constraint in MiniZinc?
Thanks in advance!
It very much depends on what you mean by "natural". I wrote a model of this problem some years ago and to me it's natural (at least after some thoughts).
Here is a hint that might help.
Think of each of the four weights as either at the right pan, the left pan or not involved in the measurement of each specific weight (1..40kg). If the weight is at the right pan then it has "positive" weight, if at the left pan it has "negative weight". And 0 otherwise.
Does that help at all?