Skip to main content

A Python package to plot traveling salesman problem with greedy and smallest increase algorithm.

Project description

TRAVELING SALESMAN PROBLEM

Usage

from TSM.TSM import greedy,smallest_increase,read_all,find_closest_path
nodes = read_all('resources/sehir_xy')

smallest_book, distance_result = smallest_increase(nodes, start_index=45, end_index=51, plot=True, plot_annotate=True)
greedy_book, distance_result = greedy(nodes, start_index=45, end_index=51, plot=False)
find_closest_path(greedy_book, 12, 5, plot=True)
# find_closest_path(smallest_book, 12, 5, plot=True, show_route=True, suptitle='Smallest Increase Algorithm Route')

Smallest Increase Algorihm

greedy_book, distance_result = greedy(nodes, start_index=45, end_index=51, plot=False)

Result

greedyfcp

Greedy Algorihm

greedy_book, distance_result = greedy(nodes, 45, 51, plot=False)

Result

greedyfcp

Find Closest Path

greedy_book, distance_result = greedy(nodes, start_index=45,end_index=51, plot=False)
find_closest_path(greedy_book, 12, 5, plot=True)

Result

greedyfcp

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

traveling-salesman-1.1.4.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

traveling_salesman-1.1.4-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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