{ "info": { "author": "Nico Schl\u00f6mer", "author_email": "nico.schloemer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "# tspsolve\n\n[![CircleCI](https://img.shields.io/circleci/project/github/nschloe/tspsolve/master.svg)](https://circleci.com/gh/nschloe/tspsolve/tree/master)\n[![codecov](https://img.shields.io/codecov/c/github/nschloe/tspsolve.svg)](https://codecov.io/gh/nschloe/tspsolve)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![PyPi Version](https://img.shields.io/pypi/v/tspsolve.svg)](https://pypi.org/project/tspsolve)\n[![GitHub stars](https://img.shields.io/github/stars/nschloe/tspsolve.svg?logo=github&label=Stars)](https://github.com/nschloe/tspsolve)\n\nAlgorithms for the [traveling salesman problem\n(TSP)](https://en.wikipedia.org/wiki/Travelling_salesman_problem) in Python.\n\nImplemented so far:\n\n * Nearest neighbor algorithm\n ```python\n import tspsolve\n\n # Create matrix of distances d\n path = tspsolve.nearest_neighbor(d)\n ```\n\n * [2-opt](https://en.wikipedia.org/wiki/2-opt) improvement\n ```python\n import tspsolve\n\n # Create matrix of distances d and an initial path\n new_path = tspsolve.two_opt(d, path, verbose=True)\n ```\n\nFor [Euclidiean\nTSP](https://en.wikipedia.org/wiki/Travelling_salesman_problem#Euclidean_TSP), the\ndistance matrix can be computed efficiently with\n```python\ndx = numpy.subtract.outer(x, x)\ndy = numpy.subtract.outer(y, y)\nd = numpy.sqrt(dx ** 2 + dy ** 2)\n```\n\n### Installation\n\ntspsolve is [available from the Python Package\nIndex](https://pypi.org/project/tspsolve/), so simply type\n```\npip install -U tspsolve\n```\nto install or upgrade.\n\n### Testing\n\nTo run the tspsolve unit tests, check out this repository and type\n```\npytest\n```\n\n### Distribution\n\nTo create a new release\n\n1. bump the `__version__` number,\n\n2. publish to PyPi and GitHub:\n ```\n make publish\n ```\n\n### License\n\ntspsolve is published under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).\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/nschloe/tspsolve", "keywords": "", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "tspsolve", "package_url": "https://pypi.org/project/tspsolve/", "platform": "", "project_url": "https://pypi.org/project/tspsolve/", "project_urls": { "Homepage": "https://github.com/nschloe/tspsolve" }, "release_url": "https://pypi.org/project/tspsolve/0.1.0/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Python project scaffold", "version": "0.1.0" }, "last_serial": 4044144, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b73310470682d9834330a007349bba70", "sha256": "8c162b71222e086ddca6a43d3874164c98cfdd22913a9c17f6b44972c9dcdbc2" }, "downloads": -1, "filename": "tspsolve-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b73310470682d9834330a007349bba70", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3814, "upload_time": "2018-07-09T15:50:46", "url": "https://files.pythonhosted.org/packages/e8/2c/c08c1f37b0587da38f3936509d69ec5dc9ec09f96744743bc8a2705d66e4/tspsolve-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0694e6863357e7e93d409501c10f888", "sha256": "f1788778c683c5d360bd99e0363fd2280e1b9ce8f1f4454526b2d8d3f96215c0" }, "downloads": -1, "filename": "tspsolve-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c0694e6863357e7e93d409501c10f888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3639, "upload_time": "2018-07-09T15:50:47", "url": "https://files.pythonhosted.org/packages/48/f1/bb6ebe41eca3fe831e0007e3eca6ef3ec28f1b3a45cd55de7948f826299b/tspsolve-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b73310470682d9834330a007349bba70", "sha256": "8c162b71222e086ddca6a43d3874164c98cfdd22913a9c17f6b44972c9dcdbc2" }, "downloads": -1, "filename": "tspsolve-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b73310470682d9834330a007349bba70", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3814, "upload_time": "2018-07-09T15:50:46", "url": "https://files.pythonhosted.org/packages/e8/2c/c08c1f37b0587da38f3936509d69ec5dc9ec09f96744743bc8a2705d66e4/tspsolve-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0694e6863357e7e93d409501c10f888", "sha256": "f1788778c683c5d360bd99e0363fd2280e1b9ce8f1f4454526b2d8d3f96215c0" }, "downloads": -1, "filename": "tspsolve-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c0694e6863357e7e93d409501c10f888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3639, "upload_time": "2018-07-09T15:50:47", "url": "https://files.pythonhosted.org/packages/48/f1/bb6ebe41eca3fe831e0007e3eca6ef3ec28f1b3a45cd55de7948f826299b/tspsolve-0.1.0.tar.gz" } ] }