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

Crossover algorithm for Travelling Salesman?

I am looking for a crossover algorithm for a genetic algorithm for the Travelling Salesman Problem. However, my TSP problem is a variation of the traditional problem: Instead of only being given a list of points that we need to visit, we are given a…
0
votes
1 answer

Reset a path in Android not working

I am currently developing a game in which the computer makes a path along points in an arraylist according to the travelling salesman problem algorithm. With each iteration I need the previous path to reset. At the moment each new path generated by…
0
votes
1 answer

Need to draw a path using points in an arraylist

I've developed an android Travelling Salesman Problem (TSP) game application in which the user makes a path and plays against the computer, which uses the TSP algorithm to make a full path every time the user clicks to join two points with a line.…
0
votes
3 answers

"no matching function for call to 'Map::functionname"

I am trying set up the flat space environment for the Travelling Salesman. This is my attempt: #include using namespace std; #include #include #include class Base //Allocate the memory…
0
votes
1 answer

R genealg package rbga.bin evaluation function

I am trying to solve the TSP (Traveling Salesman Problem) using the rbga.bin from the genealg package. I have matrix that stores the distances between the cities like this: [,1] [,2] [,3] [,4] [1,] 0 2 10 4 [2,] 0 0 12 …
0
votes
0 answers

Calculating the sum of all savings done by 2Opt

how would I calculate all the savings done by 2Opt without calculating the route distances before and after 2Opt moves and than just getting the difference? I'll explain what i tried, but i keep getting wrong results. I would like to know if my…
user3888540
  • 105
  • 1
  • 1
  • 3
0
votes
1 answer

Travelling Salesman with minimum change permutation

I am reading about permutation generation and relationship with Travelling Salesman Problem in Introduction to design and analysis of algorithms. Here author mentioned as below We can insert n in the previously generated permutations either left …
venkysmarty
  • 11,099
  • 25
  • 101
  • 184
0
votes
0 answers

Traveling Salesman (TSP) variation

I'm faced with what is basically the Traveling Salesman Problem (TSP) but with an extra difficulty: In my case the Salesman has a pool of x amount of addresses (where x varies). Each day, he has to select y amount of addresses to go to (where y…
Jelle
  • 298
  • 1
  • 11
0
votes
1 answer

does OptaPlanner take care of TSPTW (or VRPTW ) with optional nodes?

let's say my traveling salesman is allowed to ignore some nodes, as long as he finishes visiting the nodes he chose , within a time range. his goal is to maximize the gain from the nodes visited (such as the total sales amount from these nodes). I…
teddy teddy
  • 3,025
  • 6
  • 31
  • 48
0
votes
1 answer

How to define a time-distance function for the Traveling Salesman algorithm

I wrote a program that solves the traveling salesman problem minimizing the travel distance. Now I'm triyng to create a weight function that takes distance and time and outputs a value I can use instead of the distance for the TSP. My idea is to let…
Federico
  • 789
  • 1
  • 6
  • 29
0
votes
1 answer

Java, genetic algorithm traveling salesman issue

Working on project for class having some issues during the crossover (I understand the issues I'll face later in the assignment, but it's how the professor asked) my chromosome 1 and 2 are reporting as the same thing. randomNum =…
user3553037
0
votes
2 answers

TSP through user-defined points

I have some set of points, and there is subset of points, marked as "static". So I need to solve TSP, which will create best path including marked points in static positions. How can I to solve it? May be my problem can be solved in another way:…
0
votes
1 answer

Minimum distance between start and end by going through must visit points in a maze

So, suppose i have a maze, which has a start point and an end point, marked with Orange and red respectively and my goal is to find the minimum distance between them. The blocked path is represented by black colour and the open path is represented…
0
votes
1 answer

Two Dimensional Array Java TSP

I need to figure out how to get the following data into two ArrayLists or arrays... THIS THAT OTHER 1 2 3 4 5 6 7 8 9 I need the column titles to go into one array or ArrayList, and the integer values to go into a two…
0
votes
2 answers

Clarification on the formulation of the Traveling Salesman

I have been doing research in the traveling salesman problem, and I have a question about how it is formulated. Or this might be a question on classification or name of sub-problems or variations on the problem. In the traveling salesman problem…
user1994036