Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travelling salesman with repeat nodes & dynamic weights

Tags:

Given a list of cities and the cost to fly between each city, I am trying to find the cheapest itinerary that visits all of these cities. I am currently using a MATLAB solution to find the cheapest route, but I'd now like to modify the algorithm to allow the following:

  1. repeat nodes - repeat nodes should be allowed, since travelling via hub cities can often result in a cheaper route
  2. dynamic edge weights - return/round-trip flights have a different (usually lower) cost to two equivalent one-way flights

For now, I am ignoring the issue of flight dates and assuming that it is possible to travel from any city to any other city.

Does anyone have any ideas how to solve this problem? My first idea was to use an evolutionary optimisation method like GA or ACO to solve point 2, and simply adjust the edge weights when evaluating the objective function based on whether the itinerary contains return/round-trip flights, but perhaps somebody else has a better idea.

(Note: I am using MATLAB, but I am not specifically looking for coded solutions, more just high-level ideas about what algorithms can be used.)


Edit - after thinking about this some more, allowing "repeat nodes" seems to be too loose of a constraint. We could further constrain the problem so that, although nodes can be repeatedly visited, each directed edge can only be visited at most once. It seems reasonable to ignore any itineraries which include the same flight in the same direction more than once.

like image 752
del Avatar asked Mar 12 '11 04:03

del


People also ask

Is TSP a complete graph?

It is a minimization problem starting and finishing at a specified vertex after having visited each other vertex exactly once. Often, the model is a complete graph (i.e., each pair of vertices is connected by an edge).

What is the best strategy to solve the traveling salesperson problem?

To solve the TSP using the Brute-Force approach, you must calculate the total number of routes and then draw and list all the possible routes. Calculate the distance of each route and then choose the shortest one—this is the optimal solution. This method breaks a problem to be solved into several sub-problems.

Is traveling salesman NP-hard?

Thus we can say that the graph G' contains a TSP if graph G contains Hamiltonian Cycle. Therefore, any instance of the Travelling salesman problem can be reduced to an instance of the hamiltonian cycle problem. Thus, the TSP is NP-Hard.

Has anyone solved the traveling salesman problem?

Scientists in Japan have solved a more complex traveling salesman problem than ever before. The previous standard for instant solving was 16 “cities,” and these scientists have used a new kind of processor to solve 22 cities. They say it would have taken a traditional von Neumann CPU 1,200 years to do the same task.


1 Answers

I haven't tested it myself; however, I have read that implementing Simulated Annealing to solve the TSP (or variants of it) can produce excellent results. The key point here is that Simulated Annealing is very easy to implement and requires minimal tweaking, while approximation algorithms can take much longer to implement and are probably more error prone. Skiena also has a page dedicated to specific TSP solvers.

like image 106
ldog Avatar answered Oct 13 '22 02:10

ldog