Let us consider a set S consisting of a collection of grid locations (i,j),i,j=1,\ldots,n, in 2-dimensional gridded plane. Here the point (i,j) corresponds to a rectangular grid in the X-Y plane.
This set has the property that one can reach any element (i,j)\in S from any other element ({i'},{j'})\in S through a series of neighbouring grid points which are also in S.
I am interested about the shape of the set S in the plane, for this reason I need the boundary grid locations of the set S.

Note: R-code
data=read.csv(file="trial.csv")
require('ggplot2')
pred.points <- ggplot(data = data,
aes(x = lat,
y = lon,
colour = variable)) +
geom_point()
print(pred.points)
I need an algorithm to find the boundary grid locations for the set?
Here I don't know whether the set is concave or convex.
Rimplementation inalphahull::ashape. – whuber Nov 05 '14 at 19:29Rsolution (along with solutions on other platforms). – whuber Nov 08 '14 at 16:57