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

TSP by Ant Colony Optimization

I'm working on TSP problem using ant colony optimization in C. I think that I implemented correctly, but my program doesn't work. I know that I had problems with memory in my code, because when I run my program the console write "core dumped." I…
-1
votes
1 answer

Travelling salesman dynamic programming implementation

So I was implementing a travelling salesman algorithm in C# using the dynamic programming approach, but after studying the well-known pseudocode I learned quite nothing. At least I think so. Nevertheless, here's a glimpse of my code, I would be glad…
brian
  • 509
  • 3
  • 14
-1
votes
1 answer

Courier delivery with A* algorithm

I have to make a program which can calculate the shortest path to finish all deliveries. The map is represent as x, y coordinate and the path is calculated using Manhattan distance(so go along x and then along y). Start point is always (0, 0) and…
-1
votes
1 answer

Traveling Salesman: Matrix and Tours

Consider the following matrix/array that contains the distances between 4 cities: 0 1 2 3 1 0 4 5 2 4 0 6 3 5 6 0 Each row/column pair (i,j) represents the distance between city i and city j. For example the distance between city 1 and city 4 is…
JimmyK
  • 4,801
  • 8
  • 35
  • 47
-1
votes
1 answer

Finding most effective upper bound for TSP using MST

I'm curious as to what the most effective methods are to find the most optimal (or close to optimal) upper bound for the TSP using a MST. I'm trying to optimize my algorithms for speed, but I'm having trouble algorithmically computing "good"…
Bob John
  • 3,688
  • 14
  • 43
  • 57
-1
votes
1 answer

Travelling Salesman (Brute Force)

I am writing a travelling salesman program, which is to calculate distance between all the points and determine the shortest distance using the BRUTE Force method. This is not homework :) My approach is to generate all the possible points…
Lim Zheng Yue
  • 51
  • 3
  • 6
-2
votes
2 answers

How can I get the TSP tour from my function?

I can already find the "cost" of the tour with my code, but I would like know the tour that is being followed, for example my code is trying to find the lowest cost in this graph: but I want to know the tour, so ideally I would get either 1-2-4-3-1…
AMM
  • 186
  • 2
  • 14
-2
votes
1 answer

What is the best algorithm for travelling sales man problem in case of there is few cites(lower than 6)?

i have seen many solution that try to solve the problem of travelling salesman problem if p!=np ,but i want to know the optimum solution if there is 6 or 5 cities only,which algorithm will give the optimum solution in this case?
-2
votes
1 answer

A function does not take all values of a list when I pass it as a parameter

I have two lists l=[0,1,7,10] and ll=[1,7,10], I want to use this lists as parameters of a function, the function uses this lists, ll, and l, in "for" cycles to iterate. When I pass the list my function does not take all the elements, specifically…
Héctor Alonso
  • 181
  • 1
  • 2
  • 12
-2
votes
1 answer

Useful algorithms for TSP

I'm currently working on TSP which has been given to me as my end of year project in my computer science course. In this problem we are given a list of the top 1000 colleges in the world. Then starting at our own colleges, we have to travel to all…
user7010212
-2
votes
1 answer

How do I access this variable in my code?

This is my code for simulated annealing to solve the travelling salesman problem. The comments should describe what's going on. For some reason, the algorithm prints out the best tour LENGTH it finds, but not the actual tour itself. If I were to add…
Sid Jones
  • 55
  • 1
  • 1
  • 10
-2
votes
2 answers

How to design an unsupervised neural network that does not do input classification?

I've read a lot about neural networks working against a specific output value but I haven't seen unsupervised networks optimize against a less specific goal (e.g. minimize the cost, but we don't know what the ideal value looks like). Let's discuss a…
Gili
  • 86,244
  • 97
  • 390
  • 689
-2
votes
1 answer

Today's algorithmic challenge

I'm currently working on an algorithm to schedule pub-crawling (it can be much more generic applied, though). This is what is known: There is a certain number of teams and bars, the amount of teams never exceeding the amount of bars The teams must…
zniwalla
  • 367
  • 4
  • 17
-2
votes
1 answer

JAVA Genetic Algorithm initialization

I am trying to work on a TSP genetic algorithm. I am new to GA and i have read lots of documents about it. I know it need to create initialization then find out the fitness of each individual then do mutation and so on. However, I am really new to…
Nicholas Agger Lui
  • 569
  • 1
  • 4
  • 13
-2
votes
1 answer

Traveling Salesman with different destination

I'm working on a question required to solve a variation of traveling salesman problem. What's different is that the origin can be different from destination, I would like to ask if there is any good implementation of this problem because most of the…
user2534365
  • 215
  • 1
  • 2
  • 10
1 2 3
48
49