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

**URL:** <https://discuss.ampl.com/t/ampl-24770-changing-a-search-method-or-a-seed-to-end-with-different-feasible-solution/720>\
**Category:** Google Group Mirror\
**Created:** [September 8, 2023, 12:25am UTC](https://discuss.ampl.com/t/ampl-24770-changing-a-search-method-or-a-seed-to-end-with-different-feasible-solution/720 "2023-09-08T00:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hany\_Osman](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@Hany\_Osman](https://discuss.ampl.com/u/Hany_Osman)\
**Post date:** [September 8, 2023, 12:25am UTC](https://discuss.ampl.com/t/ampl-24770-changing-a-search-method-or-a-seed-to-end-with-different-feasible-solution/720/1 "2023-09-08T00:25:20Z")

</div>

Hi  
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?

thanks

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [September 11, 2023, 3:18pm UTC](https://discuss.ampl.com/t/ampl-24770-changing-a-search-method-or-a-seed-to-end-with-different-feasible-solution/720/2 "2023-09-11T15:18:14Z")

</div>

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](https://dev.ampl.com/solvers/cplex/options.html) 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.

---

<div class="post-metadata">

**Author:** ![Hany\_Osman](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@Hany\_Osman](https://discuss.ampl.com/u/Hany_Osman)\
**Post date:** [September 12, 2023, 5:08am UTC](https://discuss.ampl.com/t/ampl-24770-changing-a-search-method-or-a-seed-to-end-with-different-feasible-solution/720/3 "2023-09-12T05:08:49Z")

</div>

Thanks a lot, this is very helpful
