Closest distance between two points(disjoint set)

后端 未结 4 1679
梦毁少年i
梦毁少年i 2021-01-31 21:11

\"enter

This problem is a kind of closest pair between two disjoint set. Upperside picture

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 21:43

    This problem is usually called the closest bichromatic pair problem. Here are a couple approaches.

    1. Delaunay triangulation. (This certainly works with L2 (= Euclidean) distances; I think the steps generalize to L1.) For every Delaunay triangulation (there can be more than one in degenerate cases), there exists a minimum spanning tree whose edges all belong to the triangulation. In turn, this minimum spanning tree contains a shortest edge crossing the cut between the color classes.

    2. Nearest neighbor data structures.

    3. If it is given that the red points are separated in x from the blue points, then you may be able to adapt the O(n) merge step of the Shamos–Hoey divide-and-conquer algorithm for the closest (monochromatic) pair problem, described here.

提交回复
热议问题