Include Top

# Case Study 7 – The Travelling Salesperson Problem (TSP)

## Introduction: Optimizing Travel to 30 International Cities

The travelling salesperson problem (TSP) asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?”  The problem was first formulated in 1930 and is one of the most intensively studied problems in optimization. It is used as a benchmark for many optimization methods. The TSP has several applications such as planning, logistics, and the manufacture of microchips. Slightly modified, it appears as a sub-problem in many areas, such as DNA sequencing. In these applications, the concept city represents, for example, customers, soldering points, or DNA fragments, and the concept distance represents travelling times or cost, or a similarity measure between DNA fragments. The TSP also appears in astronomy, as astronomers observing many sources will want to minimize the time spent moving the telescope between the sources. In many applications, additional constraints such as limited resources or time windows may be imposed. (Ref.: https://en.wikipedia.org/wiki/Travelling_salesman_problem)

The books by Applegate and Cook (see Case Study 7 References) and the University of Waterloo TSP web site (http://www.math.uwaterloo.ca/tsp/index.html) are excellent resources for further study.

We will now consider a 30 City TSP problem. The data is from city distance dataset HA30 which describes the airline distances, in hundreds of miles, between 30 international cities: https://people.sc.fsu.edu/~jburkardt/datasets/cities/cities.html. A 30 city problem has 29!/2 = 4.42e30 possible solutions, so obviously this is not something that can be solved using the Discrete Exhaustive option! The goal is to achieve the best known solution minimum of 503 (50,300 miles), as given in Ouyang (2013): The 3D plots were created using Mathematica with code adapted from Dr. Ben Nolting: (http://datavoreconsulting.com/programming-tips/a-traveling-salesman-on-a-sphere-pitbulls-arctic-adventure/).

In DiscoverSim Version 2.1, the Genetic Algorithm has improved handling of the DSIM_IsAllDifferent function, so we will use the Genetic Algorithm to solve this TSP problem. The DSIM_IsAllDifferent function will be used in a constraint in order to ensure that the only solutions considered are unique city sequences.

Since this is a deterministic optimization problem, we technically only need a single replication, but DiscoverSim requires a minimum of 2 replications for internal consistency on stochastic problems. If the model included Input Distributions to represent uncertainty (for example if we were using travel times rather than distance), then we would typically use 1000 replications in the optimization settings.

 Summary of DiscoverSim Features Demonstrated in Case Study 7: Create Discrete Input Controls DiscoverSim Copy/Paste Cell Insert DSIM_IsAllDifferent function Create a Constraint that references the DSIM_IsAllDifferent function Run Optimization with Genetic Algorithm

# Web Demos

Our CTO and Co-Founder, John Noguera, regularly hosts free Web Demos featuring SigmaXL and DiscoverSim
{"ft_lang_label":"__label__en","ft_lang_prob":0.9149803,"math_prob":0.6967442,"size":3207,"snap":"2019-13-2019-22","text_gpt3_token_len":704,"char_repetition_ratio":0.09210116,"word_repetition_ratio":0.0,"special_character_ratio":0.20330527,"punctuation_ratio":0.1401384,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9557969,"pos_list":[0,1,2],"im_url_duplicate_count":[null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-25T00:22:25Z\",\"WARC-Record-ID\":\"<urn:uuid:4b3122e0-997d-4e84-bb69-3de1a1f4d676>\",\"Content-Length\":\"41183\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:92648e7d-3838-4b98-8552-774b3aac01ab>\",\"WARC-Concurrent-To\":\"<urn:uuid:ada82cb0-9cc2-48db-836a-80a681ce9392>\",\"WARC-IP-Address\":\"74.208.236.146\",\"WARC-Target-URI\":\"https://www.sigmaxl.com/DiscoverSim-CaseStudy7-Intro.shtml\",\"WARC-Payload-Digest\":\"sha1:3SRPUPAMM2ABQT5IMSCJ76JIXGFOEZPU\",\"WARC-Block-Digest\":\"sha1:GELD2LYADUYLDH5QXPFYVOKR5472A7FE\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912203529.38_warc_CC-MAIN-20190324230359-20190325012359-00518.warc.gz\"}"}