Skip to main content
Log in

Online Dynamic Programming Speedups

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

Consider the dynamic program h(n)=min 1≤jn a(n,j), where a(n,j) is some formula that may (online) or may not (offline) depend on the previously computed h(i), for i<n. The goal is to compute all h(n), for 1≤nN. It is well known that, if a(n,j) satisfy the Monge property, then the SMAWK algorithm (Aggarwal et al., Algorithmica 2(1):195–208, 1987) can solve the offline problem in O(N) time; a Θ(N) speedup over the naive algorithm.

In this paper we extend this speedup to the online case, that is, to compute h(n) in the order n=1,2,…,N when (i) we do not know the values of a(n′,j) for n′>n before h(n) has been computed and (ii) do not know the problem size N in advance. We show that if a(n,j) satisfy a stronger, but sometimes still natural, property than the Monge one, then each h(n) can be computed in online fashion in O(1) amortized time. This maintains the speedup online, in the sense that the total time to compute all h(n) is O(N). We also show how to compute each h(n) in the worst case O(log N) time, while maintaining the amortized time bound.

For a(n,j) satisfying our stronger property, our algorithm is also simpler than the standard SMAWK algorithm for solving the offline case. We illustrate our technique on two examples from the literature; the first is the D-median problem on a line, and the second comes from mobile wireless paging.

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

References

  1. Aggarwal, A., Klawe, M.M., Moran, S., Shor, P.W., Wilber, R.E.: Geometric applications of a matrix-searching algorithm. Algorithmica 2(1), 195–208 (1987). A preliminary version appeared in Proceedings of the 2nd Annual Symposium on Computational Geometry, pp. 285–292 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  2. Auletta, V., Parente, D., Persiano, G.: Placing resources on a growing line. J. Algorithms 26(1), 87–100 (1998)

    MATH  MathSciNet  Google Scholar 

  3. Bar-Noy, A., Feng, Y., Golin, M.J.: Paging mobile users efficiently and optimally. In: Proceedings of the 26th Annual IEEE Conference on Computer Communications (Infocom’07), pp. 1910–1918 (2007)

  4. Burkard, R.E., Klinz, B., Rudolf, R.: Perspectives of Monge properties in optimization. Discrete Appl. Math. 70(2), 95–161 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  5. Eppstein, D., Galil, Z., Giancarlo, R.: Speeding up dynamic programming. In: Proceedings of the 29th Annual Symposium on Foundations of Computer Science, pp. 488–496 (1988)

  6. Fleischer, R., Golin, M.J., Zhang, Y.: Online maintenance of k-medians and k-covers on a line. Algorithmica 45(4), 549–567 (2006). A preliminary version appeared in Proceedings of the 9th Scandinavian Workshop on Algorithm Theory, pp. 102—113 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  7. Galil, Z., Giancarlo, R.: Speeding up dynamic programming with applications to molecular biology. Theor. Comput. Sci. 64(1), 107–118 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  8. Galil, Z., Park, K.: A linear-time algorithm for concave one-dimensional dynamic programming. Inf. Process. Lett. 33(6), 309–311 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  9. Klawe, M.M.: A simple linear time algorithm for concave one-dimensional dynamic programming. Technical Report 89-16, Department of Computer Science, University of British Columbia (1989)

  10. Krishnamachari, B., Gau, R.-H., Wicker, S.B., Haas, Z.J.: Optimal sequential paging in cellular wireless networks. Wirel. Netw. 10(2), 121–131 (2004)

    Article  Google Scholar 

  11. Larmore, L.L., Schieber, B.: On-line dynamic programming with applications to the prediction of RNA secondary structure. J. Algorithms 12(3), 490–515 (1991). A preliminary version appeared in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 503—512 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  12. Wilber, R.: The concave least-weight subsequence problem revisited. J. Algorithms 9(3), 418–425 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  13. Woeginger, G.J.: Monge strikes again: Optimal placement of web proxies in the Internet. Oper. Res. Lett. 27(3), 93–96 (2000)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mordecai J. Golin.

Additional information

The research of the first author was partially supported by the NSF program award CNS-0626606; the research of the second and third authors was partially supported by Hong Kong RGC CERG grant HKUST6312/04E.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bar-Noy, A., Golin, M.J. & Zhang, Y. Online Dynamic Programming Speedups. Theory Comput Syst 45, 429–445 (2009). https://doi.org/10.1007/s00224-009-9166-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-009-9166-x

Keywords

Navigation