Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choco 3 and dynamic csp #232

Closed
meriamjemel opened this issue Oct 28, 2014 · 5 comments
Closed

choco 3 and dynamic csp #232

meriamjemel opened this issue Oct 28, 2014 · 5 comments
Milestone

Comments

@meriamjemel
Copy link

Hi,
I am researching on the CSP problems with choco 3.
The user will be able to change constraints so it would be great if the solver could run as fast as possible. When the user changes a constraint, it will have consequences for only some of the variables. Is it possible for Choco 3 to identify which calculations won't change between iterations and keep the previous results (like in dynamic csp).
Please give me an example
Thank you for your help

@jgFages
Copy link
Contributor

jgFages commented Oct 28, 2014

Hi,

Do you want to add and/or remove constraints?
You can add constraints during search without trouble.
If you want to remove constraints, which is also possible, then you should not keep previous computations because the search space you have just explored may have new and better solutions. Choco-3 will not automatically change the search tree by itself.

Therefore, after removing constraints, reset the solver (solver.reset()). Then you can simply apply one by one the decisions you have made in the current branch of the search tree, and go on searching. This should be very fast...

Can you be a bit more specific about what kind of dynamic CSPs you are willing to do?

PS: you can use explanations to better understand which constraints and variables should be reconsidered, but this would require you some developments and would be (presumably) slower than the approach I suggest.

@meriamjemel
Copy link
Author

Hi,
Thank you for your help,
As i know, in case of dynamic CSP, it is interesting to record explanations and to reuse them when solving a new CSP which differs from the previous one only by some constraints, either added or removed.
Moreover, explanations are useful to solve dynamic overconstrained problems. In fact, in case of inconsistent CSP, explanations are able to explain failure.
I would like to know how I can use this approach using choco3.
Thanks

@jgFages
Copy link
Contributor

jgFages commented Oct 29, 2014

I believe there is a misunderstanding, do you:

  • Really add/remove constraints to your model? (This happens if you have a user who decides to change the model, or if you are doing some machine learning stuff)
  • Refer to branching decisions (which are indeed added and negated during search and can be seen as constraints?

@meriamjemel
Copy link
Author

Hi,
Thank you for your help !
Yes,
I would like to really add/remove constraints to may model. In this way a new csp problem is defined.
I would like to record explanation to solve the first problem and to reuse them (can be seen as constraints) when solving the new one.

@cprudhom
Copy link
Member

cprudhom commented Nov 4, 2014

Hi,

You can add and remove constraint during the resolution. One of the question is when during the search (on a solution, on restart,etc).
However, recording explanation while some constraints can be added/removed is a nonsense since explanations are related to a constraint network.
If the constraint network changes, the explanations could be incorrect.
Keep in mind, that here, I distinct constraint and decisions: decisions can be added/removed and their addition/removal are explained.
If a constraint which has removed a value from a variable domain is then removed from the constraint network, then either the value should be restored or the explanation of the value removal is not the same.
And side-effects of such a constraint removal is not limited to values it has removed directly, but also one removed by cascade.
Moreover, removing the constraint should be explained too.

@cprudhom cprudhom added this to the support milestone Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants