Should I use hints when reusing the model? #4704
-
Hello, When using or-tools CP-SAT to solve multi-objective problems before, I have solved the first optimisation, then just changed the constraint and solved for another optimisation. However, when I look at some examples on the internet, for example https://stackoverflow.com/a/65515320, most people recommend adding hints to make the solution faster. These lines in particular: # Hint (speed up solving)
model.AddHint(x, solver.Value(x))
model.AddHint(y, solver.Value(y)) Is this necessary in speeding up solving? Aren't the variables already set to these values from the first optimisation, or does the second solve start "fresh" with no knowledge of the previous solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
solve() does not have any context. |
Beta Was this translation helpful? Give feedback.
solve() does not have any context.