FastHeapDict: Permanent Slot Indexing for Efficient Decrease-Key Operations in Indexed Priority Queues
Hojjat T. Goudarzi, Arash Torabi Goodarzi, Mohammad Amir Eshraghi
Abstract
Efficient decrease-key support remains an important practical concern in priority queues used by shortest-path and graph-processing algorithms. Although duplicate-entry heaps avoid explicit decrease-key operations and are simple to implement, they may accumulate many stale entries when tentative priorities are repeatedly improved. This paper presents FastHeapDict, an indexed binary min-heap based on permanent slot indexing. Instead of repeatedly locating keys through hash-table lookups during heap repair, FastHeapDict assigns each key a stable integer slot and stores that slot directly in heap entries. As a result, position updates during sift-up and sift-down operations are performed through integer indexing while preserving the usual indexed-heap interface. We evaluate FastHeapDict in both Python and C++20 using Dijkstra's algorithm as the primary experimental workload. The benchmarks include constructed dense stress graphs, randomized dense graph variants, and comparisons against duplicate-entry heaps and existing priority-queue alternatives. Across the tested Python workloads, FastHeapDict consistently outperforms the duplicate-entry heapq baseline and the tested heapdict and pqdict implementations. In the C++20 implementation, FastHeapDict also achieves strong constant-factor improvements over std::priorityqueue duplicates, std::set-based decrease-key, and std::multiset duplicates. These results indicate that permanent slot indexing can provide a compact and effective implementation strategy for indexed priority queues in workloads where priority updates are frequent.
Create a lesson
Metadata
- Comments
- 9 pages, 8 figures. Preprint; Python and C++20 implementations. Source code and benchmark artifacts available at https://github.com/hojjatgoudarzi/FastHeapDict
Related papers
Space-Efficient Text Indexing for Advanced Counting Queries
Shared title terminologycs.DSSolon P. Pissis, Sharma V. Thankachan
Differentially Oblivious Priority Queues with Sublogarithmic Cost
Shared title terminologycs.DSZimai Guo, Cheng Hong, Zhechen Li
Toggle Tree: A New Data Structure for Efficient Parallel Graph Processing
Shared title terminologycs.DSXinjian Jiang, Youzhe Liu, Yan Gu et al.
Fast Algorithms for Permanents of Permutationally-Dominant Matrices
Shared title terminologycs.DSRyan L. Mann
The Anatomy of Piecewise-Linear Learned Indexes
Shared title terminologycs.DSYue Chen, Yong Zhang
String Indexing for Maximal Gap-Bounded Occurrence Clusters
Shared title terminologycs.DSWaseem Akram, Takuya Mieno