Abstract
In the planar k-median problem we are given a set of demand points and want to open up to k facilities as to minimize the sum of the transportation costs from each demand point to its nearest facility. In the line-constrained version the medians are required to lie on a given line. We present a new dynamic programming formulation for this problem, based on constructing a weighted DAG over a set of median candidates. We prove that, for any convex distance metric and any line, this DAG satisfies the concave Monge property. This allows us to construct efficient algorithms in L ∞ and L 1 and any line, while the previously known solution (Wang and Zhang, ISAAC 2014) works only for vertical lines. We also provide an asymptotically optimal \(\mathcal {O}(n)\) solution for the case of k = 1.
Similar content being viewed by others
Notes
This is not a metric.
References
Aggarwal, A., Klawe, M. M., Moran, S., Shor, P., Wilber, R.: Geometric applications of a matrix-searching algorithm. Algorithmica 2(1-4), 195–208 (1987)
Bajaj, C.: The algebraic degree of geometric optimization problems. Discrete Comput. Geom. 3(1), 177–191 (1988)
Bein, W., Golin, M. J., Larmore, L. L., Zhang, Y.: The knuth–Yao quadrangle-inequality speedup is a consequence of total monotonicity. ACM Trans. Algorithms (TALG) 6(1), 17 (2009)
Blum, M., Floyd, R. W., Pratt, V. R., Rivest, R. L., Tarjan, R. E.: Time bounds for selection. J. Comput. Syst. Sci. 7(4), 448–461 (1973)
Galil, Z., Park, K.: A linear-time algorithm for concave one-dimensional dynamic programming. Inf. Process. Lett. 33(6), 309–311 (1990)
Galil, Z., Park, K.: Dynamic programming with convexity, concavity and sparsity. Theor. Comput. Sci. 92(1), 49–76 (1992)
Grossi, R., Gupta, A., Vitter, J. S.: High-order entropy-compressed text indexes Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 841–850. Society for Industrial and Applied Mathematics (2003)
Megiddo, N., Supowit, K. J.: On the complexity of some common geometric location problems. SIAM J. Comput. 13(1), 182–196 (1984)
Navarro, G., Russo, L. M.: Space-efficient data-analysis queries on grids Algorithms and Computation, pp. 323–332. Springer (2011)
Schieber, B.: Computing a minimum weight k-link path in graphs with the concave Monge property. Journal of Algorithms 29(2), 204–222 (1998)
Wang, H., Zhang, J.: Line-constrained K-median, K-means, and K-center problems in the plane Algorithms and Computation, pp. 3–14. Springer (2014)
Author information
Authors and Affiliations
Corresponding author
Additional information
This article is part of the Topical Collection on Special Issue on Combinatorial Algorithms
Rights and permissions
About this article
Cite this article
Gawrychowski, P., Zatorski, Ł. Speeding up dynamic programming in the line-constrained k-median. Theory Comput Syst 62, 1351–1365 (2018). https://doi.org/10.1007/s00224-017-9780-y
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-017-9780-y