Questions tagged [traveling-salesman]

The "traveling salesman problem" is a classical computer science problem which involves finding the shortest path which could be taken by a hypothetical salesman to make a single visit to each location on a map (in a graph).

The traveling salesman problem (often referred to by its initials: TSP) is one of the most well known "hard" (NP-complete) problems in classical computer science. Simply stated, it involves finding the shortest path which could be taken by a hypothetical salesman to make a single visit to each location on a map (in a graph).

732 questions
0
votes
1 answer

Worst case of nearest neighbor heuristic for symmetric TSP

I have implemented the nearest neighbor heuristic for solving symmetric TSP problems. I was wondering if there is any relation between the solution found by the heuristic and the optimal solution? Can we state theoretically how much higher the route…
user19553
  • 11
  • 1
0
votes
2 answers

travelling sales man for an incomplete graph

i have a large weighted graph.i want to compute an approximate shortest hamiltonian path which goes through all nodes with the lowest cost. my graph is really big that it doesn't fit in my memory. so i decided to randomly ignore some edges and load…
0
votes
1 answer

Union Find to solve Traveling Salesman

I have to use the union find algorithm to solve the traveling salesman problem. I prettymuch got it done except for one problem I've just discovered. As it processes each edge, it will check for a cycle, which is done with the whole parent array…
Teddy Black
  • 193
  • 2
  • 14
0
votes
1 answer

Taking Input from a file Travelling Salesman in C

I am working on TSP which takes large number of city like 100 ,500 etc. I have wrote a code using greedy algorithm and works fine using command line arguments . But I need to take input from a file which has the below given format. First line is…
user2714823
  • 607
  • 5
  • 15
  • 29
0
votes
1 answer

Traveling salesman TSP: Brute algorithm improvement

According to wiki it will take (N-1)! to calculate a tour with N cities. I found a better way to do it but I can't do the math to calculate just how much I improved it. I can tell you that on my home pc I been able to solve 20 cities map in less…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
0
votes
2 answers

What size tour can I reasonably expect to solve with GLPK?

I'm playing around with the travelling salesman example provided with GLPK, and trying to get a feel for what problem size I can reasonably expect to solve. I've managed to solve a 50 node graph, but 100 nodes doesn't seem to be converging in a…
0
votes
1 answer

Travelling Salesman with latitude/longitude coordinates?

Travelling Salesman with latitude/longitude coordinates? I am reading about many heuristics for the TSP and many use Euclidian x/y coordinates. But I have my data as latitude and longitude, so how do I use those heuristics? That is, is there a…
user2381422
  • 5,645
  • 14
  • 42
  • 56
0
votes
1 answer

Why am I getting this openopt index error?

First, the error: Traceback (most recent call last): File "tsp_solver.py", line 57, in solvetTSP(inputData) NameError: name 'solvetTSP' is not defined new-host:tsp Jonathan$ python tsp_solver.py data/tsp_51_1 Traceback (most recent…
reem
  • 7,186
  • 4
  • 20
  • 30
0
votes
2 answers

Minimum cost to visit only selected cities and come back to start?

I understand the travelling salesman problem. Suppose if I want to visit only selected cities and come back to start, how to do that? Lets say my cost matrix is, A B C D A 0 1 2 1 B 1 0 1 2 C 2 1 0 1 D 1 2 1 0 If I want to visit all the cities…
user1554472
  • 47
  • 4
  • 9
0
votes
1 answer

A Traveling Salesman Variant

Is their a variant of Traveling Salesman Problem or other algorithms about the following problem: Say G is an incomplete undirected weighted graph. V is a subset of vertices of G. How to find a simple closed circuit along V (and probably some other…
Luca
  • 322
  • 1
  • 13
0
votes
3 answers

Which TSP heuristic algorithm should I adopt?

There are huge amount of papers related to TSP heuristic algorithm and each of them might focus on different kinds of TSP problem. Could anyone recommend several well performed TSP heuristic algorithms under the property described as follow: The…
tookoo
  • 11
0
votes
1 answer

Exact euclidean Travelling Salesman

I am trying to implement the algorithm to solve the Travelling Salesman Problem. I know that it is NP-Hard but I only need to solve it for 20 cities. I want to have an excat result and want to use the dynamic programming algorithm. With my current…
user1058712
  • 417
  • 1
  • 7
  • 17
0
votes
0 answers

Tabu Search in TSPTW

I applied Tabu Search in TSPTW problem, but it gives me result similar to getting best improvement using exchanging pivot rule (exchange between 2 cities ), However in some papers, it is stated that Tabu gives good result near to the optimal one (I…
Yasmin
  • 931
  • 3
  • 14
  • 35
0
votes
1 answer

Routing around a set time on one or more of the waypoints

This is using either Bing Maps API or Google Maps API. Problem: I am trying to create a route for a salesperson that may have 1 or more meetings that day plus visit selections from a pool. Meaning the salesperson has 1 meeting at a client and they…
0
votes
3 answers

TSP-Variant, possible algorithm?

One of the classical Travelling Salesman Problem (TSP) definitions is: Given a weighted complete undirected graph where triangle inequality holds return an Hamiltonian path of minimal total weight. In my case I do not want an Hamiltonian path, I…
Paolo.Bolzoni
  • 2,416
  • 1
  • 18
  • 29