How can I group an array of rectangles into “Islands” of connected regions?

前端 未结 8 2041
难免孤独
难免孤独 2021-02-04 08:12

The problem

I have an array of java.awt.Rectangles. For those who are not familiar with this class, the important piece of information is that they provid

8条回答
  •  余生分开走
    2021-02-04 08:34

    If you desire an O(n log n) algorithm, one was shown by Imai and Asano in Finding the connected components and a maximum clique of an intersection graph of rectangles in the plane.

    Note: I'm still working on my own plane sweep algorithm to find the set in O(n log n) time.

提交回复
热议问题