Solution of a linear diophantine equation for nonnegative integers
Journal of Algorithms
The art of computer programming, volume 2 (3rd ed.): seminumerical algorithms
The art of computer programming, volume 2 (3rd ed.): seminumerical algorithms
Journal of the ACM (JACM)
Solving a System of Linear Diophantine Equations with Lower and Upper Bounds on the Variables
Mathematics of Operations Research
Concrete Mathematics: A Foundation for Computer Science
Concrete Mathematics: A Foundation for Computer Science
Hard Equality Constrained Integer Knapsacks
Proceedings of the 9th International IPCO Conference on Integer Programming and Combinatorial Optimization
Proceedings of the 2005 ACM symposium on Applied computing
Hi-index | 0.00 |
The Money Changing Problem (also known as Equality Constrained Integer Knapsack Problem) is as follows: Let a1 a2 ak be fixed positive integers with $\gcd(a_1, \dots, a_k) = 1$. Given some integer n, are there non-negative integers x1, ..., xk such that ∑iaixi = n? The Frobenius numberg(a1, ..., ak) 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 ak. For variable k, one can compute a residue table of a1 words which, in turn, allows to determine the Frobenius number. The best known algorithm for computing the residue table has runtime O(ka1 log a1) using binary heaps, and O(a1 (k+log a1)) using Fibonacci heaps. In both cases, O(a1) 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(ka1) 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.