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

Feature request: bounded hamming distance #10

Closed
Benjamin-Lee opened this issue Oct 7, 2022 · 2 comments
Closed

Feature request: bounded hamming distance #10

Benjamin-Lee opened this issue Oct 7, 2022 · 2 comments

Comments

@Benjamin-Lee
Copy link

I'm working on an application in which I'll be computing the hamming distance between two strings but only care if it's below $k$. There's a bounded Levenshtein method but no corresponding Hamming function. Is it possible to get a bounded Hamming distance?

@Daniel-Liu-c0deb0t
Copy link
Owner

The reason why bounded Levenshtein distance exists is because the bound makes it run a lot faster. For Hamming distance, adding a bound won't affect the speed that much. For bounded Hamming distance you should just explicitly check, like if hamming(a, b) <= k { ... }.

@Benjamin-Lee
Copy link
Author

Ah got it. My original Nim code for Hamming distance (non-SIMD) was bounded and it did make a performance difference but I suppose SIMD changes things. Thanks for the quick answer!

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

2 participants