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
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
Beihoffer, D.E., Hendry, J., Nijenhuis, A., Wagon, S.: Faster algorithms for Frobenius numbers (in preparation)
Böcker, S., Lipták, Z.: Efficient mass decomposition. In: Proc. of ACM Symposium on Applied Computing, Santa Fe, USA, pp. 151–157 (2005)
Brauer, A., Shockley, J.E.: On a problem of Frobenius. J. Reine Angew. Math. 211, 215–220 (1962)
Davison, J.L.: On the linear diophantine problem of Frobenius. J. Number Theory 48(3), 353–363 (1994)
Dijkstra, E.: A note on two problems in connexion with graphs. Numerische Mathematik 1, 269–271 (1959)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics, 2nd edn. Addison- Wesley, Reading (1994)
Greenberg, H.: Solution to a linear diophantine equation for nonnegative integers. J. Algorithms 9(3), 343–353 (1988)
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)
Kannan, R.: Lattice translates of a polytope and the Frobenius problem. Combinatorica 12, 161–177 (1991)
Knuth, D.E.: The Art of Computer Programming: Seminumerical Algorithms, 3rd edn., vol. 2. Addison-Wesley, Reading (1997)
Lueker, G.S.: Two NP-complete problems in nonnegative integer programming. Technical Report TR-178, Department of Electrical Engineering, Princeton University (March 1975)
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)
Ramírez-Alfonsín, J.L.: Complexity of the Frobenius problem. Combinatorica 16(1), 143–147 (1996)
Ramírez-Alfonsín, J.L.: The Diophantine Frobenius Problem. Oxford University Press, Oxford (2005) (to appear)
J. J. Sylvester and W. J. Curran Sharp. Problem 7382. Educational Times, 37:26, 1884.
H. S. Wilf. A circle-of-lights algorithm for the “money-changing problem”. Amer. Math. Monthly, 85:562–565, 1978.
J. W. Wright. The change-making problem. J. Assoc. Comput. Mach., 22(1):125– 128, 1975.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)