lava-optimization icon indicating copy to clipboard operation
lava-optimization copied to clipboard

OptimizationSolver.solve can probably run into an infinite loop

Open phstratmann opened this issue 2 years ago • 2 comments

Objective of issue: If timeout is set to -1, the solver will run until it finds a solution. This can mean that the solver runs into an infinite loop. I would suggest to still set a maximum number of time steps. Bad style to enable an infinite loop by normal usage of a method.

phstratmann avatar Sep 27 '22 21:09 phstratmann

Thanks Philipp,

timeout=-1 means RunContinuous is used, I wonder if we should also add a limit to RunContinuous in Lava, e.g., 2**32?

Do you suggest we totally remove the -1 option for solve, or that we default it instead to a large but finite number? We could for example default to a number of steps resulting in about an hour of execution.

GaboFGuerra avatar Oct 10 '22 13:10 GaboFGuerra

Hm... In general, it might be useful for some potential applications to allow permanent runs. Maybe just throw a warning?

phstratmann avatar Oct 10 '22 16:10 phstratmann

@phstratmann, I like the warning, but maybe we can put an extra layer of assertion, e.g., the user has to explicitly remove the limit to allow for run continuous so that only expert users do it? @mathisrichter you probably have a stronger opinion on this, and maybe run continuous is only to be used with an explicit deterministic pause, which would support removing the timeout = -1 option.

GaboFGuerra avatar Jan 12 '23 18:01 GaboFGuerra

issue is obsolete

GaboFGuerra avatar Jan 20 '23 17:01 GaboFGuerra