在同一版本的 Julia 中,优化问题怎么可能有不同的解决方案?

How is it possible that in the same version of Julia, an optimizing problem has different solutions?

是否有可能在两台不同计算机上同一版本的 Julia 运行ning 中的优化代码给出了不同的解决方案? 例如,笔记本电脑中的代码 运行 获得了这两个解决方案

[712.0, 645.0], [1515.39, 322.625], "R", "V")
 ([1515.4, 322.5], [1683.3, 0.0], "R", "V")

代码是 运行 在更强大的 PC 上,但解决方案如下:


 ([712.0, 645.0], [NaN, 322.625], "R", "V")
([1515.4, 322.5], [1683.3, 0.0], "R", "V")

你能帮我看看这怎么可能吗,以及如何解决这个问题。在这段代码中,NaN 是如何发生的?有没有什么办法可以让第一个解决方案在 PC 中也能获得收益? 感谢您的热心帮助。

是的,使用 CPLEX 可以在不同的计算机上获得不同的解决方案。

具体来说,在 determinism and the timing interface 的文档中,它说:

System time (such as CPU time measured in seconds or wall clock time measured in seconds) is not deterministic; in other words, it may vary from one run to another. For example, the load of other applications on a system can impact performance and thus influence system time. Consequently, two consecutive runs even with the same time limit may yield results that are not deterministic.

如果您想提高获得确定性结果的机会,您可以设置 deterministic time limit。但是,鉴于您 运行 在两台不同的计算机上(具有不同的规格?使用不同的操作系统?)这可能仍然不够。

编辑:

评论中的link展示了如何使用JuMP设置CPLEX参数。例如,可以设置一个确定性的时间限制,像这样:

m = Model(with_optimizer(CPLEX.Optimizer, CPX_PARAM_DETTILIM=1000))