Skip to main content

Initial Release.

Project description

This code is to solve traveling salesman problem by using simulated annealing meta heuristic.

import numpy
import pytspsa

solver = pytspsa.Tsp_sa()
c = [
[0, 0],
[0, 1],
[0, 2],
[0, 3]
c = numpy.asarray(c, dtype=numpy.float32)

# or sa_auto_parameter() will solve the problem.

# getting result
solution = solver.getBestSolution()

print('Path= {}'.format(solution.getRoute()))

See github page.

Project details

Download files

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

Files for pytspsa, version 0.1.14
Filename, size File type Python version Upload date Hashes
Filename, size pytspsa-0.1.14.tar.gz (18.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page