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