문제

Given a DCEL, how do I find the closest pair of sites?

Say the given DCEL is for a Voronoi diagram, how do I find the closest pair of sites? And what is the time complexity?

도움이 되었습니까?

해결책

The simplest way to do it is to iterate over all edges, find their adjoining faces, compute the distance between the Voronoi centers, and return the smallest pair. If your DCEL implementation is such that you cannot iterate directly over edges, you can use any graph-traversal algorithm (depth-first, breadth-first, etc.) to do the iteration.

In any case, the time complexity is proportional to the size of your input datastructure.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top