-
Notifications
You must be signed in to change notification settings - Fork 2
Description
In #14 we're going to implement a first rank/select data structure.
Based on this data structure we will built a succinct graph, where the edge target sub-ranges will be delimited by a rank/select bit vector
targets: [0, 1, 0, 2, 3, 1, ..]
offsets: ^ ^ ^
The offsets bit vector will then delimit the start and end of sub-sequences, above: [0, 1], [0, 2, 3], [1, ..], ..
For graph traversal, for a node n we can get the out targets with [select(n), select(n + 1)].
For use cases like this we are repeatedly calling select, often to simply find the very next set bit.
We therefore should look into caching or hinting select, such that e.g. select(n + 1) can directly jump to the select(n) position and go from there. Especially because we assume the offsets bit vector to be dense anyway it could make sense to start a linear scan for the n+1 set bit from the position of the previous nth set bit.
Note: depending on how we implement our rank/select data structure this could spare us costly index lookups or linear scans. We need to look into this a bit more in detail.