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

Minimize the number of trips or Group maximum possible orders

We have one distribution center ( ware house ) and we are getting orders in real time whose time/distance from ware house and other order locations is known. time matrix= W O1 O2 O3 W 0 5 20 2 O1 5 0 21 7 O2 20 21 0 …
1
vote
1 answer

Traversing game state space : more search leads to bad results

I am cross posting this question from codereview as i found that it to be non-responsive. This problem is avaiable at hackerrank ai. I am not asking for solutions but trying to find what is wrong with my strategy or code. I am trying to solve a…
1
vote
2 answers

Travelling salesman 2-opt code leaving crossed edges

I'm trying to implement 2-opt optimization for finding "good enough" solutions to the TSP, with no edge crossings. I was under the impression running 2-opt until no more improvements can be made, will result in a tour with no crossings. However the…
1
vote
1 answer

Traveling salesman prob on 2d map with walls (obstacles) so pathfinding needed

I need to find optimal path between a number of points on a 2d map. The 2d map is of a building and will simply have where you can not go (through walls) and all the points on the map. So it's not really a map, rather lines you cannot go through…
Rickard Liljeberg
  • 966
  • 1
  • 12
  • 39
1
vote
1 answer

Traveling salesman on a directed graph with extra nods

I've been reading about different algorightms for solving the traveling salesman problem but can`t seem to find a example where you do not wish to visit all the nods in the graph. In example, lets say I have a graph made up of the nods…
1
vote
1 answer

How to improve the quality of the `concorde` TSP solver? Am I misusing it?

I'm trying to use the concorde TSP solver in a file using the following format: NAME : p5 COMMENT : Nada TYPE : TSP DIMENSION : 20 EDGE_WEIGHT_TYPE : EUC_2D NODE_COORD_SECTION 0 0.329733 0.67714 1 0.823944 0.035369 2 0.002488 0.866692 3 0.241964…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
1
vote
0 answers

Pseudocode for Branch and Bound method to solve TSP.

I'm looking for a pseudocode for B&B algorithm for Travelling Salesman problem. I found this: TSP - Branch and bound but links that somebody gave there as an answer didn't help me so far. Do you have any examples os that pseudocode? Thank you in…
user3448282
  • 2,629
  • 3
  • 25
  • 47
1
vote
2 answers

Difference between Shortest Path and Djikstra's Algorithm and Travelling Salesman

What is the difference between Shortest Path algorithm and Djikstras Algorithm and Travelling Salesman? As per what I know is in Shortest Path We do not travel through all the vertex with shortest path. In Travelling Salesman Problem we travel…
vishalkin
  • 1,175
  • 2
  • 12
  • 24
1
vote
1 answer

Permutation crossover operator (genetic algorithm) problems when there isn't 1-for-1 mapping

This isn't homework, purely for my side project. I'm implementing the Permutation Crossover Operator for genetic algorithm (solving travelling salesman, where each number represents a city index) and I'm having some problem with the boundary case…
Dan Tang
  • 1,273
  • 2
  • 20
  • 35
1
vote
1 answer

tsp using dynamic programming

i was using a piece of code for implementing TSP using dynamic programming. i have found this code but cant figure out the compute() function and how it works. i dont know what are the variables for and also how it computes the path. any help is…
gangroid1991
  • 13
  • 1
  • 4
1
vote
2 answers

Implementation of a particular Travelling-Salesman variation

I'm looking for an algorithm(C/C++/Java - doesn't matter) which will resolve a problem which consists of finding the shortest path between 2 nodes (A and B) of a graph. The catch is that the path must visit certain other given nodes(cities). A city…
Feri Csokatu
  • 17
  • 1
  • 5
1
vote
1 answer

Proving approximation for TSP-metric

I got stuck with the following question: Consider the following heuristic: Start with a tour containing only one vertex. At each step, find the vertex outside the tour with the lesser distance to some vertex of the tour. Let v be the outter vertex…
1
vote
1 answer

Ant colony optimisation questions: how to output results correctly, what is the result of algorithm and others

I am doing ant colony optimization algorithm. I have got a few questions. I tried to search throw ant-colony, but found nothing. 1 — What is the result of the algorithm? I have some graph and I need to find optimal path from start point to goal…
1
vote
3 answers

Decision problems that can't even be decided efficiently?

How does these problems fall into the tapestry of the P, NP, NP-Hard, etc... sets? I don't know if any such problems even exists, but what initiated my thought process was thinking of a decidable of the travelling salesman problem: Given a list…
theQman
  • 1,690
  • 6
  • 29
  • 52
1
vote
2 answers

Can a genetic algorithm be made to always produce an exact solution to a TSP-like task?

I was trying to solve a TSP-like problem which I have asked about here: A travelling salesman that has state It seems that my problem is very likely NP-hard. Therefore, my options are: An algorithm which tries every single strategy An algorithm…
Superbest
  • 25,318
  • 14
  • 62
  • 134