Skip to main content

The Money Changing Problem Revisited: Computing the Frobenius Number in Time O(ka 1)

  • Conference paper
Computing and Combinatorics (COCOON 2005)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3595))

Included in the following conference series:

Abstract

The Money Changing Problem (also known as Equality Constrained Integer Knapsack Problem) is as follows: Let a 1 < a 2 < ... < a k be fixed positive integers with \(\gcd(a_1, \dots, a_k) = 1\). Given some integer n, are there non-negative integers x 1, ..., x k such that ∑ i a i x i = n? The Frobenius numberg(a 1, ..., a k ) is the largest integer n that has no decomposition of the above form.

There exist algorithms that, for fixed k, compute the Frobenius number in time polynomial in log a k . For variable k, one can compute a residue table of a 1 words which, in turn, allows to determine the Frobenius number. The best known algorithm for computing the residue table has runtime O(ka 1 log a 1) using binary heaps, and O(a 1 (k+log a 1)) using Fibonacci heaps. In both cases, O(a 1) extra memory in addition to the residue table is needed. Here, we present an intriguingly simple algorithm to compute the residue table in time O(ka 1) and extra memory O(1). In addition to computing the Frobenius number, we can use the residue table to solve the given instance of the Money Changing Problem in constant time, for any n.

Supported by “Deutsche Forschungsgemeinschaft” (BO 1910/1-1 and 1-2) within the Computer Science Action Program

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aardal, K., Hurkens, C., Lenstra, A.K.: Solving a system of diophantine equations with lower and upper bounds on the variables. Math. Operations Research 25, 427–442 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  2. Aardal, K., Lenstra, A.K.: Hard equality constrained integer knapsacks. In: Cook, W.J., Schulz, A.S. (eds.) IPCO 2002. LNCS, vol. 2337, pp. 350–366. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  3. Beihoffer, D.E., Hendry, J., Nijenhuis, A., Wagon, S.: Faster algorithms for Frobenius numbers (in preparation)

    Google Scholar 

  4. Böcker, S., Lipták, Z.: Efficient mass decomposition. In: Proc. of ACM Symposium on Applied Computing, Santa Fe, USA, pp. 151–157 (2005)

    Google Scholar 

  5. Brauer, A., Shockley, J.E.: On a problem of Frobenius. J. Reine Angew. Math. 211, 215–220 (1962)

    MathSciNet  MATH  Google Scholar 

  6. Davison, J.L.: On the linear diophantine problem of Frobenius. J. Number Theory 48(3), 353–363 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  7. Dijkstra, E.: A note on two problems in connexion with graphs. Numerische Mathematik 1, 269–271 (1959)

    Article  MathSciNet  MATH  Google Scholar 

  8. Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics, 2nd edn. Addison- Wesley, Reading (1994)

    MATH  Google Scholar 

  9. Greenberg, H.: Solution to a linear diophantine equation for nonnegative integers. J. Algorithms 9(3), 343–353 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  10. Heap, B.R., Lynn, M.S.: A graph-theoretic algorithm for the solution of a linear diophantine problem of Frobenius. Numer. Math. 6, 346–354 (1964)

    Article  MathSciNet  MATH  Google Scholar 

  11. Kannan, R.: Lattice translates of a polytope and the Frobenius problem. Combinatorica 12, 161–177 (1991)

    Article  Google Scholar 

  12. Knuth, D.E.: The Art of Computer Programming: Seminumerical Algorithms, 3rd edn., vol. 2. Addison-Wesley, Reading (1997)

    Google Scholar 

  13. Lueker, G.S.: Two NP-complete problems in nonnegative integer programming. Technical Report TR-178, Department of Electrical Engineering, Princeton University (March 1975)

    Google Scholar 

  14. Nijenhuis, A.: A minimal-path algorithm for the “money changing problem”. Amer. Math. Monthly 86, 832–835 (1979); Correction in Amer. Math. Monthly 87, 377 (1980)

    Google Scholar 

  15. Ramírez-Alfonsín, J.L.: Complexity of the Frobenius problem. Combinatorica 16(1), 143–147 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  16. Ramírez-Alfonsín, J.L.: The Diophantine Frobenius Problem. Oxford University Press, Oxford (2005) (to appear)

    Book  MATH  Google Scholar 

  17. J. J. Sylvester and W. J. Curran Sharp. Problem 7382. Educational Times, 37:26, 1884.

    Google Scholar 

  18. H. S. Wilf. A circle-of-lights algorithm for the “money-changing problem”. Amer. Math. Monthly, 85:562–565, 1978.

    Google Scholar 

  19. J. W. Wright. The change-making problem. J. Assoc. Comput. Mach., 22(1):125– 128, 1975.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Böcker, S., Lipták, Z. (2005). The Money Changing Problem Revisited: Computing the Frobenius Number in Time O(ka 1). In: Wang, L. (eds) Computing and Combinatorics. COCOON 2005. Lecture Notes in Computer Science, vol 3595. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11533719_97

Download citation

  • DOI: https://doi.org/10.1007/11533719_97

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-28061-3

  • Online ISBN: 978-3-540-31806-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics