Skip to content

IntPriorityQueue for efficient priority queues with integer keys  #482

Description

@SohamTamba

I will be creating a datastructure IntPriorityQueue which is a PriorityQueue which excepts keys from 1:n (n is the input) similar to IntDisjointSets.
This is required to increase the performance in this PR by replacing the index hash table with an array.

Should I PR the code to DataStructures.jl?

Activity

  1. kmsquire commented on Feb 24, 2019

    @kmsquire
    Member

    I think that would be fine. If you post and don't get a response within a day or two, send a gentle bump.🙂

  2. SyxP commented on Feb 25, 2019

    @SyxP

    By the way, I think this would only be efficient on dense graphs. I'm not entirely sure whether this would actually be an improvement on sparse graphs.

  3. kmsquire commented on Feb 25, 2019

    @kmsquire
    Member

    If the interface is similar to the existing interface, it's usually nice to have different data structures and algorithms available for comparison for any given problem.

  4. SohamTamba commented on Mar 2, 2019

    @SohamTamba
    Author

    @SyxP is right and integer priority queue did not improve performance as much as I thought it would.
    See Comment

    In case anyone is interested, I have a rough implementation of int_PriorityQueue which can be found here.

  5. SyxP commented on Mar 2, 2019

    @SyxP

    I feel that this should still be merged in. (Even better, allow the user a control over the type of dictionary used to hash the entries in the PQ, rather than just a Dict as in the current implementation.) This could have uses outside of Dijkstra's algorithm.

  6. oxinabox commented on Mar 2, 2019

    @oxinabox
    Member

    am leaving this open for a bit.

    The Int_PQ had noticably less alocations than other methods.
    So worth thinking about.

  7. eulerkochy commented on Mar 6, 2019

    @eulerkochy
    Member

    Anyone working on this?

  8. SohamTamba commented on Mar 6, 2019

    @SohamTamba
    Author

    am leaving this open for a bit.

    The Int_PQ had noticably less alocations than other methods.
    So worth thinking about.

    The allocations are fewer because the index array is allocated statically, instead of a dynamic hash table.

    Sorry for the late response, didn't see the notification until recently

  9. SohamTamba commented on Mar 6, 2019

    @SohamTamba
    Author

    Anyone working on this?

    If Datastructues.jl wants it, I'd be happy to complete it.

    Instead of keeping two 300 line files for PriorityQueue and Int_PriorityQueue, it might be possible to use multiple dispatch to keep one file.
    The only difference is the hash table is replaced with an array.

  10. nsajko commented on Oct 9, 2026

    @nsajko
    Member

    possible dup: issue #504

  11. added theissue type on Oct 9, 2026
  12. eulerkochy commented on Oct 9, 2026

    @eulerkochy
    Member

    I can work on this, have bandwidth now to pursue this till completion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions