Travelling tourist problem

I spent a day tackling the travelling salesman problem using Matlab from a non-rigorous, not-super-mathematical standpoint. It was fun, and while I wouldn't trust my code to handle logistical planning of anything too important (it doesn't yield a perfect answer, just an approximation), I love seeing how the elements bind into a perceptual whole, similar to connect-the-dots.

How would you connect 100 uniformly randomly-distributed nodes (mouseover for the path traced out by my code)?






It tends to conquer 'close-hanging fruit' first, joining up the nodes with the shortest edges, leaving isolated, distal nodes hanging by a long thread on occasion.






400 nodes:


1000 nodes:


200 nodes, normally distributed, M=50; SD=20:




200 nodes, normally distributed, M=50; SD=10:


400 nodes, normally distributed, M=50; SD=10:


400 nodes, two hubs, normally distributed, M=30; SD=10 & M=100; SD=10 respectively, joined by a single 'trans-Atlantic cable':


Same distribution as above except that the second hub has M=80:


Same distribution as above except that the second hub has M=60:


200 nodes, normally distributed in y-dimension, M=100; SD=10 & exponentially distributed in x-dimension, M=100:


 

Site map | Terms and conditions | Contact | © 2018 Chen Xing. (Last update: 10 March, 2018)