diego-vicente / som-tsp Goto Github PK
View Code? Open in Web Editor NEWSolving the Traveling Salesman Problem using Self-Organizing Maps
Home Page: https://diego.codes/post/som-tsp/
License: MIT License
Solving the Traveling Salesman Problem using Self-Organizing Maps
Home Page: https://diego.codes/post/som-tsp/
License: MIT License
Hey @diego-vicente,
It would be nice to have a Pypi package for your algorithm.
We could be able to solve a TSP problem with the following command som-tsp myfile.tsp
.
With some options I could choose whether to output the brut path, print the logs, display the distance, plot a graph or an animation...etc
normalize() functions uniformly scales positions 'x' and 'y' columns to a [0,1] range, this transformation doesn't keep the initial map dx/dy ratio and has negative impact on solution.
You can keep the ratio while bounding values to [0,1]:
dx = max(x)-min(x)
dy = max(y)-min(y)
ratio = max(dx, dy)
return (c-c.min()) / ratio
Most of your assets are squares and returns similar results but on assets/qa194.tsp, where dx/dy=1.64, it gives a -7% bonus to total route length.
Hi Diego,
I've just seen your work regarding self-organized map in salesman problem and I thank you for share your work.. I was looking some salesman problem solution because I'd like to implement something similar applied the process of peaces picking in my firm's warehouse.
Let me explain the issue: suppose there's a order of production included all peaces needed to accomplish that order.. naturally each peace is located in a different place of the warehouse... so it'll be usefull to find the best way.
I just need to change distance.py class due I'm not going to use euclidean metric...
Am I right?
Hello Diego!
Can you please add some comments on TSP files.
I understand, that these are city coordinates.
OK, but why they are in such strange format - 25270.8333 51505.8333
?
Why the generic format, e.g. 56.124122, 25.076389
is not used?
And why some coordinates are duplicated?
E.g. (assets/qa194.tsp file)
39 25270.8333 51505.8333
40 25270.8333 51523.0556
What's the point of duplicating 25270.8333
value? (and many others)
Also I've noticed, that many values has different integer part, but fraction parts of the values are the same:
3345 61200.0000 23466.6667
3346 61200.0000 23500.0000
3347 61200.0000 23766.6667
3348 61200.0000 24066.6667
3349 61200.0000 24100.0000
Why so?
On a clean install of Python 3 on MAC OS, I had to install also Pandas via Pip to make it work.
Hey there, thanks for the code @diego-vicente !
The SOM algorithm looks awesome but have you ever compared it with other algorithms ?
Is there a website comparing the TSP algorithms ?
Hi,
Is it possible to run the code in distributed mode? (Having several agents)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.