Metadata-Version: 2.1
Name: tsp-tools
Version: 0.2.0
Summary: `tsp-tools` is a package for Traveling Salesman Problem for Python.
Home-page: https://github.com/SaitoTsutomu/tsp-tools
License: Apache-2.0
Author: SaitoTsutomu
Author-email: tsutomu7@hotmail.co.jp
Requires-Python: >=3.12,<4.0
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Requires-Dist: PuLP (>=2.9,<3.0)
Requires-Dist: more-itertools (>=10.4,<11.0)
Requires-Dist: pandas (>=2.2,<3.0)
Description-Content-Type: text/x-rst

`tsp-tools` is a package for Traveling Salesman Problem for Python.

::

    import tsp_tools
    t = tsp_tools.tsp([(0,0), (0,1), (1,0), (1,1)])
    print(t)  # distance, node index list
    >>>
    (4.0, [0, 2, 3, 1])

    mat = [[  0,   1, 1, 1.5],
           [  1,   0, 1.5, 1],
           [  1, 1.5,   0, 1],
           [1.5,   1,   1, 0]]  # Distance Matrix
    r = range(len(mat))
    # Dictionary of distance
    dist = {(i, j): mat[i][j] for i in r for j in r}
    print(tsp_tools.tsp(r, dist))
    >>>
    (4.0, [0, 2, 3, 1])

Note: When large size, `ortoolpy.ortools_vrp` may be efficient.

See also https://pypi.org/project/ortoolpy/

Requirements
------------
* Python 3
* more-itertools

Features
--------
* nothing

Setup
-----
::

   $ pip install tsp-tools

History
-------
0.0.1 (2015-10-2)
~~~~~~~~~~~~~~~~~~
* first release

