pykonal.heapqΒΆ

A module providing heap-sort functionality.

This module provides a single class (pykonal.heapq.Heap) which implements a binary min-heap structure whose elements are indices (each having three components) sorted by an auxiliary value. Indices can be pushed onto and popped from the Heap and the auxiliary sort values can be updated on the fly, although care must be taken to resort the Heap so as to maintain the heap invariant when updating the underlying sort values.