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
7
votes
2 answers

Teleporting Traveler, Optimal Profit over time Problem

I'm new to the whole traveling-salesman problem as well as stackoverflow so let me know if I say something that isn't quite right. Intro: I'm trying to code a profit/time-optimized multiple-trade algorithm for a game which involves multiple cities…
7
votes
3 answers

TSP - Branch and bound

I'm trying to solve the TSP with Branch and bound algorithm. I must build a matrix with costs but I have this problem: I have city with coordinates x and y. The cost of traveling is ceil(ceil(sqrt((x1-x2)^2+(y1-y2)^2))/v) + days spent in the city. V…
gummmibear
  • 81
  • 1
  • 1
  • 4
7
votes
2 answers

3-Opt Local Search for TSP?

I understand that the 3-Opt Heuristic involves removing three edges from a graph and adding three more to re-complete the tour. However, I've seen many papers that mention that when three edges are removed, there remain only 2 possible ways to…
u3l
  • 3,342
  • 4
  • 34
  • 51
6
votes
3 answers

Dealing with Massive Graphs - Traveling Salesperson

I'm teaching myself how to program algorithms involving TSPs (Djikstra, Kruskal) and I'm looking for some start up advice. I am working with C# and SQL. Ideally I'd like to be able to do this strictly in SQL however I'm not sure if that is…
nikolifish
  • 503
  • 1
  • 5
  • 18
6
votes
4 answers

What is a practical solution to the Travelling Salesman prblem, using Google Maps?

What is a practical solution to the Travelling Salesman problem, using Google Maps / geolocation / route finding? I don't need the best solution, within 5% would be fine. For example, I have 20 locations in the UK to visit, in any order. This may…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
6
votes
0 answers

Traveling salesman-like optimization problem - better heuristic required

I have an optimization problem and I am looking for an algorithm that performs better than the naive method I have. The problem Consider a graph, G(N, E), where N is the set of nodes and E is the set of edges. Each node n_i in N has an associated…
user1936752
  • 756
  • 1
  • 9
  • 25
6
votes
3 answers

TSP (Traveling Salesman Problem) solver Using GoogleMap

We are developing an application, in which we will show some available houses for sale in google map. User can select any houses from the map and can find the shortest driving route between all the houses he/she selected. Can any one please tell me…
jose
  • 464
  • 4
  • 7
  • 20
6
votes
2 answers

Is this problem NP-hard?

I'm trying to come up with a reasonable algorithm for this problem: Let's say you have a bunch of balls. Each ball has at least one color, but can also be multicolored. Each ball also has a number on it. There are also a bunch of boxes which are…
6
votes
1 answer

TSP: Worst case ratio grows

As part of my high school thesis I am describing the heuristics for the Traveling Salesman Problem. I was reading this sort of case study (Page 8) but I cannot unserstand what these sentences mean: The running time for NN as described is Θ(N^2 ).…
6
votes
3 answers

Traveling salesman example with known global optimum

I made a memetic algorithm in Python for traveling salesman problem. However, all the test data (list of distances between cities) I've encountered lack the information of the best solution, so I can't know how close to global optimum my algorithm…
vuzun
  • 942
  • 2
  • 8
  • 15
6
votes
2 answers

Travelling Salesman Problem Constraint Representation

I read a couple of articles and sample code about how to solve TSP with Genetic Algorithms and Ant Colony Optimization etc. But everything I found didn't include time (window) constraints, eg. "I have to be at customer x before 12am)" and assumed…
alex25
  • 621
  • 5
  • 19
6
votes
2 answers

Non-cycle path to all nodes

Is there an algorithm or set of algorithms that would let you find the shortest walking distance from an arbitrary start node so that every node gets visited in a weight, undirected graph? It's not quite Traveling Salesman, because I don't care if a…
Jon
  • 1,249
  • 1
  • 10
  • 21
6
votes
1 answer

Calculating the Held Karp Lower bound For The Traveling Salesman(TSP)

I am currently researching the traveling salesman problem, and was wondering if anyone would be able to simply explain the held karp lower bound. I have been looking at a lot of papers and i am struggling to understand it. If someone could simply…
jack8627
  • 85
  • 1
  • 5
6
votes
1 answer

C# minmax graph search

EDIT 3: Okay, so i got my code to work, but i'm facing a huge memory consumption problem if i'm using let's say 16 nodes and a search depth above 11. an soemone check the code and tell me how can i correct that memory leak? Here's the full…
6
votes
2 answers

Travelling Salesman with Google Maps API or any other

I have a list of addresses and need to find the best route that reaches every address and goes back to the start With Google Maps API it is possible to calculate this with 8 waypoints I think but 8 isn't enough for my purposes. Is there someone out…
DominicM
  • 2,186
  • 5
  • 24
  • 42
1 2
3
48 49