Skip to contents

Defining Traveling Salesperson Problems

Create symmetric, asymmetric, and Euclidean traveling salesperson problems.

TSP() as.TSP() as.dist(<TSP>) print(<TSP>) n_of_cities() labels(<TSP>) image(<TSP>)
Class TSP – Symmetric traveling salesperson problem
ETSP() as.ETSP() as.TSP(<ETSP>) as.matrix(<ETSP>) print(<ETSP>) n_of_cities(<ETSP>) labels(<ETSP>) image(<ETSP>) plot(<ETSP>)
Class ETSP – Euclidean traveling salesperson problem
ATSP() as.ATSP() print(<ATSP>) n_of_cities(<ATSP>) labels(<ATSP>) image(<ATSP>) as.matrix(<ATSP>)
Class ATSP – Asymmetric traveling salesperson problem
insert_dummy()
Insert dummy cities into a distance matrix
reformulate_ATSP_as_TSP() filter_ATSP_as_TSP_dummies()
Reformulate an ATSP as a symmetric TSP

Solvers

Solve TSPs by creating a TOUR

solve_TSP()
TSP solver interface
concorde_path() concorde_help() linkern_help()
Using the Concorde TSP Solver

Tours

Store TSP solutions as permutations, calculate their lengths, and cut cycles to form paths.

TOUR() as.TOUR() print(<TOUR>)
Class TOUR – Solution to a traveling salesperson problem
tour_length()
Calculate the length of a tour
cut_tour()
Cut a tour to form a path

Data

Data sets and import/export funcitons.

read_TSPLIB() write_TSPLIB()
Read and write TSPLIB files
USCA USCA312 USCA312_GPS USCA50
USCA312/USCA50 – 312/50 cities in the US and Canada