TSP v1.1-4

0

Monthly downloads

0th

Percentile

by Michael Hahsler

Traveling Salesperson Problem (TSP)

Basic infrastructure and some algorithms for the traveling salesperson problem (also traveling salesman problem; TSP). The package provides some simple algorithms and an interface to the Concorde TSP solver and its implementation of the Chained-Lin-Kernighan heuristic. Concorde itself is not included in the package and has to be obtained separately from http://www.math.uwaterloo.ca/tsp/concorde.html.

Readme

TSP - Traveling Salesperson Problem - R package

CRAN version CRAN RStudio mirror downloads Travis-CI Build Status AppVeyor Build Status

This package provides the basic infrastructure and some algorithms for the traveling salesman problems (symmetric, asymmetric and Euclidean TSPs). The package provides some simple algorithms and an interface to the Concorde TSP solver and its implementation of the Chained-Lin-Kernighan heuristic.

Installation

  • Stable CRAN version: install from within R.
  • Current development version: Download package from AppVeyor or install via intall_github("mhahsler/TSP") (requires R package devtools)

Example

This example loads a data set with 312 cities (USA and Canada) and

## load library and read data
R> library("TSP")
R> data("USCA312")

## create a TSP object from the data 
R> tsp <- TSP(USCA312)
R> tsp

object of class 'TSP'
312 cities (distance   'euclidean')

## find a tour using the default heuristic 
R> tour <- solve_TSP(tsp)
R> tour

object of class 'TOUR' 
result of method 'arbitrary_insertion+two_opt' for 312 cities
tour length: 40621

An online example application of TSP can be found on shinyapps.

Further Information

Functions in TSP

Name Description
cut_tour Cut a tour to form a path
TOUR Class TOUR -- Solution to a traveling salesperson problem
tour_length Calculate the length of a tour
TSPLIB Read and write TSPLIB files
ATSP Class ATSP -- Asymmetric traveling salesperson problem
insert_dummy Insert dummy cities into a distance matrix
Concorde Using the Concorde TSP Solver
ETSP Class ETSP -- Euclidean traveling salesperson problem
reformulate_ATSP_as_TSP Reformulate a ATSP as a symmetric TSP
USCA USCA312/USCA50 -- 312/50 cities in the US and Canada
solve_TSP TSP solver interface
TSP Class TSP -- Symmetric traveling salesperson problem
No Results!

Last month downloads

Details

Type Package
Date 2016-2-21
Classification/ACM G.1.6, G.2.1, G.4
URL http://lyle.smu.edu/IDA/seriation
BugReports https://github.com/mhahsler/TSP/issues
License GPL-3
Copyright All code is Copyright (C) Michael Hahsler and Kurt Hornik.
NeedsCompilation yes
Packaged 2016-02-22 03:12:39 UTC; hahsler
Repository CRAN
Date/Publication 2016-02-22 08:04:07

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/TSP)](http://www.rdocumentation.org/packages/TSP)