Closed this-josh closed 1 year ago
From reading through the test files, it seems that also.result[0].variables[0]
is not a binary number, it is Gray code. Might I suggest this is made more clear as the word 'gray' doesn't appear at all in the docs and most people who see [True, False, True]
will view it as binary. In heinseit I even studied gray code at university 😃
Essentially Platypus will say my best input is
[False, True,False]
which is 2 and gives the objective 5. But when I doobjective(2)
I get either infeasible or a different objective. Below is a minimal reproducible example. Which has a list of random valuesr
and the following problem: (Please excuse the awful formatting and pseudo maths, Github doesn't seem to like maths)$$ Min. r_{x1} * r{x_2} $$
$$ S.T. x_1 \ne x_2 $$
$$ x_1 \mod 2 ==1
$$
$$ x_2 \mod 2 ==1 $$
Now compare the platypus
valid_res
with the ones we tracked ourselves in_res
. Look atvalid_res
and chose an objective value, here I choose 16. Then consider which inputs gives the result 16 in_res
, in my experience there is no overlapSo here
_res
is saying[3,3]
(not this isn't feasible) and[7,1]
give the output. Whilevalid_res
gives[[True, False, True],[False, False, False]]
which is equal to[5,0]
, but note that our Integer space starts at 1 (plt.Integer(1,n-1
) so I think 0 represents 1, as such the platypus result is[6,1]
Note This isn't the actual problem I'm trying to solve, in my actual problem Platypus says the best objective is achieved with inputs
[0,56]
and my_res
says[1,48]
gets these results. I have also tried this withplt.Integer(0,n-1)
and found the same issue.So my question is, why are the platypus recorded inputs not aligning with their outputs?