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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Bellamkonda, Anjan, Bharani, Laksh, Selvam, Harivatsan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913778546769920
author Bellamkonda, Anjan
Bharani, Laksh
Selvam, Harivatsan
author_facet Bellamkonda, Anjan
Bharani, Laksh
Selvam, Harivatsan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2504_04302
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm
Bellamkonda, Anjan
Bharani, Laksh
Selvam, Harivatsan
Programming Languages
Data Structures and Algorithms
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.
title AbsInf: A Lightweight Object to Represent float('inf') in Dijkstra's Algorithm
topic Programming Languages
Data Structures and Algorithms
url https://arxiv.org/abs/2504.04302