This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is my code for a Travelling Salesman Problem assignment from college. | |
* I was supposed to create a Hamilton Cycle of N points on a 2D plane i.e. find the shortest | |
* path that visits all points exactly once and returns to the starting point. | |
* I implemented both the Smallest Insertion and Nearest Insertion algorithms which inserts | |
* a point where it will create the smallest increase in the total length of the cycle and | |
* insert a point where it is nearest to an other point already on the cycle respectively. | |
* | |
* In our brief we were informed that speed was the most important factor and so I decided | |
* to try and squeeze every last nanosecond out of the program... even at the cost of the memory. |