Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhahsler/TSP
Traveling Salesperson Problem - R package
https://github.com/mhahsler/TSP
concorde-tsp-solver cran r tsp
Last synced: 3 months ago
JSON representation
Traveling Salesperson Problem - R package
- Host: GitHub
- URL: https://github.com/mhahsler/TSP
- Owner: mhahsler
- Created: 2015-10-10T02:54:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T16:40:39.000Z (7 months ago)
- Last Synced: 2024-06-19T06:11:35.367Z (5 months ago)
- Topics: concorde-tsp-solver, cran, r, tsp
- Language: R
- Homepage:
- Size: 461 KB
- Stars: 61
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r echo=FALSE, results = 'asis'}
pkg <- 'TSP'source("https://raw.githubusercontent.com/mhahsler/pkg_helpers/main/pkg_helpers.R")
pkg_title(pkg)
```
[![Anaconda.org](https://anaconda.org/conda-forge/r-tsp/badges/version.svg)](https://anaconda.org/conda-forge/r-tsp)## Introduction
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](http://www.math.uwaterloo.ca/tsp/concorde/) and its implementation of the
Chained-Lin-Kernighan heuristic.```{r echo=FALSE, results = 'asis'}
pkg_usage(pkg)
pkg_citation(pkg, 2L)
pkg_install(pkg)
```## Usage
Load a data set with 312 cities (USA and Canada) and create a TSP object.
```{r}
library("TSP")
data("USCA312")
tsp <- TSP(USCA312)
tsp
```Find a tour using the default heuristic.
```{r}
tour <- solve_TSP(tsp)
tour
```Show the first few cities in the tour.
```{r}
head(tour, n = 10)
```An online example application of TSP can be found on [shinyapps](https://shrinidhee.shinyapps.io/SimpleTSP).
## Help and Bug Reports
You can find Q&A's and ask your own questions at
https://stackoverflow.com/search?q=TSP+RPlease submit bug reports to https://github.com/mhahsler/TSP/issues
## References
* Michael Hahsler and Kurt Hornik, [TSP - Infrastructure for the Traveling Salesperson Problem,](http://dx.doi.org/10.18637/jss.v023.i02) _Journal of Statistical Software,_ 22(2), 2007.
* [TSP package vignette](https://cran.r-project.org/package=TSP/vignettes/TSP.pdf) with complete examples.
* [Reference manual](https://cran.r-project.org/package=TSP/TSP.pdf)
* [Concorde TSP solver home page.](http://www.math.uwaterloo.ca/tsp/concorde/)