1

I'm looking for an algorithm to find a polygon that can represent a set of points in 2D space. Specifically, if given a set of points like this

enter image description here

It should ideally produce something similar to this:

enter image description here

(The arrows are segments)

Basically, the output would be a set of segments that "best" address the features of the points. The algorithms possibly take some parameters to control the numbers of output segments.

I currently do not have any ideas on what algorithms I'm looking for. Any papers or advice are appreciated.

IdleAir
  • 23
  • 3

1 Answers1

1

This is a possible algorithm.

For every point, look at the 2 points closest to it, they become connected. Then use Douglas Peucker to refine the edges.

Essentially you will create a first polygon containing all the points, and the try to eliminate points whose elimination doesn't change the shape too much.

Makogan
  • 8,208
  • 7
  • 44
  • 112
  • This looks exactly like what I'm looking for. Though I'm not sure connecting two points that are closest will work for the case that the two points are very close to each other but connecting them will divide the shape into two parts. Like a set of points form an "8" will result in two circles or something. – IdleAir Nov 07 '20 at 22:58
  • Unfortunately, heuristical algorithms are usually not perfect ofr every case. – Makogan Nov 07 '20 at 23:38