In my CP SAT Or-tools optimisation, I need to extract and assign the diagonal (hypotenuse) of a right-angled triangle to an or-tools variable; knowing that x and y of the triangle are known as or-tools integer variables.
The value of the diagonal, rounded to the nearest integer, is suitable in terms of precision.
How can I do this, given that I can't see a solution or a suitable function for extracting the square root of a value?
Thanks in advance,
There is some code for that in the spread_robot example.
The code in the example only maintain an upper bound of the square root with a given scaling.
You will need to add the inequalities with