Skip to main content

A fast TSP solver with Python bindings

Project description

fast-tsp

Documentation Status Pip Actions Status PyPI - Version GitHub issues GitHub license

A library for computing near optimal solution to large instances of the TSP (Travelling Salesman Problem) fast using a local solver. The library is written in C++ and provides Python bindings.

Quickstart

First install the library

$ pip install fast-tsp

Then run the problem on your 2D distance matrix:

import fast_tsp
dists = [
    [ 0, 63, 72, 70],
    [63,  0, 57, 53],
    [72, 57,  0,  4],
    [70, 53,  4,  0],
]
tour = fast_tsp.find_tour(dists)
print(tour)  # [0, 1, 3, 2]

Documentation

Documentation can be found at https://fast-tsp.readthedocs.io/.

You can build the documentation by cding to docs/ and running make clean && make html.

License

This library uses pybind11 which is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_tsp-0.1.2.tar.gz (25.9 kB view hashes)

Uploaded Source

Built Distributions

fast_tsp-0.1.2-cp310-cp310-win_amd64.whl (70.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fast_tsp-0.1.2-cp310-cp310-win32.whl (61.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

fast_tsp-0.1.2-cp310-cp310-musllinux_1_1_x86_64.whl (617.1 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.2-cp310-cp310-musllinux_1_1_i686.whl (674.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

fast_tsp-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (92.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (99.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

fast_tsp-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (65.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

fast_tsp-0.1.2-cp39-cp39-win_amd64.whl (69.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fast_tsp-0.1.2-cp39-cp39-win32.whl (61.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

fast_tsp-0.1.2-cp39-cp39-musllinux_1_1_x86_64.whl (617.3 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.2-cp39-cp39-musllinux_1_1_i686.whl (674.8 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

fast_tsp-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (92.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (99.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

fast_tsp-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (65.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

fast_tsp-0.1.2-cp38-cp38-win_amd64.whl (69.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

fast_tsp-0.1.2-cp38-cp38-win32.whl (61.2 kB view hashes)

Uploaded CPython 3.8 Windows x86

fast_tsp-0.1.2-cp38-cp38-musllinux_1_1_x86_64.whl (617.1 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.2-cp38-cp38-musllinux_1_1_i686.whl (674.5 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

fast_tsp-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (92.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (99.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

fast_tsp-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (65.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page