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: 8 days 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-08-27T22:26:18.000Z (2 months ago)
- Last Synced: 2024-08-27T23:53:04.730Z (2 months ago)
- Topics: concorde-tsp-solver, cran, r, tsp
- Language: R
- Homepage:
- Size: 462 KB
- Stars: 62
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
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/)