pywraplp: every run yields different local optimum

81 views
Skip to first unread message

gunvor...@gmail.com

unread,
Apr 28, 2019, 3:04:09 PM4/28/19
to or-tools-discuss
Hi,

I am using pywralp.Solver.CBC_MIXED_INTEGER_PROGRAMMING to solve my model. Every run gives the same objective function value, but the values of some of the variables of the solution varies for every run---the solver finds different local optima. Is there any way to make the solver find the same local optima for every run?

Originally, I used lists for the variables and constraints. If I recall correctly, the solver then found the same local optima every run. It is however necessary for me to use dictionaries rather than lists. When I construct my model, I store all the variables and constraints in dictionaries, like so:
    solver = pywraplp.Solver('CBC', pywralp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)
    x = dict()
    x['x1'] = solver.NumVar(0, 1, 'x1')
    x['x2'] = solver.NumVar(0, 1, 'x2')

Since the dictionaries are without order, I suspected that this was the issue. So, I have now rewritten the code to use OrderedDict(), so that I have order like with lists. Unfortunately, this has not solved my problem.

Do you have any explanation to why I am not able to get the same local optima every run? I would be extremely greatful for tips regarding how I can fix my problem. Thanks in advance!


- Gunvor

Laurent Perron

unread,
Apr 28, 2019, 3:48:23 PM4/28/19
to or-tools-discuss
Because CBC is unreliable :-(

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/460a9125-cc63-4e11-9115-3f07b2cd0eb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--Laurent

Reply all
Reply to author
Forward
0 new messages