Python CPU/GPU implementation of the Simulated Bifurcation (SB) algorithm to solve quadratic optimization problems (QUBO, Ising, TSP, optimal asset allocations for a portfolio, etc.).
The optimize method is necessary to mutualize code for maximization and minimization. However, it could be made private because its use may be ambiguous.
For instance, the minimize parameter being set to True by default makes the method equivalent to minimize, except if the user explicitly asks for this parameter to be False. Besides, being called minimize, it seems to imply that minimization is the normal optimization sense whereas it is purely abritrary.
Two actions can be taken to tackle this issue:
either make optimize methods/functions private so the user can only use maximize / minimize, making the API more intuitive and less ambiguous
either replace the minimize parameter by a sense or optimization_sense which has no default value (like domain) and which is either an enum of a Literal (min/max)
The
optimize
method is necessary to mutualize code for maximization and minimization. However, it could be made private because its use may be ambiguous.For instance, the
minimize
parameter being set toTrue
by default makes the method equivalent tominimize
, except if the user explicitly asks for this parameter to beFalse
. Besides, being calledminimize
, it seems to imply that minimization is the normal optimization sense whereas it is purely abritrary.Two actions can be taken to tackle this issue:
optimize
methods/functions private so the user can only usemaximize
/minimize
, making the API more intuitive and less ambiguousminimize
parameter by asense
oroptimization_sense
which has no default value (likedomain
) and which is either an enum of a Literal (min/max)