ml4co_kit.wrapper.routing.tsp.tsp

TSP Wrapper.

Classes

TSPWrapper(precision)

class ml4co_kit.wrapper.routing.tsp.tsp.TSPWrapper(precision: ~numpy.float32 | ~numpy.float64 = <class 'numpy.float32'>)[source]

Bases: WrapperBase

from_tsplib_folder(tsp_folder_path: Path = None, tour_folder_path: Path = None, round_type: ROUND_TYPE = ROUND_TYPE.NO, ref: bool = False, overwrite: bool = True, normalize: bool = False, show_time: bool = False)[source]

Read task data from folder (to support TSPLIB)

from_txt(file_path: Path, distance_type: DISTANCE_TYPE = DISTANCE_TYPE.EUC_2D, round_type: ROUND_TYPE = ROUND_TYPE.NO, ref: bool = False, overwrite: bool = True, normalize: bool = False, show_time: bool = False)[source]

Read task data from .txt file

to_tsplib_folder(tsp_folder_path: Path = None, tour_folder_path: Path = None, show_time: bool = False, sequential_orderd: bool = True)[source]
to_txt(file_path: Path, show_time: bool = False, mode: str = 'w')[source]

Write task data to .txt file