login

An Optimal-Time Algorithm for Slope Selection

SIAM Journal on ComputingPublished 1 August 1989
Richard Cole, Jeffrey S. Salowe, William Steiger, Endre Szemerédi
Citations138
SJR quartileQ1
SJR score1.40
SNIP1.55

TL;DR

Given n points in the plane and an integer k, the problem of selecting that pair of points that determines the line with the kth smallest or largest slope is considered and line sweeping gives an optimal, $O(n\log n)$-time algorithm.

Abstract

Given n points in the plane and an integer k, the problem of selecting that pair of points that determines the line with the kth smallest or largest slope is considered. In the restricted case, where k is $O(n)$, line sweeping gives an optimal, $O(n\log n)$-time algorithm. For general k the parametric search technique of Megiddo is used to describe an $O(n(\log n)^2 )$-time algorithm. This is modified to produce a new, optimal $O(n\log n)$-time selection algorithm by incorporating an approximation idea.

Keywords

Computer Science