• 1 reply
  • Latest Post - ‏2013-07-12T12:37:32Z by Paul Shaw
5 Posts

Pinned topic Getting different results when run in different machines

‏2013-07-11T16:49:30Z | cp different solutions


I am using CP to solve a crew scheduling problem. I am getting different results then the others users. I want to make sure we all get same solution. Is there a way of doing this. I am already setting the parameter cp.param.RandomSeed = 13; but it doesn't help. 

Thanks a lot in advance.

  • Paul Shaw
    Paul Shaw
    7 Posts

    Re: Getting different results when run in different machines


    When you are comparing two machines with the same processor and you have exactly the same libraries installed, then you should get the same result.  Otherwise, there is no guarantee that the search path or final solutions will be the same in both cases.  The most obvious variation would be if you were running on a 2-core machine and comparing that with the results on a 4-core machine.  Here, you can manually set the number of workers in CP Optimizer using cp.param.Workers = 2; for example.  Other variations can come about because you have set a time limit, and not all machines run at the same speed, or the systems are different (e.g. Linux vs Windows) and hence the compiler used to build the CP Optimizer libraries was different.  In this case, subtle differences in generated code (notably on floating-point operations) can mean that you get different system behaviour.

    Note that if you let CP Optimizer run to optimality, then regardless of the system, you will find a solution with the same quality (within the limits of the Optimality Tolerance set).