Is it possible that an optimization code in the same version of Julia running on two different computers gives different solutions? for example a code was run in a laptop and these two solutions were gained
[712.0, 645.0], [1515.39, 322.625], "R", "V")
([1515.4, 322.5], [1683.3, 0.0], "R", "V")
the code was run in a stronger PC but the solutions were as follow:
([712.0, 645.0], [NaN, 322.625], "R", "V")
([1515.4, 322.5], [1683.3, 0.0], "R", "V")
would you please help me how it can be possible,and how this problem can be solved. In this code, how NaN was happened? is there any way that the first solution will gain in the pc also? Thanks for your kindly helps.
Yes, with CPLEX it is possible to get different solutions on different computers.
Specifically, in the documentation on determinism and the timing interface, it says:
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.
If you want to improve your chances of getting deterministic results you can set a deterministic time limit. However, given that you are running on two different computers (with different specs? with different operating systems?) this may still not be enough.
EDIT:
The link in the comments shows how to set CPLEX parameters with JuMP. For example, setting a deterministic time limit can be done, like so:
m = Model(with_optimizer(CPLEX.Optimizer, CPX_PARAM_DETTILIM=1000))