-
Notifications
You must be signed in to change notification settings - Fork 81
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
Added library files for edit distance global #432
base: develop
Are you sure you want to change the base?
Conversation
Thanks, looks good! Just a few things to fix:
|
I just looked at the documentation of the proposed predicates (not the actual implementation), and I'm wondering if it would be possible to let the |
… small problem with a decomposition
Thank you Guido for the feedback. @zayenz: Although it would be possible to enforce ED to be equal to the minimum edit distance, it would make things harder and the decompositions would potentially require many more variables/constraints. We found out empirically, that it is often easier to efficiently constrain the edit distance to be "legal" (i.e. >=) and let the solver do the minimization, which was anyway implied by the minimization goal for the two applications we dealt with. One could think about providing an extra predicate that enforces ED to be exactly the minimum edit distance in the future though (although I cannot think of an application that needs this at the moment). |
@IXI01 Ok. As for applications of having the exact edit distance, I can imagine that I would want to use a predicate like this to find strings with a specific edit distance or even maximizing the edit distance under some set of other constraints, for example for generating test cases or for ensuring diversity of solutions. |
…ex sets for most general version
@zayenz Thank you for the interesting comments! Since you pointed out some applications, I thought about this again, and actually the most general decomposition for the ED >= case also guarantees the precise edit distance (but only this one, not the linear decompositions, not the more specific cases which are more efficient, and not the chuffed propagator). However, as it is the most general decomposition it can easily be used for an "edit_distance_exact" global variant. That's what I incorporated now, another global predicate that is exact and basically forwards any call to the most general decomposition. In the documentation I added a note that this one is likely to be less efficient than the standard cases. |
Here is the minizinc code for the edit distance global constraint that we introduced together with Peter in the AAAI 2020 paper "Explaining Propagators for String Edit Distance Constraints". It would be great if it could be included in future releases. If I should do anything else just let me know.
All the best,
Felix Winter