Algorithm to locate numbers making use of input factors

I have actually simply reviewed with pupil and also he informed me him job, and also I assume it is intriguing. The job. There are documents with factors like :

Point0: x=1; y=4;
Point1: x=199; y=45;
Point2: x=42; y=333;
Point3: x=444; y=444;
PointN: x=nnn; y=mmm;

You need to locate polygons and also attract them. Each polygon existing as inner I suggest something similar to this :

| -----  |
| |    | |
| |----| | 
|        |

And inquiry what algorithm can you suggestions to make use of in this instance? I recognize this is from graph theory, yet desire point of view of various other. Many thanks.

2019-12-02 02:53:16
Source Share
Answers: 5

This is not a solution, given that the trouble declaration is sort of obscure, below is what I think it is.Assuming a polygon quickly inside a polygon to be the youngster of the polygon (and also in a similar way for moms and dad)

make best use of the variety of factors made use of to attract polygons such that

1. each polygon has just one youngster polygon (no brother or sisters)
2. each polygon has just one prompt moms and dad (does not hinge on the junction of 2 or even more moms and dads)

Of training course, outermost and also innermost polygons do not require to satify problems 2 and also 1 specifically.

Once more J.M.'s inquiry is necessary - do you suggest polygons or quadrilateral?

2019-12-03 04:22:47

If what I uploaded listed below is a proper presumption, after that you can consider a remedy on these lines.

  1. locate centroid of all factors in set S (pricey)
  2. get farthest factors from the centroid.
  3. make use of these to attract the outer polygon.
  4. remove from this factors from set S
  5. repeat action 1 till (say goodbye to internal polygons can be attracted)
2019-12-03 04:22:46

There are numerous algorithms for contour repair from factor examples. See as an example and also

2019-12-03 04:22:10

I will certainly make use of Convex_hull

Thanks to all for solutions.

2019-12-03 04:21:18

Use the Convex Layers algorithm of Bernard Chazelle, which is optimum : $\mathcal{O}(n \log n)$ time.

See below :

Here is a photo of component of the first web page of the paper :

2019-12-03 04:19:44