Skip to main content
Log in

Change-making problems revisited: a parameterized point of view

  • Published:
Journal of Combinatorial Optimization Aims and scope Submit manuscript

Abstract

The change-making problem is the problem of representing a given amount of money with the fewest number of coins possible from a given set of coin denominations. In the general version of the problem, an upper bound for the availability of every coin value is given. Even the special case, where for each value an unlimited number of coins is available, is NP-hard. Since in the original problem some amounts can not be represented, especially if no coin of value one exists, we introduce generalized problems that look for approximations of the given amount such that a cost function is minimized. We recall algorithms for the change-making problem and present new algorithms for the generalized version of the problem. Motivated by the NP-hardness we study fixed-parameter tractability of all these problems. We show that some of these problems are fixed-parameter tractable and that some are \(\hbox {W}[1]\)-hard. In order to show the existence of polynomial and constant-size kernels we prove some general results and apply them to several parameterizations of the change-making problems.

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.

Institutional subscriptions

Similar content being viewed by others

Notes

  1. The case of a maximization problem can be handled in a similar way

  2. For example, if \(b_i=13\) we obtain the following values for the new coin list \(c_{i,0}=1\cdot c_i\), \(c_{i,1}=2\cdot c_i\), \(c_{i,2}=4\cdot c_i\), and \(c_{i,3}=6\cdot c_i\)

  3. The weights \(w_{i,\ell }\) are necessary in order to consider the new coin values. If new coin value \(4\cdot c_i\) is chosen, we have to count 4 coins of our original instance. For example, \(b_2=7\), \(c_2=5\), \(b_3=3\), \(c_3=10\) defines the following values for the new coin list \(c_{2,0}=1\cdot 5=5\), \(c_{2,1}=2\cdot 5=10\), \(c_{2,2}=4\cdot 5=20\), and \(c_{3,0}=1\cdot 10=10\), \(c_{3,1}=2\cdot 10=20\). In order to deal with these not necessarily different coin values, the weights \(w_{i,\ell }\) are important

  4. For example, \({\text {LCM}}(9,12)=36=4\cdot 9 = 3\cdot 12\). Thus no optimal solution can use four or more coins of value 9, since four coins of value 9 could be substituted by three coins of value 12

  5. In the standard definition of Downey and Fellows (see Downey and Fellows 1999, 2013, p. 15), the parameter \(\kappa \) is considered as part of the instance. It is not computed from the instance. However, we discuss parameters that can be derived directly from the instance so that Flum and Grohe’s notation seems to be straightforward. Flum and Grohe require that \(\kappa \) is polynomial time computable which is actually the case for all our parameters but not required in our considerations

  6. Please note that each parameterized problem of change-making, for which \(n\le d\kappa (I)\), d being a constant, lies in the class \(\hbox {FPT}\). That is, e.g., the case for \(\kappa (I):=\sum _{i=1}^{n}b_{i}\)

  7. We use the notations of change-making problems when stating the result of Frank and Tardos (1987)

  8. Please note that in Theorem 7 for some number x, the notation |x| gives its absolute value

References

  • Adamaszek A, Adamaszek M (2010) Combinatorics of the change-making problem. Eur J Comb 31(1):47–63

    Article  MathSciNet  MATH  Google Scholar 

  • Bodlaender HL (2009) Kernelization: new upper and lower bound techniques. In: Chen J, Fomin FV (eds) IWPEC 2009, volume 5917 of lecture notes in computer science. Springer, Berlin, pp 17–37

    Google Scholar 

  • Bringmann K (2017) A Near-Linear Pseudopolynomial Time Algorithm for Subset Sum. In: ACM-SIAM symposium on discrete algorithms, pp 1073–1084

  • Cai X (2009) Canonical coin systems for CHANGE-MAKING problems. In: 9th international conference on hybrid intelligent systems (HIS 2009), Shenyang. IEEE, pp 499–504

  • Chang SK, Gill A (1970) Algorithmic solution of the change-making problem. J ACM 17(1):113–122

    Article  MATH  Google Scholar 

  • Cowen LJ, Cowen R, Steinberg A (2008) Totally greedy coin sets and greedy obstructions. Electron J Comb 15(R90):1–13

    MathSciNet  MATH  Google Scholar 

  • Cygan M, Fomin FV, Kowalik L, Lokshtanov D, Marx D, Pilipczuk M, Pilipczuk M, Saurabh S (2015) Parameterized algorithms. Springer, New York

    Book  MATH  Google Scholar 

  • Downey RG, Fellows MR (1995) Fixed-parameter tractability and completeness II: on completeness for W[1]. Theor Comput Sci 141(1–2):109–131

    Article  MathSciNet  MATH  Google Scholar 

  • Downey RG, Fellows MR (1999) Parameterized complexity. Springer, Berlin

    Book  MATH  Google Scholar 

  • Downey RG, Fellows MR (2013) Fundamentals of parameterized complexity. Springer, New York

    Book  MATH  Google Scholar 

  • Etscheid M, Kratsch S, Mnich M, Röglin H (2015) Polynomial kernels for weighted problems. In: Mathematical foundations of computer science. Lecture notes in computer science, vol. 673. Springer, Berlin, pp 287–298

  • Fellows MR, Koblitz N (1993) Fixed-parameter complexity and cryptography. In: Conference applied algebra, algebraic algorithms and error-correcting codes (1993), volume 673 of lecture notes in computer science. Springer, Berlin, pp 121–131

  • Flum J, Grohe M (2006) Parameterized complexity theory. Springer, Berlin

    MATH  Google Scholar 

  • Frank A, Tardos E (1987) An application of simultaneous diophantine approximation in combinatorial optimization. Combinatorica 7(1):49–65

    Article  MathSciNet  MATH  Google Scholar 

  • Horowitz E, Sahni S (1974) Computing partitions with applications to the knapsack problem. J ACM 21(2):277–292

    Article  MathSciNet  MATH  Google Scholar 

  • Hu TC, Lenard ML (1976) Optimality of a heuristic solution for a class of knapsack problems. Oper Res 24(1):193–196

    Article  MathSciNet  MATH  Google Scholar 

  • Kannan R (1987) Minkowski’s convex body theorem and integer programming. Math Oper Res 12:415–440

    Article  MathSciNet  MATH  Google Scholar 

  • Karp RM (1972) Reducibility among combinatorial problems. In: Miller RE, Thatcher JW (eds) Complexity of computer computations. Plenum Press, New York, pp 85–103

    Chapter  Google Scholar 

  • Koiliaris K, Xu C (2017) A faster pseudopolynomial time algorithm for subset sum. In: ACM-SIAM symposium on discrete algorithms, pp 1062–1072

  • Lueker GS (1975) Two NP-complete problems in nonnegative integer programming. Technical Report 178, Department of Computer Science, Princeton University, Princeton, N.J

  • Magazine MJ, Nemhauser GL, Trotter LE Jr (1975) When the greedy solution solves a class of knapsack problems. Oper Res 23(2):207–217

    Article  MathSciNet  MATH  Google Scholar 

  • Martello S, Toth P (1990) Knapsack problems. John Wiley & Sons, New York

    MATH  Google Scholar 

  • Niedermeier R (2006) Invitation to fixed-parameter algorithms. Oxford University Press, New York

    Book  MATH  Google Scholar 

  • Pearson D (2005) A polynomial-time algorithm for the change-making problem. Oper Res Lett 33(3):231–234

    Article  MathSciNet  MATH  Google Scholar 

  • Pisinger D (1999) Linear time algorithms for knapsack problems with bounded weights. J Algorithms 33(1):1–14

    Article  MathSciNet  MATH  Google Scholar 

  • Wright JW (1975) The change-making problem. J ACM 22(1):125–128

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Steffen Goebbels.

Appendix: NP-Hardness

Appendix: NP-Hardness

It is well known that Subset Sum is NP complete, see Karp (1972). We prove hardness of Min 0-1-CM and Min UCM via a reduction from Subset Sum. To this end, a list of n not necessarily different positive integers \(a_1 \le a_2 \le \dots \le a_n\) and a sum \(a\in \mathbb {N}\) is given. The task is to decide if values \(x_i\in \{0, 1\}\) exist such that

$$\begin{aligned} \sum _{i=1}^n x_i a_i =a. \end{aligned}$$

We equivalently solve this task using Min 0-1-CM or Min UCM with 2n coin denominations (\(1\le i\le n\))

$$\begin{aligned} c_i:= & {} a_i + 2^{\lceil \log _2(n a_n)\rceil } [2^{i-1} + 2^{n}], \\ c_{n+i}:= & {} 0 + 2^{\lceil \log _2(n a_n)\rceil } [2^{i-1} + 2^{n}] \end{aligned}$$

and amount

$$\begin{aligned} c:= a + 2^{\lceil \log _2(n a_n)\rceil } [2^n-1 +2^{n}n]. \end{aligned}$$

Lowest \(\lceil \log _2(n a_n)\rceil \) bits are used to sum up n values to represent a without carry: For each \(1\le i\le n\), either amount \(a_i\) or zero is added. The next n bits ensure that each \(a_i\) is taken at most once. Therefore, it does not matter if we use Min 0-1-CM or Min UCM. Finally, the highest bit of \(c_i\) and \(c_{n+i}\), respectively, serves to count the number of coins that sum up to c. This information seems to be redundant but is needed to avoid errors due to carries.

If there is a carry originating from the section of the lowest \(\lceil \log _2(n a_n)\rceil \) bits, then more than n coins are added, and independently of carry bits, the highest bits represent a number greater than n—which is excluded by definition of c. Therefore, there is no carry to be added to the middle section of n bits.

We now show that we have to add up exactly one coin from each pair \((c_i, c_{n+i})\) to set all these n bits. Obviously, these n coins set the bits. Powers of two make up a canonical coin system that supports the standard greedy algorithm. All other choices that set all n bits need more than n coin values: If a bit occurs twice than it can be replaced by the next higher bit so that there is a solution with less bits. But solutions with more than n added coins are excluded by the highest bits of the coins that have to sum up to n. A carry of the middle part would only additionally increase this counter.

If Min 0-1-CM or Min UCM finds a solution, then it consists of exactly n different coin denominations where either \(c_i\) or \(c_{n+i}\) is part of the solution. Values \(a_i\) of chosen coins \(c_i\), \(1\le i\le n\), sum up to a. Vice versa, each solution of Subset Sum leads to a solution of both change making problems that adds coin \(c_i\) if \(a_i\) is in the subset sum. Otherwise coin \(c_{i+n}\) is used to represent c. Instance sizes of both subset sum problems are polynomially bounded by the instance size of Subset Sum.

Min UCM is a special case of Min BCM so that we have also proven NP hardness of Min BCM.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Goebbels, S., Gurski, F., Rethmann, J. et al. Change-making problems revisited: a parameterized point of view. J Comb Optim 34, 1218–1236 (2017). https://doi.org/10.1007/s10878-017-0143-z

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10878-017-0143-z

Keywords

Mathematics Subject Classification

Navigation