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
3 answers

Traveling Salesman Variation Algorithm

I'm having a trouble finding a contradicting example of the next variation of the TSP problem. Input: G=(V,E) undirected complete graph which holds the triangle inequality, w:E->R+ weight function, and a source vertex s. Output: Simple Hamilton…
Zionsof
  • 1,196
  • 11
  • 23
1
vote
1 answer

Calculate all possible routes between nodes where all nodes are touched only once? (Travelling Salesman)

I'm trying to develop a Travelling Salesman-type program (in Java) and am trying to figure out the logic for a certain part, a brute-force approach for calculating the most efficient route between a set of nodes (Cities) where each node is touched…
baharini
  • 217
  • 2
  • 11
1
vote
1 answer

Does translating the genes in a chromosome for a genetic algorithm for a combinatorial function increase the diversity of candidates?

I'm new to genetic algorithms and am writing code for the Traveling Salesman problem. I'm using cycle crossover to generate new offspring and I've found that this leads to some of the offspring retaining the same exact phenotype as one parent even…
1
vote
2 answers

Multi Fragment Heuristic for Traveling Salesman(C++)

I'm trying to implement Multi Fragment Heuristic algorithm for TSP. Algorithm is like that: Sort the edges in increasing order of their weights.(Ties can be broken arbitrarily.) Initialize the set of tour edges to be constructed to the empty…
Şaban Kaya
  • 31
  • 1
  • 8
1
vote
0 answers

draw petri net graph of Travelling salesman

Can you draw the petri net model of Travelling salesman problem? Is it possible in petri net to have places with different kinds?
user5922229
  • 31
  • 1
  • 5
1
vote
2 answers

Finding Hamiltonian path vs Hamiltonian circuit in a complete undirected weighted graph

I have a complete graph(Adj. matrix) with weights. I have built a solution for finding the minimum hamiltonian circuit in this graph(Travelling salesman problem) using branch and bound. I'm now stuck at finding the best hamiltonian path with given…
ayushgp
  • 4,891
  • 8
  • 40
  • 75
1
vote
0 answers

Traveling Salesman (TSP) with defined start and end points visualized by network

I would like to generated a directed network from a distance matrix where edges connect nearest vertices, or vertices that minimize the distance between the nodes. Each point, other than the start and end points, on the network would have a incoming…
user2117258
  • 515
  • 4
  • 18
1
vote
1 answer

2 opt arithmetic for solving TSP optimally

I am trying to find a solution of Travelling salesman problem in java. I have applied simulated annealing to solve this in the following way. Here is a code segment where I have implemented simulated annealing : public class SimulatedAnnealing { //…
user6216509
1
vote
1 answer

2D Array incorrectly printing

I'm having a problem correctly printing out a 2D array for the traveling salesman problem. I'm getting my input from a text file using input redirection. The file contains cities and arcs with the distance between the cities. Here is a small…
1
vote
1 answer

How to remove any unfilled slots from a 2d array without the STL?

This is for the Traveling Sales program assigned to me in my Computing Foundations Class. One of the rules in the class is that are NOT allowed to use the STL in any way other than what our professor tells us for each individual assignment. In this…
Remixt
  • 597
  • 6
  • 28
1
vote
1 answer

Variation on Travelling salesman problem - pick a good subroute from many nodes based on constraints

TLDR version: Most important issue is, that in a TSP problem, instead of finding the shortest Hamiltonian cycle, what are good ways to find the best path (I suppose the one that visits the most nodes) which is at most X length, with a fixed starting…
Botond Béres
  • 16,057
  • 2
  • 37
  • 50
1
vote
1 answer

Antagonism in Genetic Algorithms for the Traveling Salesman Prob. among Opposite Paths Along the Same Route

I'm pretty sure my question must have been investigated, but I'm missing the jargon that will help me search the literature. I'm writing a genetic algorithm that solves a type of Traveling Salesman Problem (TSP). Like the standard TSP, my variant…
user1856955
  • 41
  • 1
  • 4
1
vote
1 answer

Generate all neighbors for 2OPT in python

I am trying to implement to the 2opt optimization algorithm for the undirected Traveling Salesman Problem. For given cities: cities = [[ 72.06557466, 5.73765812], [ 94.50272578, 68.95162393], [ 58.53952609, 15.12518299], [ 94.64599891, …
1
vote
1 answer

Algorithm to make a route from Source Node to End Node using every node exactly once

I'm trying to create a route, given a start node and end node, that will travel to every single node in the graph, and minimize the cost of doing so. The graph is undirected, and every node is connected to each other directly. The weight of every…
applejacks01
  • 249
  • 1
  • 18
1
vote
2 answers

OpenMP - std::next_permutation

I am trying to parallelize my own C++ implementation of Travelling Salesman Problem using OpenMP. I have a function to calculate cost of road cost() and vector [0,1,2,...,N], where N is a number of nodes of the road. In main(), I am trying to find…
Siemko
  • 802
  • 1
  • 7
  • 15