I am currently trying to solve a problem with constraint programming. My problem is that for example you need a set of numbers and you can only have a maximum number of 9 with a required length of 6 so you can get something like [1, 3, 4, 5, 6, 8]
now when you sum up all these numbers you will get 27 but from the given variables above you can also get sum([1, 2, 3, 5, 7, 9])
and still get 27. But I am trying to get the exact [1, 3, 4, 5, 6, 8]
so my current solution for this is to get a unique "trait" from the set of numbers I have, I've tried many solutions but all of them only works on small numbers for example :
I have this array called "shifts" this is equals to [1, 2, 3, 4, 5, 6, 7, 9]
so I am going to multiply this with the set of numbers I have based on index for example
1 * 1 = 1
3 * 2 = 6
4 * 3 = 12
5 * 4 = 20
6 * 5 = 30
8 * 6 = 48
-----------
= 117
This is different from
1 * 1 = 1
2 * 2 = 4
3 * 3 = 9
5 * 4 = 20
7 * 5 = 35
9 * 6 = 54
----------
= 123
So now from my current constraint algorithm I can look for the number 117 to get the pattern I want. The problem is the chances of duplication rises the larger the numbers in your set of numbers and the larger your required length is so when I ran my algorithm it gives me another set of numbers that fits in the constraints I have given.
So are there any unique "traits" to get from the pattern that we are looking for? So far as stated from all the things I've tried I can only get the pattern I want if the set of numbers, and required length is small enough.
Note: Since I am using constraint programming I can't use division only floored division and no floats only integers