Repository navigation
Should I use hints when reusing the model? #4704
Answered
by
lperron
MarcelloTheArcane
asked this question in
CP-SAT questions
|
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? |
Answered by
lperron
Jun 25, 2025
Replies: 1 comment
|
solve() does not have any context. |
0 replies
Answer selected by
MarcelloTheArcane
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
solve() does not have any context.