HeapDict


NameHeapDict JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttp://stutzbachenterprises.com/
Summarya heap with decrease-key and increase-key operations
upload_time2019-09-09 18:57:02
maintainer
docs_urlNone
authorStutzbach Enterprises, LLC
requires_python
licenseBSD
keywords heap decrease-key increase-key dictionary dijkstra a* priority queue
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            heapdict: a heap with decreased-key and increase-key operations
===============================================================

heapdict implements the MutableMapping ABC, meaning it works pretty
much like a regular Python dict.  It's designed to be used as a
priority queue, where items are added and consumed as follows:

::

    hd = heapdict()
    hd[obj1] = priority1
    hd[obj2] = priority2
    # ...
    (obj, priority) = hd.popitem()

Compared to an ordinary dict, a heapdict has the following differences:

popitem():
    Remove and return the (key, priority) pair with the lowest
    priority, instead of a random object.

peekitem():
    Return the (key, priority) pair with the lowest priority, without
    removing it.

Unlike the Python standard library's heapq module, the heapdict
supports efficiently changing the priority of an existing object
(often called "decrease-key" in textbooks).  Altering the priority is
important for many algorithms such as Dijkstra's Algorithm and A*.




            

Raw data

            {
    "_id": null,
    "home_page": "http://stutzbachenterprises.com/",
    "name": "HeapDict",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "heap decrease-key increase-key dictionary Dijkstra A* priority queue",
    "author": "Stutzbach Enterprises, LLC",
    "author_email": "daniel@stutzbachenterprises.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/9b/d8963ae7e388270b695f3b556b6dc9adb70ae9618fba09aa1e7b1886652d/HeapDict-1.0.1.tar.gz",
    "platform": "",
    "description": "heapdict: a heap with decreased-key and increase-key operations\n===============================================================\n\nheapdict implements the MutableMapping ABC, meaning it works pretty\nmuch like a regular Python dict.  It's designed to be used as a\npriority queue, where items are added and consumed as follows:\n\n::\n\n    hd = heapdict()\n    hd[obj1] = priority1\n    hd[obj2] = priority2\n    # ...\n    (obj, priority) = hd.popitem()\n\nCompared to an ordinary dict, a heapdict has the following differences:\n\npopitem():\n    Remove and return the (key, priority) pair with the lowest\n    priority, instead of a random object.\n\npeekitem():\n    Return the (key, priority) pair with the lowest priority, without\n    removing it.\n\nUnlike the Python standard library's heapq module, the heapdict\nsupports efficiently changing the priority of an existing object\n(often called \"decrease-key\" in textbooks).  Altering the priority is\nimportant for many algorithms such as Dijkstra's Algorithm and A*.\n\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "a heap with decrease-key and increase-key operations",
    "version": "1.0.1",
    "split_keywords": [
        "heap",
        "decrease-key",
        "increase-key",
        "dictionary",
        "dijkstra",
        "a*",
        "priority",
        "queue"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "bc42a3c6dce9671e9818003cd2c71203",
                "sha256": "6065f90933ab1bb7e50db403b90cab653c853690c5992e69294c2de2b253fc92"
            },
            "downloads": -1,
            "filename": "HeapDict-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bc42a3c6dce9671e9818003cd2c71203",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3917,
            "upload_time": "2019-09-09T18:57:00",
            "upload_time_iso_8601": "2019-09-09T18:57:00.821438Z",
            "url": "https://files.pythonhosted.org/packages/b6/9d/cd4777dbcf3bef9d9627e0fe4bc43d2e294b1baeb01d0422399d5e9de319/HeapDict-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "095327c14b6104bd89c33c14b9ac0c39",
                "sha256": "8495f57b3e03d8e46d5f1b2cc62ca881aca392fd5cc048dc0aa2e1a6d23ecdb6"
            },
            "downloads": -1,
            "filename": "HeapDict-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "095327c14b6104bd89c33c14b9ac0c39",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4274,
            "upload_time": "2019-09-09T18:57:02",
            "upload_time_iso_8601": "2019-09-09T18:57:02.154587Z",
            "url": "https://files.pythonhosted.org/packages/5a/9b/d8963ae7e388270b695f3b556b6dc9adb70ae9618fba09aa1e7b1886652d/HeapDict-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-09-09 18:57:02",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "heapdict"
}
        
Elapsed time: 0.04922s