Skip to main content

Radix Heap for Python

This module provides a Python implementation of Radix Heap-like data structures, designed to function as monotone priority queues. The heavy-lifting for the heap operations is powered by the radix-heap Rust crate from mpdn -- they did 99% of the hard work by implementing the data structure.

Monotone priority queues are useful for pathfinding in general (e.g., A*, Dijkstra's algorithm). A monotone priority queue must maintain the invariant where the extracted elements form a monotone sequence (e.g., for a max-heap, the extracted elements are in non-increasing order).

Overview

A Radix Heap is a type of priority queue where the extracted elements form a monotone sequence. This module includes implementations for both maximum and minimum heaps for integer and float keys.

Classes

  • RadixHeapLike[K, V]: A generic base class for Radix Heap-like structures.
  • RadixMaxHeapInt[V]: A radix max heap for integers.
  • RadixMinHeapInt[V]: A radix min heap for integers.
  • RadixMaxHeap[V]: A radix max heap for floats (or integers).
  • RadixMinHeap[V]: A radix min heap for floats (or integers).

Methods

  • push(key: K, value: V) -> None: Adds a key-value pair to the heap.
  • pop() -> V: Removes and returns the minimum value from the heap.
  • pop_with_key() -> tuple[K, V]: Removes and returns the minimum key-value pair from the heap.
  • top() -> V | None: Returns the minimum value from the heap without removing it.
  • clear() -> None: Removes all elements from the heap.
  • __len__() -> int: Returns the number of elements in the heap.

Usage Examples

Radix Max Heap for Integers

from radix_heap import RadixMaxHeapInt

heap = RadixMaxHeapInt()
heap.push(10, "A")
heap.push(5, "B")
heap.push(8, "C")

while heap:
    print(heap.pop())
# Output: "A", "C", "B"

Installation

To install the module, you can use pip:

pip install radix-heap

Contributing

Contributions are welcome! Please check the repository and feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for radix-heap 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for radix-heap 0.1.0
File Size Uploaded Provenance Actions
radix_heap-0.1.0.tar.gz 7.7 kB Without provenance Details for radix_heap-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for radix-heap 0.1.0
File Actions
radix_heap-0.1.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details for radix_heap-0.1.0-cp37-abi3-win_amd64.whl
radix_heap-0.1.0-cp37-abi3-win32.whl CPython 3.7 abi3 Windows x86-32 Details for radix_heap-0.1.0-cp37-abi3-win32.whl
radix_heap-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl CPython 3.7 abi3 Linux musl 1.2+ x86-64 Details for radix_heap-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl
radix_heap-0.1.0-cp37-abi3-musllinux_1_2_i686.whl CPython 3.7 abi3 Linux musl 1.2+ x86-32 Details for radix_heap-0.1.0-cp37-abi3-musllinux_1_2_i686.whl
radix_heap-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl CPython 3.7 abi3 Linux musl 1.2+ ARMv7l Details for radix_heap-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl
radix_heap-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl CPython 3.7 abi3 Linux musl 1.2+ ARM64 Details for radix_heap-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.7 abi3 Linux glibc 2.17+ IBM System/390x Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.7 abi3 Linux glibc 2.17+ PowerPC 64-le Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.7 abi3 Linux glibc 2.17+ ARMv7l Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
radix_heap-0.1.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl CPython 3.7 abi3 Linux glibc 2.5+ x86-32 Details for radix_heap-0.1.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
radix_heap-0.1.0-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details for radix_heap-0.1.0-cp37-abi3-macosx_11_0_arm64.whl
radix_heap-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl CPython 3.7 abi3 macOS 10.12+ x86-64 Details for radix_heap-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl

Total release size: 4.4 MB

Release files / radix_heap-0.1.0.tar.gz

Download URL radix_heap-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ece9260a6c5b0161c54d04a17b7bbf623947fd14faaac0f8d24f2a4e69ade0c6
BLAKE2b-256 checksum
How to use checksums
436de7aad8563c4a1138475a49a388eb2191373d51cfb873188648efe5fa8689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-win_amd64.whl

Download URL radix_heap-0.1.0-cp37-abi3-win_amd64.whl
Size 139.1 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2a7e642c92cbdf954c44d9ec45eb7a6a2c10034b25c120afc91863ce0d8ed6f0
BLAKE2b-256 checksum
How to use checksums
f422fc5275c5001492a36ed12add6e91f3f1c0bb2ea8576af64518c9fb53132c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-win32.whl

Download URL radix_heap-0.1.0-cp37-abi3-win32.whl
Size 132.7 kB
Tags CPython 3.7 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
41815da74a8961f992536375e65c2eed131912864a98c09799903a02c850690d
BLAKE2b-256 checksum
How to use checksums
b71de96499593fb5f4dcd9e677123b6e86da882107b2ca6d56ff841e30a4e9f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl

Download URL radix_heap-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl
Size 441.7 kB
Tags CPython 3.7 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
c8cfd135a2d9f1a9f8ace7be18bebdcc4cb770264131ae7365ae8e3d32795a76
BLAKE2b-256 checksum
How to use checksums
105e4cf74b6490a63902343f9ae42c17095f83052b6457317904482949f19137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-musllinux_1_2_i686.whl

Download URL radix_heap-0.1.0-cp37-abi3-musllinux_1_2_i686.whl
Size 463.5 kB
Tags CPython 3.7 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
6cb61593269f369d975dc61a305f605142b9f311911c6857464fab8861e6a185
BLAKE2b-256 checksum
How to use checksums
6bbfe06b61787d8fdfc3883297a9048187002a670b38e319e2120699b863d760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl

Download URL radix_heap-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl
Size 541.3 kB
Tags CPython 3.7 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
023008b292de0112f141be04f822df1be5dea71818926eacdfa387b628c1793d
BLAKE2b-256 checksum
How to use checksums
90a404e9cbca39533c1623c8e737fcbc5fcc7502c0f678a4cb1959c801c71cbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl

Download URL radix_heap-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl
Size 459.6 kB
Tags CPython 3.7 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
75a97a2253d9639201597f5ad2d1e6f6c7fac51d86331833b6fe92c1f04ee4f4
BLAKE2b-256 checksum
How to use checksums
15b92957e2c88d069f1a4b08bb29f275de1823c8ea9e7cf685127951be21530b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 272.0 kB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e1aa67c08474c47d281c566022d0cf77695b481cb8059047e51f94a59457a5cf
BLAKE2b-256 checksum
How to use checksums
db4d6c36cdc7b6e10e9ca428b6803e9034d150151f130925968be30cab13272b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 331.1 kB
Tags CPython 3.7 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
f520a1ec13a8729cb0f062435d480abd08995ea075dc1bb3c8e262115998ff99
BLAKE2b-256 checksum
How to use checksums
e5bc2ad7fa4eaba92299b01673d7fdf38b4b42d5e410e81f2a9222e7c9d9e655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 308.5 kB
Tags CPython 3.7 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
332b43cf9c9619eabade1af1d374d055972168947b07ad877a6e7e0159b5ab13
BLAKE2b-256 checksum
How to use checksums
13878c0502983b10752b2e7f5284bfdbf93fc207c03002b61b0cdf3703e02561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 278.4 kB
Tags CPython 3.7 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
128174dcd508f8dea1bad95a118f1c6f31c0910654c38d60057615419696c75e
BLAKE2b-256 checksum
How to use checksums
42a53d808262aa2dab5455c64ca6c4782d8c8820c05fa27028fe612499b13b83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 281.1 kB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2ce24a9637a3341b2c38f7a10674ca0abdadfd33d52953e732b73bd9a567a374
BLAKE2b-256 checksum
How to use checksums
61edb67d35f81c1f1227060deec7dc3ce481b1d1f4bb2af435669abcb273d840
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl

Download URL radix_heap-0.1.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Size 282.7 kB
Tags CPython 3.7 Linux glibc 2.5+ x86-32 abi3
SHA-256 checksum
How to use checksums
983952dc47648317d929ef7627342b301dc14784520ccb433716227cac9c03ea
BLAKE2b-256 checksum
How to use checksums
c382db8203db951af9deedc9036cfceaa32f28ecf2250f33b103d94bc88bb98f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-macosx_11_0_arm64.whl

Download URL radix_heap-0.1.0-cp37-abi3-macosx_11_0_arm64.whl
Size 236.2 kB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ce18ead1ce096a81b3aa13b0a99a02222ec40a0a39d2f53642f9f494d78ecf8b
BLAKE2b-256 checksum
How to use checksums
7746ba3e6980a1143efcd66dde8205ebd1faadde60575a3e976b2db8a09c95fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Release files / radix_heap-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl

Download URL radix_heap-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl
Size 238.0 kB
Tags CPython 3.7 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
242369c471d8db4a74a47ea05dbaa4214e586fabce201f96fc33473093025a16
BLAKE2b-256 checksum
How to use checksums
991323fa2c4dd5219c8f43eadc0dc7b1ead356a3ff021fbe27a8281719cbc776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.7.0

Security for radix-heap 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

15 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page