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

implementation of ga function of GA package

I am just not able to figure out how to use ga() of GA package in R. Let me give an example of what I am trying to do. I want to get the best order in which pizzas should be displayed to a customer to maximize the chances of selling all of them. Let…
user3664020
  • 2,980
  • 6
  • 24
  • 45
4
votes
2 answers

Shortest keyboard distance typing

Can anyone help me with this problem? We have a grid of MxN characters from some specific aplhabet, S={A,B,C,D} for example. The cursor is positioned on (1,1) position, and we can move cursor using the arrow keys, up, down, left, right, and press…
4
votes
3 answers

How to implement TSP with dynamic in C++

Recently I asked a question on Stack Overflow asking for help to solve a problem. It is a travelling salesman problem where I have up to 40,000 cities but I only need to visit 15 of them. I was pointed to use Dijkstra with a priority queue to make a…
A. Andevski
  • 437
  • 1
  • 5
  • 17
4
votes
2 answers

Use google maps API distance matrix to solve travelling salesman prblm w/ time windows (TSPTW) or Vehicle Routing Prblm w/ Time Windows (VRPTW)

The Google API offers good directions for routing point a-b, and now offer multiple waypoints and TSP optimization (https://developers.google.com/maps/documentation/directions/#Waypoints). I'd like to take it a step further and solve the Traveling…
4
votes
2 answers

Traveling salesman (TSP) for line routes, snowplowing

In a typical TSP algorithm, we have multiple points and we want to travel in the optimal order of travel. Points being households, customers, and etc. basically a dot on the map. Instead of points, I have lines to optimize. Snowplowing is a good…
4
votes
1 answer

A special case of the travelling salsman (he gets the week-ends off)

Suppose the salesman had to go back home for the week-end. and suppose the time spent in each city wasn't constant. does any one know of any particular work done to address this version of the problem? What I mean is each city will have a cost…
4
votes
2 answers

Solving Travelling Salesman with Tabu Search

I'm trying to understand the Tabu Search by using it with Hill Climbing algorithm, to solve the travelling salesman problem. I understand the 'pure' Hill Climbing Algorithm, but how Tabu Search changes this algorithm is not very clear to me. Hill…
Dilini
  • 777
  • 8
  • 22
4
votes
2 answers

Bicycle messenger / TSPPD with OptaPlanner

Dear OptaPlanner experts! I would like to use OptaPlanner (or a similar Open Source Java Framework) to optimize routes for a bicycle messenger service. Let's assume 5 messengers have to pick up 30 envelopes FROM a certain origin and deliver them TO…
user2828726
  • 59
  • 1
  • 4
4
votes
1 answer

How does Google Maps´ "optimizeWaypoints" solve Travelling Salesmen?

I want to solve a Travelling Salesman Problem like Google Maps does in its DirectionsRequest with request.setOptimizeWaypoints(true);. It orders some Waypoints in a route so that the travelling-costs are minimal. My question: Does anybody know…
4
votes
1 answer

Graph with n people and k destinations

In a connected graph, there are n points where hungry people are standing. Every hungry person wants to go one of the k restaurants in the graph. The travel distance should be within a 1 km distance for each person. A restaurant can fit no more than…
HikeTakerByRequest
  • 333
  • 1
  • 2
  • 15
4
votes
3 answers

Travel Time Minimization Algorithm

I am looking for guidance in creating an algorithm to minimize the total travel time for a group of travelers to get to a group of fixed destinations. The travelers do not all start in the same place, but each destination must be visited by a…
alexgerst
  • 155
  • 1
  • 11
4
votes
1 answer

Hill Climbing search algorithm Applied to travelling salesman

Let's say we are given 7 cities A,B,C,D,E,F,G and we have a start state ABCDEFGA with some cost 'x' , I don't understand what the children of this node would be.Meaning how would the second iteration of the hill climbing algorithm proceed? Would the…
anonuser0428
  • 11,789
  • 22
  • 63
  • 86
4
votes
4 answers

Maximum efficiency

Maximum efficiency problem The are N cities and there is a wanderer. The time it takes for him to go from a town to another town is known - Txy (from town x to town y). From any town he can go to any other town so it is a complete graph. In each…
4
votes
2 answers

TSP using python

I'm given homework to come up with the python program to solve Travellers salesman problem. In the class they explained how it should work and showed one example. path_map = [[0,10,15,20], [5,0,9,10], [6,13,0,12], …
user1322731
  • 71
  • 1
  • 7
4
votes
3 answers

Getting fitness in TSP

I'm using a genetic algorithm (GA) to optimise a traveling salesman problem (TSP). My problem is how I calculate the fitness of an individual. Obviously solutions with shorter routes are fitter but how exactly do I assign a fitness value without…