[AMPL 24770] Changing a search method or a seed to end with different feasible solution

I have a complex problem that can’t be solved to optimality in 2 hours. I want to run for that period of time and get a feasible solution. Is there a way to get different feasible solutions if I run it 10 times. For example changing the search method, changing a seed?


There are several kinds of options that can cause a solver to take a different path and find a different solution. Here are some possibilities for CPLEX (which you were using in your previous question):

  • seed=n, where n is an integer, sets a different random seed for some of the algorithms used in CPLEX.
  • parallelmode=-1 switches CPLEX from “deterministic mode” to a faster “opportunistic mode” in which successive runs may find different solutions, even though all of the other options are the same.
  • backtrack, branch, nodesel, and many other CPLEX options modify different parts of the solver’s algorithms and thus can affect the solutions that are found.
    There are similar options for Gurobi, Xpress, and other integer-linear-quadratic solvers. The effect of any of these options is highly problem-dependent, however, so you will need to do some experimenting so see what works best for your particular application.

Thanks a lot, this is very helpful