Looking for an algorithm, that would take a custom 2D polygon as an input. The algorithm should split the polygon in half, and produce two (at least approximately) equal halves in terms of area.
My idea so far is:
I'm curious if there's a better solution than this, in terms of speed or accuracy.
A fast, exact solution for simple polygons:
Step 1 has an O(n log n)-time algorithm. (There are faster algorithms, but I don't know how complicated they are.)
Steps 2 and 3 are obviously O(n).
Step 4 has an O(n)-time algorithm. Root the tree somewhere and compute the total for each sub-tree with depth-first search. Starting from the root, repeatedly descend via the child that has more than half of the overall total until that is no longer possible.
Step 5 is O(1)-time.