googlemaps-tsp-ga icon indicating copy to clipboard operation
googlemaps-tsp-ga copied to clipboard

help wanted

Open didix16 opened this issue 8 years ago • 4 comments

Hi! I saw your work about TSP. I'm working in a project made in nodejs which works with geolocation points ( a object like {latitude:x, longitude: y} andsearching a lot on how to make a optimal route starting from one point and return back , crossing some points, I saw your code.

I need a method that passing a start point {latitude:x, longitude:y} and array of points, returns a new point array ordered representing the route to travel with.

It's hard for me to understand the algorithm, so I'm wondering if you could write the method using your lib or help me to write it.

Thank you so much :)

didix16 avatar Aug 22 '16 18:08 didix16

Hi, Have you found a solution for your problem after 3-4 years?

hussein-khamis avatar Dec 07 '19 19:12 hussein-khamis

Hi @hussein-khamis . I had to left the project i which I was working but I founded the algorithm that solves that problem. Is the https://en.wikipedia.org/wiki/Travelling_salesman_problem. I found a repository which uses javascript to solve the problem: https://github.com/lovasoa/salesman.js/ But there are a lot of implementations over Internet.

Hope this help you :)

didix16 avatar Dec 08 '19 14:12 didix16

The thing is I am using Angular haha, and though this would be perfect I only I could use latitude and longitude, since I have my own markers. Any idea how we could do that? It's super important haha.

hussein-khamis avatar Dec 08 '19 14:12 hussein-khamis

Sorry I never used Angular. Anyway you can take the TSP algorithm and adapt it to angular :)

didix16 avatar Dec 09 '19 15:12 didix16