traveling-salesman

OR-Tools solve traveling salesman (TSP) without returning to the home node

耗尽温柔 提交于 2021-01-27 18:10:19
问题 I'm using Google Or-Tools to solve a Traveling Salesman Problem by using this example (basically I just replaced the distances matrix with mine). As in the example, I set data['depot'] = 0 . For my application it is not important to return to the first node at the end of the path. I can remove the last edge from the solution but I wonder that if I could remove this constraint altogether it might find a better path overall. 回答1: Make sure the distance from all nodes to 0 (the depot) is null.

OR-Tools solve traveling salesman (TSP) without returning to the home node

风流意气都作罢 提交于 2021-01-27 18:01:40
问题 I'm using Google Or-Tools to solve a Traveling Salesman Problem by using this example (basically I just replaced the distances matrix with mine). As in the example, I set data['depot'] = 0 . For my application it is not important to return to the first node at the end of the path. I can remove the last edge from the solution but I wonder that if I could remove this constraint altogether it might find a better path overall. 回答1: Make sure the distance from all nodes to 0 (the depot) is null.

Java implementation of nearest neighbour algorithm for the travelling salesman problem, using dynamic programming [closed]

穿精又带淫゛_ 提交于 2020-08-20 11:10:09
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 days ago . Improve this question I am trying to use Java to implement the nearest neighbour algorithm for the travelling salesman problem. Before I knew precisely what I was looking for, I asked a similar question here, but received no assistance. I am starting with a matrix table[i][j] ==

Kernighan-Lin Algorithm

百般思念 提交于 2020-02-05 04:07:06
问题 Does anybody know this algorithm a little bit, because I'm considering using it, but I'm not sure whether it really meets all my requirements. So bascially, what I want to do is splitting up a graph in several subgraphs. However the nodes of each subgraph should be connected, that is it should not be the case that for example if I want to reach node x I have to go through another subgraph. And that is exactly my concern. Is it possible, that when I split up a graph with the Kernighan-Lin

optaplanner - VRP but with no depot

风格不统一 提交于 2020-01-25 05:18:04
问题 i'm working with the Multiple Vehicles Route Problem. I'm trying Optaplanner and looks good and promising. I'm using the CVRP-32customers example, but I need to remove the "depots". I just need to optimize a route for some salesman, where they start is not an issue to me. I just need the best 10 routes to visit my 100 customers, does not matter where they start. I looked at this SO Question, but could not take anything from it to solve my problem. Can this be achieved with Optaplanner? Is

Simulated Annealing TSP

限于喜欢 提交于 2020-01-20 05:09:42
问题 I'm looking to implement the simulated annealing algorithm in Java to find an optimal route for the Travelling Salesman Problem, so far I have implemented brute force and am looking to modify that code in order to use simulated annealing. Obviously brute-force and simulated annealing are very different and use very different functions. I understand simulated annealing uses a variable known as the temperature which then cools as the algorithm runs; with the temperature starting high and it

Find shortest path from X,Y coordinates (with start ≠ end)

别来无恙 提交于 2020-01-14 03:17:32
问题 I have a dataframe with X and Y coordinates of points like this: structure(list(X = c(666L, 779L, 176L, 272L, 232L, 74L, 928L, 667L, 1126L, 919L), Y = c(807, 518, 724, 221, 182, 807, 604, 384, 142, 728)), .Names = c("X", "Y"), row.names = c(NA, 10L), class = "data.frame") I just want to find out the shortest path connecting all these points, and also return its total distance. There are no other conditions: every point can be connected to any other, no specific point to start or end, no

Is this MSP an instance of the TSP?

∥☆過路亽.° 提交于 2020-01-13 06:52:10
问题 In his book, The Algorithm Design Manual , Steven S. Skiena poses the following problem: Now consider the following scheduling problem. Imagine you are a highly-indemand actor, who has been presented with offers to star in n different movie projects under development. Each offer comes specified with the first and last day of filming. To take the job, you must commit to being available throughout this entire period. Thus you cannot simultaneously accept two jobs whose intervals overlap. For an

A travelling salesman that has state

我的梦境 提交于 2020-01-04 06:40:28
问题 Let's say we have a directed graph. We want to visit every node exactly once by traveling on the edges of this graph. Every node is annotated with one or more tags; some nodes may share tags, and even have the exact same set of tags. As we go along our walk, we are collecting a list of every distinct tag we have encountered - our objective is to find the walk which postpones acquisition of new tags as much as possible. To restate this as a traveler analogy, let's say that a carpet salesman is