I have a list of GPS coordinates as a 2 column (lat and long) dataframe.
I want to find the shortest path that includes all GPS coordinates and re-sort the dataframe with the GPS coordinates in order of the shortest path.
The route will be non-cyclical, so the distance from the last coordinate to the first is irrelevant since it does not need to loop back.
For my purposes here it's fine if the list is sorted based on point distances in 2D space if that simplifies the algorithm.
I had a look at the igraph package for possible functions to use but couldn't make heads or tails of it. I'm open to whatever gets the job done the easiest. I'm an R noob. Thanks.