{ "info": { "author": "Dominik Vilsmeier", "author_email": "dominik.vilsmeier1123@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "dominosort\n==========\n\n*Sort sequences with respect to the similarity of consecutive items.*\n\nDefinition\n----------\n\nGiven a sequence of items :math:`(x_i, y_i)`, where each item is represented by two values\n:math:`x, y`, the goal is to sort the sequence such that the following loss\nis minimal:\n\n.. math::\n\n L = \\sum_{i=1}^{N-1} \\mu(y_i, x_{i+1})\n\nwhere :math:`\\mu` denotes a suitable metric for the items' values.\n\nExample\n-------\n\nGiven the items\n\n.. code:: python\n\n >>> items = [\n ... (0.4, 0.6),\n ... (0.0, 0.2),\n ... (0.8, 1.0),\n ... (0.6, 0.8),\n ... (0.2, 0.4),\n ... ]\n\ntogether with the L1 distance :math:`\\mu: (x, y) \\rightarrow |x-y|`, the current loss is\n\n.. code:: python\n\n >>> abs(0.6 - 0.0) + abs(0.2 - 0.8) + abs(1.0 - 0.6) + abs(0.8 - 0.2)\n 2.2\n\nClearly the optimal sort order which minimizes the loss is\n\n>>> optimal = [\n ... (0.0, 0.2),\n ... (0.2, 0.4),\n ... (0.4, 1.6),\n ... (0.6, 0.8),\n ... (0.8, 1.0),\n ... ]\n\nRelated topics\n--------------\n\nNote that for the special case where :math:`x_i = y_i` and the :math:`x_i` represent 2d-coordinates\nthis corresponds to the Travelling Salesman Problem without return to the origin.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/Dominik1123/dominosort", "keywords": "sort,sorting,algorithm", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "dominosort", "package_url": "https://pypi.org/project/dominosort/", "platform": "", "project_url": "https://pypi.org/project/dominosort/", "project_urls": { "Homepage": "https://gitlab.com/Dominik1123/dominosort" }, "release_url": "https://pypi.org/project/dominosort/0.1/", "requires_dist": [ "numpy (>=1.4.0)", "scipy (>=0.15.0)" ], "requires_python": "", "summary": "Sort sequences with respect to the similarity of consecutive items.", "version": "0.1" }, "last_serial": 3641826, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a6500aa2e010a5518ed9fafa92292d0f", "sha256": "900a921343243985d42d51ff9655442f07ec3757451ce06314806889e354e1c4" }, "downloads": -1, "filename": "dominosort-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a6500aa2e010a5518ed9fafa92292d0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9932, "upload_time": "2018-03-05T21:12:59", "url": "https://files.pythonhosted.org/packages/17/79/fcc54d8b1f9d05a7e7b6792d075a801eb36c553a31caf572b0aadea2bfff/dominosort-0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6500aa2e010a5518ed9fafa92292d0f", "sha256": "900a921343243985d42d51ff9655442f07ec3757451ce06314806889e354e1c4" }, "downloads": -1, "filename": "dominosort-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a6500aa2e010a5518ed9fafa92292d0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9932, "upload_time": "2018-03-05T21:12:59", "url": "https://files.pythonhosted.org/packages/17/79/fcc54d8b1f9d05a7e7b6792d075a801eb36c553a31caf572b0aadea2bfff/dominosort-0.1-py3-none-any.whl" } ] }