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

Callback in _siftup and _siftdown for synchronization with other data structures. #17

Closed
JAForbes opened this issue Jun 13, 2015 · 0 comments

Comments

@JAForbes
Copy link

I'm currently working on a project that involves traversing arbitrary graphs and establishing the best network design that connects leaf nodes to sub graphs, and the sub graphs back to the main network.

For performance reasons, the node and routes data are stored in different kinds of structures to enable fast look ups of different properties.

We are using a custom min heap, that has a callback that allows us to synchronize the heap with the other structures whenever indexes are swapped. However our Heap code isn't very well optimized and I'd like to move to use this library.

Unfortunately we can't move to this library as we need some mechanism to sync our other data structures with the min heap. I'm imagining every function that modifies the heap having an optional final argument which is this callback. The callback would receive the heap, and the two indexes that are being swapped as arguments.

Would you be interested in a pull request that brings in an optional callback parameter to _siftup and _siftdown?

Alternatively, is there some other approach that may already be available to do this.

Thanks

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

1 participant