About PoolSearchMode
AnsweredHow can I collect a rich set of feasible solutions (both high-quality and bad ones). It seems like PoolSearchMode=2 does not collect bad solutions while PoolSearchMode=1 does not collect the good ones ?
-
To collect a diverse set of feasible solutions in Gurobi, including both high-quality and lower-quality ones, you can utilize the Solution Pool feature. The behavior you're observing with
PoolSearchMode
is influenced by how Gurobi is configured to search for and store these solutions. Here's how you can adjust your settings to gather a broader spectrum of solutions:-
PoolSearchMode
: This parameter controls how the solution pool is populated. You've noted the behaviors of values 1 and 2, where 1 focuses on finding more solutions quickly without necessarily optimizing for quality, and 2 focuses on finding solutions that are close to the best found solution. To gather both high-quality and lower-quality solutions:- Consider running your optimization with
PoolSearchMode
set to 1 initially to populate the pool with a broad set of solutions. - Then, in a separate run, use
PoolSearchMode
set to 2 to refine the pool with higher-quality solutions. This two-step approach can help balance between quantity and quality of solutions.
- Consider running your optimization with
-
PoolSolutions
: Increase thePoolSolutions
parameter to specify the maximum number of solutions to be stored in the solution pool. The default is 10, but you can increase this to collect more solutions. Keep in mind that increasing this number can also increase the memory usage and potentially the computation time. -
PoolGap
: Set thePoolGap
parameter to specify the maximum relative gap allowed between the best solution found and the worst solution in the solution pool. By setting a higher gap, you allow Gurobi to keep solutions that are worse compared to the best solution. -
Iterative Approach: Another strategy is to use an iterative approach where you solve the model multiple times, each time adding a constraint to exclude the previously found solutions or to push the search towards different regions of the solution space. This can be more manual but allows for customized exploration of the solution space.
-
Custom Heuristics: For very specific needs or complex models, implementing custom heuristics using callbacks can be a powerful way to guide the search process toward or away from certain areas of the solution space.
Remember, collecting a wide range of solutions can significantly increase the computational time and memory requirements, especially for large-scale problems. It's a good practice to start with a smaller, manageable set of parameters and gradually adjust them based on the results and performance observed.
0 -
Please sign in to leave a comment.
Comments
1 comment