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

Mixed Integer Linear Optimization with Pyomo - Travelling salesman problem

I am trying to solve a travelling salesman problem with Pyomo framework. However, I am stuck, as the solver is informing me that I have formulated it as infeasible. import numpy as np import pyomo.environ as pyo from pyomo.environ import…
0
votes
1 answer

Big O time complexity for TSP

I'm currently read on this article - https://core.ac.uk/download/pdf/154419746.pdf and confused about how the O(n^2 * 2^n) time complexity of algorithm 1 is computed. Can someone explain it? I originally thought it was the Bellman-Held-Karp…
pew
  • 45
  • 6
0
votes
0 answers

Multiple travelling salesman problem ant colony optimization

how to divide 2 routes to find the shortest distance on Multiple traveling salesman problem ant colony optimization using python? where the result of the route must start from the starting city.
Khar H
  • 1
  • 1
0
votes
1 answer

reading dataset from text file for a TSP problem using ACO in python

I need to figure out how to modify this code so that I can read this data on a text file named "TSP_6.txt". It's a TSP problem using Ant Colony Optimization This is the format I'm using:TSP_6.txt. nbr_destinations 6 coordinates: 430 105 488…
Faris Bk
  • 41
  • 7
0
votes
0 answers

TSP implementation seems to ignore if statement

Just for fun I am creating a basic JavaScript implementation of the traveling salesman problem. It will basically create an array of cities with random coordinates, plot them on a canvas, then show the path between them. I then have a button which…
0
votes
1 answer

TSP approximate solver using MST * 2

I am attempting to solve Traveling Salesman problem and I dont understand step 3. What is that "preorder walk"? I recall there was such a thing as preorder walk over trees but Kruskals algorithm which I picked produces a directed graph, not a…
ArekBulski
  • 4,520
  • 4
  • 39
  • 61
0
votes
3 answers

Faulty conditional check in nearest neighbor calculation?

I'm trying to write a function to calculate an approximate traveling salesman route through a list of cities using the nearest neighbor algorithm, starting from the first city listed. However, each time I run it I get IndexError: list index out of…
0
votes
1 answer

How to do a permutation with restrictions?

I have a vector using Matlab whose values are from 1 to 18, I need to perform permutations of those values considering that certain numbers cannot go together. For example: vector = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18] In the conditions I…
0
votes
1 answer

dynamic programming, tsp problem, 9 cities out of 15

I think I have some kind of TSP problem. I have matrix of distances between 15 cities: A B C D E F G H I J K L M N O A 0 3 8 7 8 9 4 4 2 9 5 5 7 9 9 B 9 0 6 3 8 9 3 9 5 3 3 4 8 6 8 C 1 7 0 8 3 5 4 3 1 1 7 8 2 4 3 D 1 9 7 0 4 3 5 6 8 4 3 4 2 8 9 E…
0
votes
2 answers

How can I optimise my Haskell so I don't run out of memory

For an online algorithms course I am attempting to write a program which calculates the travelling salesman distance of cities using an approxomation algorithm: Start the tour at the first city. Repeatedly visit the closest city that the tour…
0
votes
0 answers

Shortest path between ordered groups of points/nodes, one point from each group at a time, eventually reaching all points cyclically

I am new to the field of shortest-path problems but after a fair amount of Googling, I think my problem is a variation on the TSP. I have multiple frames/planes of points scattered on a 2D grid and must select one point from each frame sequentially…
enm
  • 1
  • 3
0
votes
0 answers

Is this a travelling salesman variant?

Recently, I participated in a coding competition. The problem sounded like TSP. I am not looking for a solution here. I just want to find out if the problem was a variant of TSP and if it was solvable. Here is the summary: We were given a Complete…
Ravi M Patel
  • 2,905
  • 2
  • 23
  • 32
0
votes
0 answers

Is there an algorithm for near optimal partition of the Travelling salesman problem, creating routes that need the same time to complete?

I have a problem to solve. I need to visit 7962 places with a vehicle. The vehicle travels with 10km/h and each time I visit one place I stay there for 1 minute. I want to divide those 7962 places into subsets that take will take up to 8 hours. So…
0
votes
1 answer

VRPTW with restrictions on types of wagons in IBM ILOG CPLEX

Hello and thank you for your time! (English is not my first language, so I hope for your understanding) I have a problem with modeling the following VRP in IBM ILOG CPLEX: There is a finite park of wagons (about 1300 units) and a certain number of…
eightlay
  • 423
  • 2
  • 9
0
votes
1 answer

k-Traveling Repairmen Problem, with multiple repairmen visiting the same job lowering service time

For my Thesis, I want to create an algorithm that optimizes the k-Traveling Repairmen Problem, with the extension that sending multiple repairmen to the same location lowers the service time. I cannot find any literature on this topic, and I was…
beauf
  • 3
  • 1