How to determine path from noisy X, Y data
With an unsorted list, you won't really know which points to include in each segment, so I guess you could just go with the closest point.
One way could be to pick a start point at random, and pick the closest point as the next point in each step. Add the first two points to a set S.
Fit a line to the points in S until the RMS exceeds some value, then clear S and start a new line.
The intersection of consecutive lines would be the end-points of the segments.
Bezier Interpolation may fit your problem.
This does not address the ordering of the points into a path, however; there are a number of approaches to consider:
- Any "optimal" type of path (e.g. smallest direction change at each point on the path, * Shortest path through all points) will likely boil down the NP complete Travelling Salesman Problem (TSP).
- A "reasonable" path to cluster the nodes and then route between clusters, and within clusters. Of course, the larger the cluster, or the larger the number of clusters the more this smaller problem looks like a large n TSP.
- Ordering the points by one axis. If there are much more than 2 axes, some dimensional reduction strategy may be useful. e.g. Independent Component Analysis.