[R] Concave hull

davide.viggiano davide.viggiano at libero.it
Fri Apr 11 15:44:28 CEST 2014

Hi, I just want to add a possible solution to the problem in the special case
all the points must stay on the edge of the outline. THis is sometimes the
case when doing image analysis and you want to order the points along a
closed path.
In this specific case, you can use some algorithm like the traveling
salesman problem, which would give you the shortest path along all your
In this scenario, if your points are xy, you may use the following:

tsp <- TSP(dist(xy))
tour <- solve_TSP(tsp,method='farthest')
xy <- xy[tour,]

THis may not be the most economical solution (and you might also want
contrains such as never to intersect the path) and is not valid if your
boundary is not supposed to pass through all points.

View this message in context: http://r.789695.n4.nabble.com/Concave-hull-tp863710p4688606.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list