| 1 |
Metadata-Version: 1.1 |
| 2 |
Name: HeapDict |
| 3 |
Version: 1.0.1 |
| 4 |
Summary: a heap with decrease-key and increase-key operations |
| 5 |
Home-page: http://stutzbachenterprises.com/ |
| 6 |
Author: Stutzbach Enterprises, LLC |
| 7 |
Author-email: [email protected] |
| 8 |
License: BSD |
| 9 |
Description: heapdict: a heap with decreased-key and increase-key operations |
| 10 |
=============================================================== |
| 11 |
|
| 12 |
heapdict implements the MutableMapping ABC, meaning it works pretty |
| 13 |
much like a regular Python dict. It's designed to be used as a |
| 14 |
priority queue, where items are added and consumed as follows: |
| 15 |
|
| 16 |
:: |
| 17 |
|
| 18 |
hd = heapdict() |
| 19 |
hd[obj1] = priority1 |
| 20 |
hd[obj2] = priority2 |
| 21 |
# ... |
| 22 |
(obj, priority) = hd.popitem() |
| 23 |
|
| 24 |
Compared to an ordinary dict, a heapdict has the following differences: |
| 25 |
|
| 26 |
popitem(): |
| 27 |
Remove and return the (key, priority) pair with the lowest |
| 28 |
priority, instead of a random object. |
| 29 |
|
| 30 |
peekitem(): |
| 31 |
Return the (key, priority) pair with the lowest priority, without |
| 32 |
removing it. |
| 33 |
|
| 34 |
Unlike the Python standard library's heapq module, the heapdict |
| 35 |
supports efficiently changing the priority of an existing object |
| 36 |
(often called "decrease-key" in textbooks). Altering the priority is |
| 37 |
important for many algorithms such as Dijkstra's Algorithm and A*. |
| 38 |
|
| 39 |
|
| 40 |
Keywords: heap decrease-key increase-key dictionary Dijkstra A* priority queue |
| 41 |
Platform: UNKNOWN |
| 42 |
Classifier: Development Status :: 5 - Production/Stable |
| 43 |
Classifier: Operating System :: OS Independent |
| 44 |
Classifier: Intended Audience :: Developers |
| 45 |
Classifier: License :: OSI Approved :: BSD License |
| 46 |
Classifier: Topic :: Software Development :: Libraries :: Python Modules |
| 47 |
Classifier: Programming Language :: Python :: 2.6 |
| 48 |
Classifier: Programming Language :: Python :: 2.7 |
| 49 |
Classifier: Programming Language :: Python :: 3 |
| 50 |
Classifier: Programming Language :: Python :: 3.0 |
| 51 |
Classifier: Programming Language :: Python :: 3.1 |
| 52 |
Classifier: Programming Language :: Python :: 3.2 |
| 53 |
Provides: heapdict |