TRAVELING SALESMAN PROBLEM
Install
pip install traveling-salesman
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
Greedy Algorihm
greedy_book , distance_result = greedy (nodes , 45 , 51 , plot = False )
Result
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