How to enforce a Square number constraint in Microsoft Solver foundation OML?
-
26-09-2019 - |
문제
I want to limit the result to only square numbers ( I am using excel plugin). How do I enforce this?
As in, Minimize Goal X subject to a condition that X is a square number.
해결책
Create an adjustable cell, Y and restrict it to be an integer. Set the equation that you are trying to minimize equal to Y^2.
다른 팁
Mark's answer helped. The solution in OML would look like
Model[
Decisions[ .... ],
Decisions[
Integers[10000,31622],y
],
Constraints[
x == y*y,
... ]
]
제휴하지 않습니다 StackOverflow