|国家预印本平台
首页|AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm

AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm

AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm

来源:Arxiv_logoArxiv
英文摘要

We introduce AbsInf, a lightweight abstract object designed as a high-performance alternative to Python's native float('inf') within pathfinding algorithms. Implemented as a C-based Python extension, AbsInf bypasses IEEE-754 float coercion and dynamic type dispatch, offering constant-time dominance comparisons and arithmetic neutrality. When integrated into Dijkstra's algorithm without altering its logic, AbsInf reduces runtime by up to 17.2%, averaging 9.74% across diverse synthetic and real-world graph datasets. This optimization highlights the performance trade-offs in high-frequency algorithmic constructs, where a symbolic use of infinity permits efficient abstraction. Our findings contribute to the broader discourse on lightweight architectural enhancements for interpreted languages, particularly in performance-critical control flows.

Anjan Bellamkonda、Laksh Bharani、Harivatsan Selvam

计算技术、计算机技术

Anjan Bellamkonda,Laksh Bharani,Harivatsan Selvam.AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm[EB/OL].(2025-04-05)[2025-05-05].https://arxiv.org/abs/2504.04302.点此复制

评论