{ "info": { "author": "Luca Cappelletti", "author_email": "cappelletti.luca94@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "approximations\n=========================================================================================\n|travis| |sonar_quality| |sonar_maintainability| |codacy| |code_climate_maintainability| |pip| |downloads|\n\nPython package containing approximations of various NP problems.\n\nHow do I install this package?\n----------------------------------------------\nAs usual, just download it using pip:\n\n.. code:: shell\n\n pip install approximations\n\nTests Coverage\n----------------------------------------------\nSince some software handling coverages sometime get slightly different results, here's three of them:\n\n|coveralls| |sonar_coverage| |code_climate_coverage|\n\nAvailable approximations\n--------------------------------------------------------------\n\nKnapsack\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nKnapsack is approximated using a FPTAS, with arbitrarily good approximation. The computing cost increases up to becoming NP as the approximation approaches 0.\n\n.. code:: python\n\n from approximations import knapsack\n\n total_weight, total_value, selected_objects = knapsack(\n weights=[1,2,3,4, 1, 2, 2, 2, 2, 2],\n values=[3,2,1,2, 1, 2, 2, 2, 2, 56],\n capacity=20,\n approximation=0.1\n ) # (18, 72, [0, 1, 3, 4, 5, 6, 7, 8, 9])\n\n\nLoad Balancing\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nLoad Balancing is approximated using a 1.5-approximation greedy algorithm.\n\n.. code:: python\n\n from approximations import load_balancing\n\n assignment, makespans = load_balancing([1,2,3,4,5,6], 3) # ([[5, 0], [4, 1], [3, 2]], [7, 7, 7])\n\nSet Cover\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nLoad Balancing is approximated using a greedy algorithm.\n\n.. code:: python\n\n from approximations image set_cover\n\n cover = set_cover(\n {1, 2, 3, 4, 5},\n [{1, 2}, {3}, {1, 2, 3, 4}, {1, 3, 5}],\n [1, 2, 3, 4]\n ) # [0, 2, 3]\n\n.. |travis| image:: https://travis-ci.org/LucaCappelletti94/approximations.png\n :target: https://travis-ci.org/LucaCappelletti94/approximations\n :alt: Travis CI build\n\n.. |sonar_quality| image:: https://sonarcloud.io/api/project_badges/measure?project=LucaCappelletti94_approximations&metric=alert_status\n :target: https://sonarcloud.io/dashboard/index/LucaCappelletti94_approximations\n :alt: SonarCloud Quality\n\n.. |sonar_maintainability| image:: https://sonarcloud.io/api/project_badges/measure?project=LucaCappelletti94_approximations&metric=sqale_rating\n :target: https://sonarcloud.io/dashboard/index/LucaCappelletti94_approximations\n :alt: SonarCloud Maintainability\n\n.. |sonar_coverage| image:: https://sonarcloud.io/api/project_badges/measure?project=LucaCappelletti94_approximations&metric=coverage\n :target: https://sonarcloud.io/dashboard/index/LucaCappelletti94_approximations\n :alt: SonarCloud Coverage\n\n.. |coveralls| image:: https://coveralls.io/repos/github/LucaCappelletti94/approximations/badge.svg?branch=master\n :target: https://coveralls.io/github/LucaCappelletti94/approximations?branch=master\n :alt: Coveralls Coverage\n\n.. |pip| image:: https://badge.fury.io/py/approximations.svg\n :target: https://badge.fury.io/py/approximations\n :alt: Pypi project\n\n.. |downloads| image:: https://pepy.tech/badge/approximations\n :target: https://pepy.tech/badge/approximations\n :alt: Pypi total project downloads \n\n.. |codacy| image:: https://api.codacy.com/project/badge/Grade/5fe5e0229af449d9863f06682189e880\n :target: https://www.codacy.com/manual/LucaCappelletti94/approximations?utm_source=github.com&utm_medium=referral&utm_content=LucaCappelletti94/approximations&utm_campaign=Badge_Grade\n :alt: Codacy Maintainability\n\n.. |code_climate_maintainability| image:: https://api.codeclimate.com/v1/badges/fa6c757264e228633237/maintainability\n :target: https://codeclimate.com/github/LucaCappelletti94/approximations/maintainability\n :alt: Maintainability\n\n.. |code_climate_coverage| image:: https://api.codeclimate.com/v1/badges/fa6c757264e228633237/test_coverage\n :target: https://codeclimate.com/github/LucaCappelletti94/approximations/test_coverage\n :alt: Code Climate Coverate", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LucaCappelletti94/approximations", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "approximations", "package_url": "https://pypi.org/project/approximations/", "platform": "", "project_url": "https://pypi.org/project/approximations/", "project_urls": { "Homepage": "https://github.com/LucaCappelletti94/approximations" }, "release_url": "https://pypi.org/project/approximations/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Python package containing approximations of various NP problems.", "version": "1.0.0" }, "last_serial": 5831902, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "83d91192e868b434095b188d931b7e73", "sha256": "7970e74b87f46c6831416cb2bfce19719317a0f696a837288ebe034a4a9d3165" }, "downloads": -1, "filename": "approximations-1.0.0.tar.gz", "has_sig": false, "md5_digest": "83d91192e868b434095b188d931b7e73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5293, "upload_time": "2019-09-15T13:22:36", "url": "https://files.pythonhosted.org/packages/9e/04/e9437104d5e26c0a365370fd0fb01131b0afe707dddb8b88034a85b2a09e/approximations-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "83d91192e868b434095b188d931b7e73", "sha256": "7970e74b87f46c6831416cb2bfce19719317a0f696a837288ebe034a4a9d3165" }, "downloads": -1, "filename": "approximations-1.0.0.tar.gz", "has_sig": false, "md5_digest": "83d91192e868b434095b188d931b7e73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5293, "upload_time": "2019-09-15T13:22:36", "url": "https://files.pythonhosted.org/packages/9e/04/e9437104d5e26c0a365370fd0fb01131b0afe707dddb8b88034a85b2a09e/approximations-1.0.0.tar.gz" } ] }