Decomposition to Convex Polygons

后端 未结 4 1875
陌清茗
陌清茗 2020-12-31 08:46

This question is a little involved. I wrote an algorithm for breaking up a simple polygon into convex subpolygons, but now I\'m having trouble proving that it\'s not

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 09:31

    I think your algorithm cannot be optimal because it makes no use of any measure of optimality. You use other metrics like 'closest' vertices, and checking for 'necessary' diagonals.

    To drive a wedge between yours and an optimal algorithm, we need to exploit that gap by looking for shapes with close vertices which would decompose badly. For example (ignore the lines, I found this on the intertubenet):

    concave polygon which forms a G or U shape http://avocado-cad.wiki.sourceforge.net/space/showimage/2007-03-19_-_convexize.png

    You have no protection against the centre-most point being connected across the concave 'gap', which is external to the polygon.

    Your algorithm is also quite complex, and may be overdoing it - just like complex code, you may find bugs in it because complex code makes complex assumptions.

    Consider a more extensive initial stage to break the shape into more, simpler shapes - like triangles - and then an iterative or genetic algorithm to recombine them. You will need a stage like this to combine any unnecessary divisions between your convex polys anyway, and by then you may have limited your possible decompositions to only sub-optimal solutions.

    At a guess something like:

    1. decompose into triangles
    2. non-deterministically generate a number of recombinations
    3. calculate a quality metric (number of polys)
    4. select the best x% of the recombinations
    5. partially decompose each using triangles, and generate a new set of recombinations
    6. repeat from 4 until some measure of convergence is reached

提交回复
热议问题