Skip to main content
Log in

Online Maintenance of k-Medians and k-Covers on a Line

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

The standard dynamic programming solution to finding k-medians on a line with n nodes requires O(kn2) time. Dynamic programming speed-up techniques, e.g., use of the quadrangle inequality or properties of totally monotone matrices, can reduce this to O(kn) time. However, these speed-up techniques are inherently static and cannot be used in an online setting, i.e., if we want to increase the size of the problem by one new point. Then, in the worst case, we could do no better than recalculating the solution to the entire problem from scratch in O(kn) time. The major result of this paper is to show that we can maintain the dynamic programming speed up in an online setting where points are added from left to right on a line. Computing the new k-medians after adding a new point takes only O(k) amortized time and O(k log n) worst-case time (simultaneously). Using similar techniques, we can also solve the online k-coverage with uniform coverage on a line problem with the same time bounds.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Rudolf Fleischer, Mordecai J. Golin or Yan Zhang.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Fleischer, R., Golin, M. & Zhang, Y. Online Maintenance of k-Medians and k-Covers on a Line. Algorithmica 45, 549–567 (2006). https://doi.org/10.1007/s00453-005-1195-5

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-005-1195-5

Keywords

Navigation