Open bigerl opened 4 years ago
Hi,
It would be possible to optimize this by skipping whole prefix branches. If you currently are on a branch where every key has the prefix 'foo' and the another trie has no key with this prefix, you can then skip the whole branch immediately.
Unfortunately the current interface doesn't provide enough access to the internal of the iterator to do so. I have to check how to properly provide a more flexible iterator
Thibaut
The approach sounds interesting. With the prefix-skipping it would be very fast for a bunch of cases. Actually, it allows to calculate the empty cut of two sets without common prefixes in O(1). Do you have any plans to implement such an extended iterator or optimized set intersection in the near future?
I plan to extend the API of the iterator but it may take time before I start to work on it, 2 to 3 months, as I'm currently on holiday and I'll be a bit busy when I get back home.
This is more a question, than a real issue.
I am wondering, what is the most efficient way to intersect the keys of two or more hat-tries.
My naive approach would be to iterate over the keys of the HAT-trie with the smallest size and probe the others for the key. e.g.: