Advanced Techniques for Dynamic Programming

Reference work entry


This is an overview over dynamic programming with an emphasis on advanced methods. Problems discussed include path problems, construction of search trees, scheduling problems, applications of dynamic programming for sorting problems, server problems, as well as others. This chapter contains an extensive discussion of dynamic programming speedup. There exist several general techniques in the literature for speeding up naive implementations of dynamic programming. Two of the best known are the Knuth-Yao quadrangle inequality speedup and the SMAWK/LARSCH algorithm for finding the row minima of totally monotone matrices. The chapter includes “ready to implement” descriptions of the SMAWK and LARSCH algorithms. Another focus is on dynamic programming, online algorithms, and work functions.


Work Function Transmission Control Protocol Travel Salesman Problem Knapsack Problem Competitive Ratio 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



This chapter is dedicated to Lawrence L. Larmore, a great mentor. A sabbatical (academic year 2006/07) granted by the University of Nevada, Las Vegas, which benefited this book chapter, is acknowledged.

Recommended Reading

  1. 1.
    P.K. Agarwal, S. Sen, Selection in monotone matrices and computing kth nearest neighbors. J. Algorithms 20(3), 581–601 (1996); A preliminary version appeared, in Proceedings of the 4th Scandinavian Workshop on Algorithm Theory (1994), pp. 13–24MathSciNetCrossRefMATHGoogle Scholar
  2. 2.
    A. Aggarwal, J.K. Park, Notes on searching in multidimensional monotone arrays, in Proceedings of the 29th Annual Symposium on Foundations of Computer Science (IEEE Computer Society, Washington, DC, 1988), pp. 497–512Google Scholar
  3. 3.
    A. Aggarwal, M.M. Klawe, S. Moran, P.W. Shor, R.E. Wilber, 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 (1986), pp. 285–292MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    A. Aggarwal, A. Bar-Noy, S. Khuller, D. Kravets, B. Schieber, Efficient minimum cost matching and transportation using the quadrangle inequality. J. Algorithms 19(1), 116–143 (1995); A preliminary version appeared, in Proceedings of the 33rd Annual Symposium on Foundations of Computer Science (1992), pp. 583–592MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    A. Aggarwal, D. Kravets, J.K. Park, S. Sen, Parallel searching in generalized Monge arrays. Algorithmica 19(3), 291–317 (1997); A preliminary version appeared, in Proceedings of the 2nd Annual ACM Symposium on Parallel Algorithms and Architectures (1990), pp. 259–268MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    S. Albers, P. Brucker, The complexity of one-machine batching problems. Discret. Appl. Math. 47, 87–10 (1993)MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    A. Apostolico, M. Atallah, L. Larmore, S. McFaddin, Efficient parallel algorithms for string editing and related problems. SIAM J. Comput. 19(5), 968–988 (1990)MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    A.N. Arslan, O. Egecioglu, Dynamic programming based approximation algorithms for sequence alignment with constraints. INFORMS J. Comput. 16(4), 441–458 (2004)MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    M.J. Atallah, S. Rao Kosaraju, L.L. Larmore, G.L. Miller, S-H. Teng, Constructing trees in parallel, in Proceedings of the 1st Annual ACM Symposium on Parallel Algorithms and Architectures (ACM, New York, 1989) , pp. 421–431Google Scholar
  10. 10.
    S. Baase, A. van Gelder, Computer Algorithms (Addison Wesley, Reading, 2000)Google Scholar
  11. 11.
    V. Bafna, P.A. Pevzner, Sorting by transposition. SIAM J. Discret. Math. 11, 224–240 (1998)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    P.Baptiste, Batching identical jobs. Math. Methods Oper. Res. 52, 355–367 (2000)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    P. Baptiste, A. Jouglet, On minimizing total tardiness in a serial batching problem. Oper. Res. 35, 107–115 (2001)MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    A. Bar-Noy, R.E. Ladner, Efficient algorithms for optimal stream merging for media-on-demand. SIAM J. Comput. 33(5), 1011–1034 (2004)MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    W. Bein, M. Chrobak, L.L. Larmore, The 3-server problem in the plane, in Proceedings of 7th European Symposium on Algorithms (ESA). Volume 1643 of Lecture Notes in Computer Science (Springer, Berlin/New York, 1999), pp. 301–312Google Scholar
  16. 16.
    W. Bein, M. Chrobak, L.L. Larmore, The 3-server problem in the plane. Theoret. Comput. Sci. 287, 387–391 (2002)MathSciNetCrossRefGoogle Scholar
  17. 17.
    W. Bein, L.L. Larmore, S. Latifi, I. Hal Sudborough, Block sorting is hard. Int. J. Found. Comput. Sci. 14(3), 425–437 (2003)CrossRefMATHGoogle Scholar
  18. 18.
    W. Bein, P. Brucker, L.L. Larmore, J.K. Park, The algebraic Monge property and path problems. Discret. Appl. Math. 145(3), 455–464 (2005)MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    W. Bein, J. Noga, J. Wiegley, Approximation for batching via priorities. Sci. Ann. Comput. Sci. XVII, 1–18 (2007)MathSciNetGoogle Scholar
  20. 20.
    W. Bein, L. Epstein, L.L. Larmore, J. Noga, Optimally competitive list batching. Theoret. Comput. Sci. 410(38–40), 3631–3639 (2009)MathSciNetCrossRefMATHGoogle Scholar
  21. 21.
    W. Bein, M. Golin, L. Larmore, Y. Zhang, The Knuth-Yao quadrangle-inequality speedup is a consequence of total-monotonicity. Trans. Algorithms 6(1) (2009)Google Scholar
  22. 22.
    W. Bein, L.L. Larmore, L. Morales, I. Hal Sudborough, A quadratic time 2-approximation algorithm for block sorting. Theor. Comput. Sci. 410, 711–717 (2009)CrossRefMATHGoogle Scholar
  23. 23.
    W. Bein, L.L. Larmore, J. Noga, R. Reischuk, Knowledge state algorithms. Algorithmica 60(3), 653–678 (2011)MathSciNetCrossRefMATHGoogle Scholar
  24. 24.
    R. Bellman, The theory of dynamic programming. Bull. Am. Math. Soc. 60:503–516 (1954)CrossRefMATHGoogle Scholar
  25. 25.
    R. Bellman, Dynamic Programming, Dover Paperback edition 2003 edn. (Princeton University Press, Princeton, 1957)MATHGoogle Scholar
  26. 26.
    R. Bellman, A.O. Esogbue, I. Nabeshima, Mathematical Aspects of Scheduling and Applications (Pergamon, Oxford/New York, 1982)MATHGoogle Scholar
  27. 27.
    M. Bellmore, G.L. Nemhauser, The traveling salesman problem: A survey. Oper. Res. 16(3), 538–558 (1968)MathSciNetCrossRefMATHGoogle Scholar
  28. 28.
    D.P. Bertsekas, Dynamic Programming and Optimal Control, 2nd edn. (Athena Scientific, Belmont, 2000)Google Scholar
  29. 29.
    A. Borchers, P. Gupta, Extending the quadrangle inequality to speed-up dynamic programming. Inf. Process. Lett. 49(6), 287–290 (1994)MathSciNetCrossRefMATHGoogle Scholar
  30. 30.
    A. Borodin, R. El-Yaniv, Online Computation and Competitive Analysis (Cambridge University Press, Cambridge/New York , 1998)MATHGoogle Scholar
  31. 31.
    P.G. Bradford, M.J. Golin, L.L. Larmore, W. Rytter, Optimal prefix-free codes for unequal letter costs: Dynamic programming with the Monge property. J. Algorithms 42(2), 277–303 (2002); A preliminary version appeared, in Proceedings of the 6th Annual European Symposium on Algorithms (1998), pp. 43–54MathSciNetCrossRefMATHGoogle Scholar
  32. 32.
    G. Brassard, P. Bratley, Fundamentals of Algorithms (Prentice Hall, Englewood, 1996)Google Scholar
  33. 33.
    P. Brucker, Scheduling Algorithms 5th edn. (Springer, Berlin/New York, 2007)MATHGoogle Scholar
  34. 34.
    P. Brucker, J. Hurink, Solving a chemical batch scheduling problem by local search. Ann. Oper. Res. 96, 17–38 (2000)CrossRefMATHGoogle Scholar
  35. 35.
    P. Brucker, S. Knust, Complex Scheduling (Springer, Berlin, 2006)MATHGoogle Scholar
  36. 36.
    P. Brucker, A. Gladky, H. Hoogeveen, M. Kovalyov, C. Potts, T. Tautenhahn, S. van de Velde, Scheduling a batch processing machine. J. Sched. 1(1), 31–54 (1998)MathSciNetCrossRefMATHGoogle Scholar
  37. 37.
    P. Brucker, M. Kovalyov, Y. Shafransky, F. Werner, Batch scheduling with deadline on parallel machines. Ann. Oper. Res. 83, 23–40 (1998)MathSciNetCrossRefMATHGoogle Scholar
  38. 38.
    R.E. Burkard, B. Klinz, R. Rudolf, Perspectives of Monge properties in optimization. Discret. Appl. Math. 70(2), 95–161 (1996)MathSciNetCrossRefMATHGoogle Scholar
  39. 39.
    R.E. Burkard, V.G. Deineko, R. van Dal, J.A.A. van der Veen, G.J. Woeginger, Well-solvable special cases of the TSP: A survey. SIAM Rev. 40(3), 496–546 (1998)MathSciNetCrossRefMATHGoogle Scholar
  40. 40.
    R.E. Burkard, V.G. Deineko, G.J. Woeginger, The travelling salesman problem on permuted Monge matrices. J. Comb. Optim. 2(4), 333–350 (1999)MathSciNetCrossRefMATHGoogle Scholar
  41. 41.
    M. Chrobak, L.L. Larmore, An optimal online algorithm for k servers on trees. SIAM J. Comput. 20, 144–148 (1991)MathSciNetCrossRefMATHGoogle Scholar
  42. 42.
    M. Chrobak, L.L. Larmore, The server problem and on-line games, in On-line Algorithms, ed. by L.A. McGeoch, D.D. Sleator. Volume 7 of DIMACS Series in Discrete Mathematics and Theoretical Computer Science (AMS/ACM, Providence, RI, 1992), pp. 11–64Google Scholar
  43. 43.
    M. Chrobak, L.L. Larmore, Metrical task systems, the server problem, and the work function algorithm, in Online Algorithms: The State of the Art, ed. by A. Fiat, G.J. Woeginger (Springer, Berlin/New York, 1998), pp. 74–94CrossRefGoogle Scholar
  44. 44.
    M. Chrobak, H. Karloff, T.H. Payne, S. Vishwanathan, New results on server problems. SIAM J. Discret. Math. 4, 172–181 (1991)MathSciNetCrossRefMATHGoogle Scholar
  45. 45.
    T. Corman, C. Leiserson, R. Rivest, C. Stein, Introduction to Algorithms, 2nd edn. (McGraw Hill, New York, 2001)Google Scholar
  46. 46.
    A. Dan, D. Sitaram, P. Shahabuddin, Scheduling policies for an on-demand video server with batching, in Proceedings of the second ACM international conference on Multimedia (ACM, New York, 1994), pp. 15–23Google Scholar
  47. 47.
    S. Dasgupta, C. Papadimitriou, U. Vazirani, Algorithms (McGraw Hill, Boston, 2008)Google Scholar
  48. 48.
    E.V. Denardo, Dynamic Programming: Models and Applications (Dover, Mineola, 2003)Google Scholar
  49. 49.
    D.R. Dooly, S.A. Goldman, S.D. Scott, On-line analysis of the TCP acknowledgment delay problem. J. ACM 48(2), 243–273 (2001)MathSciNetCrossRefGoogle Scholar
  50. 50.
    S.E. Dreyfus, A.M. Law, The art and theory of dynamic programming (Academic, New York, 1977)MATHGoogle Scholar
  51. 51.
    D. Eppstein, Sequence comparison with mixed convex and concave costs. J. Algorithms 11(1), 85–101 (1990)MathSciNetCrossRefMATHGoogle Scholar
  52. 52.
    D. Eppstein, Z. Galil, R. Giancarlo, G.F. Italiano, Sparse dynamic programming I: Linear cost functions. J. ACM 39(3), 519–545 (1992); A preliminary version appeared, in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms, (1990), pp. 513–522MathSciNetCrossRefMATHGoogle Scholar
  53. 53.
    D. Eppstein, Z. Galil, R. Giancarlo, G.F. Italiano, Sparse dynamic programming II: Convex and concave cost functions. J. ACM 39(3), 546–567 (1992); A preliminary version appeared, in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms (1990), pp. 513–522MathSciNetCrossRefMATHGoogle Scholar
  54. 54.
    R. Fleischer, M.J. Golin, Y. Zhang, 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 (2004), pp. 102–113MathSciNetCrossRefMATHGoogle Scholar
  55. 55.
    R.F. Floyd, Algorithm 97: Shortest path. Commun. ACM 5(6), 345 (1962)CrossRefGoogle Scholar
  56. 56.
    Z. Galil, R. Giancarlo, Speeding up dynamic programming with applications to molecular biology. Theor. Comput. Sci. 64(1), 107–118 (1989)MathSciNetCrossRefMATHGoogle Scholar
  57. 57.
    Z. Galil, K. Park, Dynamic programming with convexity, concavity and sparsity. Theor. Comput. Sci. 92(1), 49–76 (1992)MathSciNetCrossRefMATHGoogle Scholar
  58. 58.
    W.H. Gates, C.H. Papadimitriou, Bounds for sorting by prefix reversal. Discret. Math. 27, 47–57 (1979)MathSciNetCrossRefGoogle Scholar
  59. 59.
    E.N. Gilbert, E.F. Moore, Variable length encodings. Bell Syst. Tech. J. 38, 933–967 (1959)MathSciNetCrossRefGoogle Scholar
  60. 60.
    D. Gusfield, Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology (Cambridge University Press, Cambridge, 1997)CrossRefMATHGoogle Scholar
  61. 61.
    R. Hassin, A. Tamir, Improved complexity bounds for location problems on the real line. Oper. Res. Lett. 10(7), 395–402 (1991)MathSciNetCrossRefMATHGoogle Scholar
  62. 62.
    H. Heydari, I. Hal Sudborough, On the diameter of the pancake network. J. Algorithms 25(1), 67–94 (1997)MathSciNetCrossRefMATHGoogle Scholar
  63. 63.
    D.S. Hirschberg, L.L. Larmore, The least weight subsequence problem. SIAM J. Comput. 16(4), 628–638 (1987)MathSciNetCrossRefMATHGoogle Scholar
  64. 64.
    H. Hoogeveen, A. Vestjens, Optimal on-line algorithms for single-machine scheduling, in Proceedings of 5th Conference Integer Programming and Combinatorial Optimization (IPCO) (Springer Verlag, London, 1996), pp. 404–414Google Scholar
  65. 65.
    T.C. Hu, A.C. Tucker, Optimal computer search trees and variable-length alphabetical codes. SIAM J. Appl. Math. 21(4), 514–532 (1971)MathSciNetCrossRefMATHGoogle Scholar
  66. 66.
    A. Karlin, On the performance on competitive algorithms in practice, in Online Algorithms: The State of the Art, ed. by A. Fiat, G.J. Woeginger (Springer, 1998), pp. 373–382CrossRefGoogle Scholar
  67. 67.
    A. Karlin, C. Kenyon, D. Randall, Dynamic TCP acknowledgment and other stories about e/(e-1). Algorithmica 36(3), 209–224 (2003)MathSciNetCrossRefMATHGoogle Scholar
  68. 68.
    A. Karlin, M. Manasse, L. Rudolph, D. Sleator, Competitive snoopy caching. Algorithmica 3, 79–119 (1988)MathSciNetCrossRefMATHGoogle Scholar
  69. 69.
    M.M. Klawe, Superlinear bounds for matrix searching problems. J. Algorithms 13(1), 55–78 (1992); A preliminary version appeared; in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms (1990), pp. 485–493MathSciNetCrossRefMATHGoogle Scholar
  70. 70.
    M.M. Klawe, D.J. Kleitman, An almost linear time algorithm for generalized matrix searching. SIAM J. Discret. Math. 3(1), 81–97 (1990)MathSciNetCrossRefMATHGoogle Scholar
  71. 71.
    D.E. Knuth, Optimum binary search trees. Acta Inf. 1, 14–25 (1971)CrossRefMATHGoogle Scholar
  72. 72.
    E. Koutsoupias, C. Papadimitriou, On the k-server conjecture. J. ACM 42, 971–983 (1995)MathSciNetCrossRefMATHGoogle Scholar
  73. 73.
    D. Kravets, J.K. Park, Selection and sorting in totally monotone arrays. Theory Comput. Syst. 24(3), 201–220, (1991); A preliminary version appeared, in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms (1990), pp. 494–502MathSciNetMATHGoogle Scholar
  74. 74.
    R. Kuik, M. Salomon, L.N. van Wassenhove, Batching decisions: structure and models. Eur. J. Oper. Res. 75, 243–263 (1994)CrossRefGoogle Scholar
  75. 75.
    L.L. Larmore, D.S. Hirschberg, A fast algorithm for optimal length-limited Huffman codes. J. ACM 37(3), 464–473 (1990); A preliminary version appeared, in Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms (1990), pp. 310–318MathSciNetCrossRefMATHGoogle Scholar
  76. 76.
    L.L. Larmore, T.M. Przytycka, Parallel construction of trees with optimal weighted path length, in Proceedings of the 3rd Annual ACM Symposium on Parallel Algorithms and Architectures (ACM Press, New York, 1991), pp. 71–80Google Scholar
  77. 77.
    L.L. Larmore, B. Schieber, On-line dynamic programming with applications to the prediction of rna secondary structure. J. Algorithms 12, 490–515 (1991)MathSciNetCrossRefMATHGoogle Scholar
  78. 78.
    L.L. Larmore, B. Schieber, 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 (1990), pp. 503–512MathSciNetCrossRefMATHGoogle Scholar
  79. 79.
    E. Lawler, J. Lensta, A.H.G Rinooy Kan, D. Smoys (eds.), The Traveling Salesman: A Guided Tour of Combinatorial Optimization (Wiley, New York, 1985)MATHGoogle Scholar
  80. 80.
    M. Mahajan, R. Rama, V. Raman, S. Vijayakumar, Approximate block sorting. Int. J. Found. Comput. Sci. 12(2), 337–356 (2006)MathSciNetCrossRefGoogle Scholar
  81. 81.
    M. Mahajan, R. Rama, S. Vijayakumar, Block sorting: a characterization and some heuristics. Nord. J. Comput. 14(1), 25 (2007)MathSciNetGoogle Scholar
  82. 82.
    M. Manasse, L.A. McGeoch, D. Sleator, Competitive algorithms for server problems. J. Algorithms 11, 208–230 (1990)MathSciNetCrossRefMATHGoogle Scholar
  83. 83.
    S. Meyn, Control Techniques for Complex Networks (Cambridge University Press, Cambridge, MA, 2007)CrossRefGoogle Scholar
  84. 84.
    J.K. Park, The Monge array: an abstraction and its applications. PhD thesis, Massachusetts Institute of Technology, 1991Google Scholar
  85. 85.
    C.N. Potts, L.N. van Wassenhove, Integrating scheduling with batching and lot-sizing: A review of algorithms and complexity. J. Oper. Res. Soc. 43, 395–406 (1992)MATHGoogle Scholar
  86. 86.
    B. Schieber, Computing a minimum weight k-link path in graphs with the concave Monge property. J. Algorithms 29(2), 204–222 (1998); A preliminary version appeared, in Proceedings of the 6th Annual ACM-SIAM Symposium on Discrete Algorithms (1995), pp. 405–411MathSciNetCrossRefMATHGoogle Scholar
  87. 87.
    M. Sniedovich, Dynamic Programming: Foundations and Principles. (Taylor and Francis, Boca Raton, FL, 2010)CrossRefGoogle Scholar
  88. 88.
    N. Stokey, R.E. Lucas, E. Prescott, Recursive Methods in Economic Dynamics (Harvard University Press, Cambridge, MA, 1989)MATHGoogle Scholar
  89. 89.
    A. Tamir, An O(pn 2) algorithm for the p-median and related problems on tree graphs. Oper. Res. Lett. 19(2), 59–64 (1996)MathSciNetCrossRefMATHGoogle Scholar
  90. 90.
    A. Viterbi, Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Trans. Inf. Theory 13, 260–269 (1967)CrossRefMATHGoogle Scholar
  91. 91.
    M.L. Wachs, On an efficient dynamic programming technique of F. F. Yao. J. Algorithms 10(4), 518–530 (1989)MathSciNetCrossRefMATHGoogle Scholar
  92. 92.
    S. Warshall, A theorem on boolean matrices. J. ACM 9(1) 11–12 (1962)MathSciNetCrossRefMATHGoogle Scholar
  93. 93.
    R.L. Wessner, Optimal alphabetic search trees with restricted maximal height. Inf. Process. Lett. 4(4), 90–94 (1976)MathSciNetCrossRefMATHGoogle Scholar
  94. 94.
    R. Wilber, The concave least-weight subsequence problem revisited. J. Algorithms 9(3), 418–425 (1988)MathSciNetCrossRefMATHGoogle Scholar
  95. 95.
    G.J. Woeginger, Monge strikes again: Optimal placement of web proxies in the Internet. Oper. Res. Lett. 27(3), 93–96 (2000)MathSciNetCrossRefMATHGoogle Scholar
  96. 96.
    F.F. Yao, Efficient dynamic programming using quadrangle inequalities, in Proceedings of the 12th Annual ACM Symposium on Theory of Computing (ACM Press, New York, 1980), pp. 429–435Google Scholar
  97. 97.
    F.F. Yao, Speed-up in dynamic programming. SIAM J. Matrix Anal. Appl. 3(4), 532–540 (1982)MATHGoogle Scholar
  98. 98.
    G. Zhang, X. Cai, C.Y. Lee, C.K. Wong, Minimizing makespan on a single batch processing machine with nonidentical job sizes. Naval Res. Logist. 48, 226–240 (2001)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.University of Nevada, Las VegasDepartment of Computer ScienceLas VegasNV, USA

Personalised recommendations