2
$\begingroup$

I recently chanced upon the idea of solution diversity through the setting of random seeds within CPLEX.

However, the documentation page on the settings does not shed any light with regard to the implementation and default value of the seed value.

Hence, I would like to seek your kind assistance in resolving this as I would like to sample different solutions so as to assess their bounds and suitability as inputs for the next stage of my problem.

Thank you!

$\endgroup$
2
  • 1
    $\begingroup$ Unfortunately I can't help you with the random seed of CPLEX. But if you are interested in finding multiple solutions to an LP you might find this answer helpful. $\endgroup$
    – SimonT
    Feb 18 at 6:49
  • $\begingroup$ Thanks, appreciate your advice. Guess I would have to find a way to work around as Pyomo does have have the facility to invoke solution pools. $\endgroup$
    – Mike
    Feb 19 at 3:24
3
$\begingroup$

CPLEX treats the seed as a parameter. The parameter name varies by API; for Python it seems to be "parameters.randomseed". The docs somewhat unhelpfully state that "[t]he default value of this parameter changes with each release" (but do not specify what it is in the current release).

Note that a change to the seed is not guaranteed to produce a change in the optimal solution (even if there the optimal solution is not unique). To find multiple optimal (or near optimal) solutions, you might be better served by using the solution pool.

$\endgroup$
5
  • $\begingroup$ Thanks, appreciate your advice. Guess I would have to find a way to work around as Pyomo does have have the facility to invoke solution pools. $\endgroup$
    – Mike
    Feb 19 at 3:25
  • $\begingroup$ Dear Prof Prubin, may I ask if it is always better to just let CPLEX decide on the size and diversity of the solution pool or to configured it manually? If so, how do I ensure that a good mix of solutions. Thank you! $\endgroup$
    – Mike
    Feb 19 at 3:26
  • $\begingroup$ That's a complicated question, a bit too chewy to answer in a comment. You'll probably want to use the populate method (assuming Pyomo has that). I wrote detailed comments years ago in a couple of blog posts: orinanobworld.blogspot.com/2013/01/… and orinanobworld.blogspot.com/2013/01/…. $\endgroup$
    – prubin
    Feb 19 at 18:34
  • $\begingroup$ Dear Prof Rubin, Thank you. But I guess things had not changed much since 2019. I checked the forum and the changelog of Pyomo, this was enquired back in 2019, but till now there are no updates. $\endgroup$
    – Mike
    Feb 20 at 6:02
  • $\begingroup$ I have resorted to using the Python API to invoke Cplex separately to populate the solutions and store as a dictionary using Python. Thank you. $\endgroup$
    – Mike
    Feb 20 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.