Fitting a Step Function to a Point Set

  • Authors:
  • Hervé Fournier;Antoine Vigneron

  • Affiliations:
  • Laboratoire PRiSM, CNRS UMR 8144 and Université de Versailles St-Quentin en Yvelines, Versailles, France 78035;INRA, UR 341 Mathématiques et Informatique Appliquées, Jouy-en-Josas, France 78352

  • Venue:
  • ESA '08 Proceedings of the 16th annual European symposium on Algorithms
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We consider the problem of fitting a step function to a set of points. More precisely, given an integer kand a set Pof npoints in the plane, our goal is to find a step function fwith ksteps that minimizes the maximum vertical distance between fand all the points in P. We first give an optimal 茂戮驴(nlogn) algorithm for the general case. In the special case where the points in Pare given in sorted order according to their x-coordinates, we give an optimal 茂戮驴(n) time algorithm. Then, we show how to solve the weighted version of this problem in time O(nlog4n). Finally, we give an O(nh2logh) algorithm for the case where houtliers are allowed, and the input is sorted. The running time of all our algorithms is independent of k.