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
-1
votes
1 answer

Plotting graph an answer to traveling-salesman problem

I need to plot the graph of the solution for the TSP. I am using the TSPLIB 95 library and public problem (ch130.tsp). I have been given the requirements for the assignment to solve the problem in a rudimentary 3 steps. Step 1. Select randomly…
Reppumaru
  • 13
  • 3
-1
votes
1 answer

TSP using divide and conquer

I'm solving traveling salesman problem in different ways. I've already solved it using backtracking and greedy algorithms. Now I have to solve it using divide and conquer. I understand how divide and conquer works but I can't understand how I can…
-1
votes
1 answer

Dijkstra's Algorithm Pseudocode Confusion

I am trying to implement a version of Dijkstra's algorithm for the traveling salesman problem and I found this paper:…
bloo
  • 25
  • 2
  • 5
-1
votes
1 answer

What's wrong with my implementation of the nearest neighbour algorithm (for the TSP)?

I was tasked with implementing the nearest neighbour algorithm for the travelling salesman problem. It was said that the method should try starting from every city and return the best tour found. According to the auto-marking program, my…
The Pointer
  • 2,226
  • 7
  • 22
  • 50
-1
votes
1 answer

Rust: branch and bound in TSP elusive bug

I could use your help once again. I implemented a branch and bound solution to TSP problem and stumbled up a bug... been few hours now and I still dont understand it. The strangest thing is: city 0 is visited first and yet at the end of the log it…
ArekBulski
  • 4,520
  • 4
  • 39
  • 61
-1
votes
1 answer

Traveling Sales man algorithm without returning to the starting point

I found code for the traveling salesman algorithm in python. But I want a different version, where the salesman will not return to the starting position. The path should be the shortest. Please suggest the solution. I also tried the Held-Karp…
dev21
  • 520
  • 2
  • 8
  • 22
-1
votes
1 answer

ValueError: invalid literal for int() with base 10: ':'

I am using jupyter python 3. I have tried to import data from .tsp file but it keeps showing me this error.And I saw some people had same problem and they solved it thanks to convert, but it did not work on my codes. NAME: berlin52 TYPE:…
gn khrmn
  • 23
  • 1
  • 6
-1
votes
1 answer

Prove that the reduction of HAM-CYCLE to TSP is polynomial-time?

This is a question that our professor uploaded yesterday, to prepare for our exam tomorrow. My problem with the question is part b (in boldface below); I'm not sure what I should do exactly. The Traveling Salesman Problem consists of a salesman and…
Faisal
  • 159
  • 9
-1
votes
1 answer

Traveling Salesman with MST and A*?

I was learning for my Exams and I think im missing out on Something about the Traveling Salesman Problem, maybe some of you Guys can help me out I was wondering If you couldn't use a MST to first find all the Vertices and afterwards use A* to get…
-1
votes
1 answer

Algorithm to find a path to all cities

I am hoping there is already a straight forward algorithm as a solution to this but not sure what this type of problem is called and therefore where to look for a solution. It is in some ways similar to the traveling salesman problem but I think it…
-1
votes
2 answers

Solving a TSP-related task

I have a problem similar to the basic TSP but not quite the same. I have a starting position for a player character, and he has to pick up n objects in the shortest time possible. He doesn't need to return to the original position and the order in…
-1
votes
1 answer

The Traveling Salesman as Socialite

I have a Traveling Salesman problem with some additional constraint. (Note: this is not a homework problem, I've phrased it like one to abstract the problem.) Given a list of events for a particular day with specific start times and end times, what…
jvhang
  • 747
  • 6
  • 19
-1
votes
3 answers

How would you solve this variation of the Traveling Salesman p‌r‌o‌b‌l‌e‌m?

Had to do this for work; I gave an approximate solution worked out by hand because I couldn't figure out how to attack it otherwise. I know it's NP-hard, but I'm curious how you would solve the following: Given 100 locations and a traveling…
-1
votes
1 answer

Solving the TSP in a maze using ACO

I'm writing an algorithm which includes a Traveling salesman problem (TSP) and a maze solving problem. Basically there are points inside the maze and we need to find the most optimal path to all those points and eventually exit the maze. We started…
Ortixx
  • 833
  • 3
  • 10
  • 23
-1
votes
1 answer

VRP clarke wright Algorithm

So I got my coursework for my Data and Algorithms class at uni and with the problem VRP I have been given we were told to implement an algorithm to solve it, It is suggested that we use Clarke wright because it is easy to implement apparently but we…
TAM
  • 347
  • 4
  • 9
  • 20