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

TSP Concorde fails with Status 127 Message

Trying to use the TSP package interface to solve the famous TSP problem using concorde algorithm is resulting in status 127. I had placed the path of the concorde executable in concorde_path(). And ran the concorde_help() command which resulted in…
0
votes
1 answer

How can I improve this genetic algorithm for the TSP?

This is my genetic algorithm, step by step: Generate two initial population's randomly, and select the fittest tour from both. Perform an ordered crossover, which selects a random portion of the first fit tour and fills in the rest from the second,…
0
votes
1 answer

TSP in warehouse (multiple localization of one item)

I wanna write my masters thesis about computer optimization of warehouse processes because I work as a programmer in a shipping company and I thought it might be useful. Can anybody tell me if it is possible to adjust a TSP problem to create a path…
Elterian
  • 11
  • 4
0
votes
2 answers

Having a casting issue with traveling salesperson using a greedy algorithm

I figure I have the general idea down for how to solve the algorithm but the implementation seems to elude me. What I have thus far is this: public class GreedySalesman { public static int[] greedySalesmanSolution(int[][] distances) { List…
T44v1
  • 157
  • 1
  • 1
  • 9
0
votes
0 answers

non-metric almost TSP (I lack a better name for it). Vertices can be repeated

I am tasked with designing a flight assistant and one of the problems at hand is finding an optimum route that visits every airport and returns to the airport of origin. In this problem I've taken the airports as nodes and the flights as edges.…
azurox
  • 19
  • 1
  • 4
0
votes
1 answer

Efficient design for optional profiling code execution

Some context: I have a C++ method that performs some intensive computation (some branch-and-bound algorithm on a Vehicle Routing Problem variation). Efficiency is therefore paramount in this code. As I am testing different tricks to achieve optimal…
0
votes
1 answer

SQL Server 3 closest locations

I have 2 tables USER contains a UserID and 2 zip codes (around 1 million records) +--------+----------+----------+ | UserID | Zipcode1 | Zipcode2 | +--------+----------+----------+ | 1 | 08003 | 10016 | | 2 | 11780 | 48073 | | …
Broom
  • 596
  • 2
  • 18
0
votes
0 answers

Traveling Salesperson with Genetic Algorithm

I am trying to visualize and solve the traveling salesperson problem with python and genetic algorithms, i was following one of Daniel Shiffman's coding challenge videos on youtube i don't know if i'm allowed to put a link here but here is the link…
0
votes
0 answers

Monalisa TSP Tour Length/Distance always wrong

the tour length of www.math.uwaterloo.ca/tsp/data/ml/tour/monalisa_5757191.tour is supposed to be 5757191 yet my code gives a result of 5759929.877458311. Assuming that the claim of being willing to pay $1000 for any improvement to be true, then…
0
votes
1 answer

How to divide n destinations into two groups and minimize the sum of TSP distance of two groups?

I have met a very practical problem in robotics field. As I am EE background and not familiar with algorithms, I am seeking for help here. There are n destinations, and the destinations are to be divided into two groups(group A and group B). There…
richieqianle
  • 602
  • 2
  • 7
  • 20
0
votes
1 answer

Optaplanner/graphhopper: how to solve VRP minimax optimization?

I have a route planning problem that consists of N vehicles and > 2N waypoints. I want to optimize their route such that the maximum time/cost of all vehicles is minimized. The only options in JVM are either optaplanner or graphhopper. This problem…
0
votes
1 answer

2-opt algorithm , neighbourhood of a given tour

I can't really understand how to find the neighbours of a given tour using 2-opt algorithm : Suppose we have T = 0-1-2-4-3-0 the definition says : neighbourhood of T is defined as the set of all tours that can be reached by changing two nonadjacent…
Hamza
  • 121
  • 1
  • 1
  • 8
0
votes
1 answer

Finding path that visits all vertices of a directed graph exactly once

Given a directed graph, what is an algorithm that visits each and every vertex of the graph, only once. This is different from Hamiltonian cycle, in that, I don't require the path to start and end at the same vertex. Backtracking Algorithm One…
0
votes
0 answers

How do I fill an ArrayList with random generated products?

I'd like some help with getting a randomizer working for my code. I am working on a hill-climbing algorithm for a school project. The algorithm works only I don't know how I can make it add random product(locations it needs to visit.) Here is the…
0
votes
2 answers

Traveling salesman including traveling through cities

Traditionally the traveling salesman problem works with the distance from city to city taking from its origin. This works perfectly fine if you can neglect the travel cost through the city compared to the travel cost between cities. So the question…
73nismit
  • 57
  • 1
  • 6