Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This problem is similar to the classical problem of finding the closest pair in a set of points. You can adapt the worst-case <strong>O(n log n)</strong> algorithms that solve the closest-pair problem to solve this one.</p> <p>The specific problem was featured in Google's Code Jam competition. Here is a resume of the analysis:</p> <blockquote> <p>The number of points can be pretty large so we need an efficient algorithm. We can solve the problem in <strong>O(n log n)</strong> time using <em>divide and conquer</em>. We will split the set of points by a vertical line into two sets of equal size. There are now three cases for the minimum-perimeter triangle: its three points can either be entirely in the left set, entirely in the right set, or it can use points from each half.</p> </blockquote> <p>Further:</p> <blockquote> <p>"To find the minimum perimeter for the third case (if it is less than p)":</p> </blockquote> <ol> <li>We select the points that are within a distance of p/2 from the vertical separation line.</li> <li>Then we iterate through those points from top to bottom, and maintain a list of all the points in a box of size p x p/2, with the bottom edge of the box at the most recently considered point.</li> <li>As we add each point to the box, we compute the perimeter of all triangles using that point and each pair of points in the box. (We could exclude triangles entirely to the left or right of the dividing line, since those have already been considered.)</li> </ol> <blockquote> <p>We can prove that the number of points in the box is at most 16, so we only need to consider at most a small constant number of triangles for each point.</p> </blockquote> <p>It seams to me you could even adapt the method to work in the |AB|²+|AC|²+|BC|² case.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload