I'm trying to do a simple route optimization without any fancy frameworks and insert-science-professor-name-here algorithms. I have a startDepot and 100k waypoints of which I want to find about 25 waypoints, which are reasonable to visit in a single route. The accuracy doesn't have to be perfect. Currently I'm searching for the nearest point to the start location, then search the nearest to the first point, then nearest to the previously found point etc, always excluding the previously found points. Now, the algorithm gives quite good results and even produces a reasonable route, but I really would like to include an endDepot also. Sometimes it may match the startDepot, sometimes not. Any ideas of how to find the next point that prefers the direction to the endDepot?
I'm using postgis but the question is more related to algorithm generation