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.

Citation

If you find that this project helps your research, please consider citing it using the metadata from the CITATION.cff file.

License

This library is licensed under the MIT license. Additionally, it 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

fast_tsp-0.1.4-cp312-cp312-win_amd64.whl (70.4 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

fast_tsp-0.1.4-cp312-cp312-win32.whl (62.8 kB view hashes)

Uploaded CPython 3.12 Windows x86

fast_tsp-0.1.4-cp312-cp312-musllinux_1_1_x86_64.whl (617.6 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (93.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (61.6 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

fast_tsp-0.1.4-cp312-cp312-macosx_10_9_x86_64.whl (66.5 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

fast_tsp-0.1.4-cp312-cp312-macosx_10_9_universal2.whl (122.0 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

fast_tsp-0.1.4-cp311-cp311-win_amd64.whl (71.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

fast_tsp-0.1.4-cp311-cp311-win32.whl (63.4 kB view hashes)

Uploaded CPython 3.11 Windows x86

fast_tsp-0.1.4-cp311-cp311-musllinux_1_1_x86_64.whl (617.9 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (63.3 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fast_tsp-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl (67.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

fast_tsp-0.1.4-cp311-cp311-macosx_10_9_universal2.whl (124.7 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

fast_tsp-0.1.4-cp310-cp310-win_amd64.whl (70.3 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fast_tsp-0.1.4-cp310-cp310-win32.whl (62.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

fast_tsp-0.1.4-cp310-cp310-musllinux_1_1_x86_64.whl (617.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (93.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (61.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fast_tsp-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl (66.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

fast_tsp-0.1.4-cp310-cp310-macosx_10_9_universal2.whl (122.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

fast_tsp-0.1.4-cp39-cp39-win_amd64.whl (70.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fast_tsp-0.1.4-cp39-cp39-win32.whl (62.5 kB view hashes)

Uploaded CPython 3.9 Windows x86

fast_tsp-0.1.4-cp39-cp39-musllinux_1_1_x86_64.whl (617.7 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (93.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.4-cp39-cp39-macosx_11_0_arm64.whl (61.9 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fast_tsp-0.1.4-cp39-cp39-macosx_10_9_x86_64.whl (66.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

fast_tsp-0.1.4-cp39-cp39-macosx_10_9_universal2.whl (122.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

fast_tsp-0.1.4-cp38-cp38-win_amd64.whl (70.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

fast_tsp-0.1.4-cp38-cp38-win32.whl (62.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

fast_tsp-0.1.4-cp38-cp38-musllinux_1_1_x86_64.whl (617.5 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

fast_tsp-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (92.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fast_tsp-0.1.4-cp38-cp38-macosx_11_0_arm64.whl (61.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fast_tsp-0.1.4-cp38-cp38-macosx_10_9_x86_64.whl (66.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

fast_tsp-0.1.4-cp38-cp38-macosx_10_9_universal2.whl (122.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, 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