{ "info": { "author": "Alex Michael", "author_email": "mr17state@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "Soft Heap in Python\n==\n\nThis library is a full python implementation of Bernard Chazelle's soft heap [1].\n\nThe soft heap is a heap-like data structure which gives all heap operations a constant runtime, with the exception of insert. However, in order to maintain this seemingly impossible runtime, some of the data is \"corrupted\". The result of this is that insert takes O(log 1/e) where e is the rate of corruption.\n\n\n[1] http://www.cs.cmu.edu/afs/cs/academic/class/15859-f05/www/documents/p1012-chazelle.pdf\n\n### Usage\n\nTo get started, import the module. We'll also import random for this example.\n```\nfrom softheap import *\nimport random\n```\n\nThe soft heap requires one input, the error rate r. The number of corrupted nodes in the heap is inversely proportional to r.\n\n```\ns = SoftHeap(2)\n```\n\nWe can test the heap by randomly inserting 100 elements into the heap.\n\n```\narr = list(range(100))\nrandom.shuffle(arr)\n\nfor a in arr:\n s.insert(a)\n```\n\n\nNow when we deletemin repeatedly, the output will be approximately sorted.\n\n```\noutput = []\n\nfor b in range(len(arr))\n output.append(s.deletemin())\n\nprint(output)\n\n```\n\nThis takes O(n log 1/e) time.\n\n\n### Installation\n\nUse pip to install softheap. Via the command line:\n\n``\npip install softheap\n``\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alex-michael17/softheap", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "softheap", "package_url": "https://pypi.org/project/softheap/", "platform": "", "project_url": "https://pypi.org/project/softheap/", "project_urls": { "Homepage": "https://github.com/alex-michael17/softheap" }, "release_url": "https://pypi.org/project/softheap/0.2/", "requires_dist": null, "requires_python": "", "summary": "Python Soft Heap Implementation", "version": "0.2" }, "last_serial": 5479083, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fa595df7542f841d8c2cdca15ee05ab4", "sha256": "6a1b5eae2f3200ddef14d4e48091e972e24906bba4444bed4242f741f62211f2" }, "downloads": -1, "filename": "softheap-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "fa595df7542f841d8c2cdca15ee05ab4", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3165, "upload_time": "2019-06-25T01:49:37", "url": "https://files.pythonhosted.org/packages/08/e9/b8a13650cd862bf2397a3174536da2fe86efcb9ec53c44e7991f1e18699f/softheap-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e676cef7961af4dd284835afaa86441", "sha256": "110a24590fd79a1ce9fdc1f4f81162fe9216487ff872ae069ff85fa2d268b6bd" }, "downloads": -1, "filename": "softheap-0.1.tar.gz", "has_sig": false, "md5_digest": "8e676cef7961af4dd284835afaa86441", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2589, "upload_time": "2019-06-25T01:49:39", "url": "https://files.pythonhosted.org/packages/ec/f7/0d37cc571abd5c9e85a15f28dfcdf561fddc35047b4ac219608fa11a801f/softheap-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "c934629b86cba4a71e0ef0254576e6af", "sha256": "306e86a9dcf6271977e31332361350a49c7485138eefb94a210510a0ca7bd446" }, "downloads": -1, "filename": "softheap-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "c934629b86cba4a71e0ef0254576e6af", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3833, "upload_time": "2019-07-03T01:21:40", "url": "https://files.pythonhosted.org/packages/e8/d4/cdab50442713d46f0044ddbd3c8d5eb9334682370a2ee8dcd1efa45324bc/softheap-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "052650c2f83a5eef4a43ce6ba81c816a", "sha256": "442d5c0a86cf445a05cdd86510972e67e022eabdec0db11375270db60882ea89" }, "downloads": -1, "filename": "softheap-0.2.tar.gz", "has_sig": false, "md5_digest": "052650c2f83a5eef4a43ce6ba81c816a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3519, "upload_time": "2019-07-03T01:21:41", "url": "https://files.pythonhosted.org/packages/9d/06/6bc74e02d2b5129ec0caec7ab2650264df0b0ca1543fa5e2048ad2be13ad/softheap-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c934629b86cba4a71e0ef0254576e6af", "sha256": "306e86a9dcf6271977e31332361350a49c7485138eefb94a210510a0ca7bd446" }, "downloads": -1, "filename": "softheap-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "c934629b86cba4a71e0ef0254576e6af", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 3833, "upload_time": "2019-07-03T01:21:40", "url": "https://files.pythonhosted.org/packages/e8/d4/cdab50442713d46f0044ddbd3c8d5eb9334682370a2ee8dcd1efa45324bc/softheap-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "052650c2f83a5eef4a43ce6ba81c816a", "sha256": "442d5c0a86cf445a05cdd86510972e67e022eabdec0db11375270db60882ea89" }, "downloads": -1, "filename": "softheap-0.2.tar.gz", "has_sig": false, "md5_digest": "052650c2f83a5eef4a43ce6ba81c816a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3519, "upload_time": "2019-07-03T01:21:41", "url": "https://files.pythonhosted.org/packages/9d/06/6bc74e02d2b5129ec0caec7ab2650264df0b0ca1543fa5e2048ad2be13ad/softheap-0.2.tar.gz" } ] }