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

import GeneticAlgorithm ModuleNotFoundError: No module named 'libs.GeneticAlgorithm'

I have been trying to run a code a found and I get this kind of error . I don't know how to deal with this because I am new to python and trying to understand the concept of TSP problem. Any help would be appreciated Code below from…
loukous
  • 15
  • 1
  • 9
0
votes
0 answers

Trying to cluster close delivery places keeping constraints on time and order amount?

I am trying to assign societies to a delivery truck. A truck can take a limited load and has limited time. A society has a delivery time. I also have travel time between warehouse (truck departs from here only) and a data frame that has travel time…
nk23
  • 179
  • 1
  • 10
0
votes
1 answer

how to consider user modification in result and consider them in VRP

I am working on one VRP(Vehicle routing problem) to make plan of pickup and drop service, As VRP is NP hard problem user edits plan according to their requirement.Now I am planning to consider their modification while preparing plan. where should I…
Mandeep
  • 140
  • 3
  • 8
0
votes
0 answers

TSP problem in C using simple backtracking Solution

I was trying to solve the travel salesman program im stuck at the recursive part of moving from one city to another. Sample input & output: Please enter the roads 4X4 matrix row by row: 0 2 -1 2 -1 0 2 -1 1 -1 0 2 2 1 -1 0 …
Elad Par
  • 1
  • 1
0
votes
1 answer

Which of the following statements are true for the given special cases of the Traveling Salesman Problem?

I'm taking the Algorithms: Design and Analysis II class, one of the questions asks: Which of the following statements is true? Consider a TSP instance in which every edge cost is either 1 or 2. Then an optimal tour can be computed in polynomial…
Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219
0
votes
0 answers

TSP approach for Round Trip

I have a problem to solve. Below is the problem statement. I am currently at a location X. I have to start from X, and travel to these cities-A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V and then return back to X. In what sequence i should cover…
Shubham R
  • 7,382
  • 18
  • 53
  • 119
0
votes
0 answers

Shortest Path with must pass nodes

I want to calculate the shortest path from source S to sink T. But the path must pass from node1 and then node2 at least once. Eg: S->...->node1->....->node2->....->T And i have to run shortest path algorithm only once (meanly,i am not allowed to…
0
votes
1 answer

TSP Genetic Algorithm - path representation and identical tour problem

We are implementing path representation to solve our travelling salesman problem using a genetic algorithm. However, we were wondering how to solve the issue that there might be identical tours in our individuals, but which are recognised by the…
0
votes
0 answers

subtour elimination constraint pyomo

I am struggling to formulate the following subtour elimination constraint for TSP-like problem in Pyomo, given a graph G(V,A) where node 1 is the depot: where x_ij and y_h are binary constraints that I have previously defined as binary…
Mike
  • 375
  • 1
  • 4
  • 14
0
votes
2 answers

Simple hill climbing algorithm?

I'm trying to use the Simple hill climbing algorithm to solve the travelling salesman problem. I want to create a Java program to do this. I know it's not the best one to use but I mainly want it to see the results and then compare the results with…
0
votes
0 answers

How to extract the complexity of an algorithm based on dynamic programming and traveling agent?

I would like to know how to extract the complexity of this algorithm, based on dynamic programming and the traveling agent: do{ this.addNodeToList(actual, cost); this.sortArray(); Node node = this.arrayElements.get(0); …
0
votes
1 answer

Min Max Tour for VRP in OptaPlanner

I am new to OptaPlanner and trying to modify the existing VRP example to my needs. My Problem: I want the uncapacitated VRP, like in the example tutorial/test/tutorial-01-uncapacitated.vrp. With the actual implementation, the optimizer mostly uses…
0
votes
0 answers

Time Complexity of an algorithm in Travelling Salesman?

I'm currently learning about the TSP and want to combine two simple heuristics in one algorithm. It works by using the nearest neighbour algorithm to create a tour and then improving it by using a 2 opt swap for every combination. I believe the…
Okeh
  • 163
  • 1
  • 7
0
votes
1 answer

Order Batching Algorithm - Is it TSP and how do you solve it?

I am working on trying to solve the following problem: A warehouse has a pool of several hundred orders that need to be fulfilled. The first step to fulfilling an order is to pick its products which are shelved throughout the warehouse. Workers pick…
0
votes
0 answers

ILOG-CPLEX. How can I load data to my model from excel?

I want to load the parameters of my model from an excel file (.xls o csv) and I am new in this IDE, so for example, the next code solve the TSP (Traveling Salesman Problem) [TSP.mod] /********************************************* * OPL 12.7.1.0…