Priority queues are fundamental data structures with widespread applications in various domains, including graph algorithms and network simulations. Their performance critically impacts the overall efficiency of these algorithms. Traditional priority queue implementations often face cache-related performance bottlenecks, especially in modern computing environments with hierarchical memory systems. To address this challenge, we propose an adaptive cache-friendly priority queue that utilizes three adjustable parameters to optimize the heap tree structure for specific system conditions by making a tradeoff between cache friendliness and the average number of cpu instructions needed to carry out the data structure operations. Compared to the implicit binary tree model, our approach significantly reduces the number of cache misses and improves performance, as demonstrated through rigorous testing on the heap sort algorithm. We employ a search method to determine the optimal parameter values, eliminating the need for manual configuration. Furthermore, our data structure is laid out in a single compact block of memory, minimizing the memory consumption and can dynamically grow without the need for costly heap tree reconstructions. The adaptability of our cache-friendly priority queue makes it particularly well-suited for modern computing environments with diverse system architectures.
翻译:优先队列是一种基础数据结构,广泛应用于图算法、网络仿真等多个领域,其性能直接影响相关算法的整体效率。传统优先队列实现常面临缓存性能瓶颈问题,尤其在具有分层存储系统的现代计算环境中更为突出。为应对这一挑战,我们提出了一种自适应缓存友好型优先队列,通过引入三个可调参数,在缓存友好度与执行数据结构操作所需的平均CPU指令数之间进行权衡,从而针对特定系统条件优化堆树结构。与隐式二叉树模型相比,该方法显著减少了缓存缺失次数,并通过堆排序算法的严格测试验证了其性能提升效果。我们采用搜索方法确定最优参数值,无需手动配置。此外,该数据结构以单一紧凑内存块形式布局,在最小化内存占用的同时,支持动态扩容而无需进行代价高昂的堆树重构。这种缓存友好型优先队列的适应性使其特别适用于具有多样化系统架构的现代计算环境。