Link to home
Start Free TrialLog in
Avatar of CPOsosky
CPOsosky

asked on

Find the Concave Polygon

Hi Math Experts,

Here's my question

How do you calculate the concave boundary of a set of x,y coordinates that passes through the maximum number of points?

I was able to find lots of documentation online for finding the CONVEX boundary for a set of points, but I can't seem to find

anything on CONCAVE boundaries.

-CPOsosky

ASKER CERTIFIED SOLUTION
Avatar of Member_2_1001466
Member_2_1001466

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
Couldn't you find a concave boundary that passes through all the points?
Avatar of rjkimble
rjkimble

This is basically a traveling salesman problem. If you find the shortest path through all the points, that path will necessarily be a polygon (i.e., no intersecting edges). I think you'll find numerous techniques for constructing such polygons if you look at algorithms for traveling salesman problems.
It might pass through all points and some even several times. But is this still a hull?
A hull doesn't need to pass through all points. And it has to be closed unlike the traveling salesman.
>> Couldn't you find a concave boundary that passes through all the points?

Yes. It's really just a TSP, as I just indicated in my other comment. Sometimes it's very frustrating to have other comments pop up while writing your own. I don't see a solution to that problem, however.
Well, I'm talking about a closed trip traveling salesman problem. A minimum length cycle through all the points will necessarily be a polygon with no intersecting edges.
@rjkimble
But a concave boundary or hull doesn't need to pass through all points. Just all points need to be within. And thats the problem for it: When to choose a point to be part of the boundary or just contained.
Here's a link to a page about the traveling salesman problem with lots of other links:

http://www.ing.unlp.edu.ar/cetad/mos/TSPBIB_home.html

@SteH

The original question is looking for a boundary that passes through the maximum number of points. Well, a shortest-length Hamiltonian circuit will necessarily be a polygon that passes through ALL the points (can't do better than that) and whose edges don't intersect. Traveling salesman problems are all about finding such cycles. Although finding a solution to a TSP is hard, finding Hamiltonian circuits whose edges don't intersect is quite straightforward. Such techniques abound in the literature of traveling salesman problems.
I agree that if you want to find a polygon through all points it is a TSP, no doubt. And reading the question again I get some doubt about the meaning of it. The maximum number of points are definitly all. But why not saying through all points then, if there wasn't a choice to choose less. And if you are talking about boundaries it is not very intuitive to use all points for their boundary. And it contradicts what one would use the word boundary for, generally and not "math scienctificly" speaking.
To tell the truth, I have no idea what CPOsosky is looking for. I hope he responds and gives a bit more detail. Nonetheless, it's pretty simple to create a polygon through all the points, and if that's what he's after, we have provided sufficient information for him to do so.
I think he is looking for the green shape in http://ksfltd.com/products.htm#6. The yellow one is the convex hull and the green a concave one.
Excellent reference. I see your point. If that's the case, I have no good ideas offhand. I suspect that's a fairly complicated problem.
Avatar of CPOsosky

ASKER

Steh's reference is exactly what I'm looking for.

The problem is the arbitrary shape of the concave polygon that leads to multiple solutions.

The left side of the green figure could have just as easily been drawn using several of the internal points,

creating several "dents" on the left side.

-CPOsosky
I suspect that you have a bit of a challenge. My cursory search for concave hull returns only that reference, and those Russian mathematicians/programmers are pretty clever folks -- I suspect that the algorithm they're using hasn't been published anywhere, and reinventing it could be tricky.
Since the consensus seems to be that there's no easy solution to this problem,

I'm going to go ahead and close out the question.

Points go to Steh for effort.

Thanks everyone!

-CPOsosky