Skip to main content


eCommons@Cornell

eCommons@Cornell >
College of Engineering >
Computer Science >
Computer Science Technical Reports >

Please use this identifier to cite or link to this item: http://hdl.handle.net/1813/6219
Title: A Polynomial-time Algorithm for the Change-Making Problem
Authors: Pearson, David
Keywords: computer science
technical report
Issue Date: Jun-1994
Publisher: Cornell University
Citation: http://techreports.library.cornell.edu:8081/Dienst/UI/1.0/Display/cul.cs/TR94-1433
Abstract: The change-making problem is the problem of representing a given value with the fewest coins possible from a given set of coin denominations. To solve this problem for arbitrary coin systems is NP-hard [L]. We investigate the problem of determining whether the greedy algorithm always produces the optimal result for a given coin system. Chang and Gill [CG] show that this can be solved in time polynomial in the size of the largest coin and in the number of coins. Kozen and Zaks [KZ] give a more efficient algorithm, and pose as an open problem whether there is an algorithm to solve this problem which is polynomial in the size of the input. In this paper, we will derive such an algorithm. We first obtain a characterization of the smallest coounterexample (if there is one) for which the greedy algorithm is not optimal. We then derive a set of $O(n^2)$ possible values (where $n$ is the number of coins) which must contain the smallest counterexample. Each can be tested with $O(n)$ arithmetic operations, giving us an $O(n^3)$ algorithm.
URI: http://hdl.handle.net/1813/6219
Appears in Collections:Computer Science Technical Reports

Files in This Item:

File Description SizeFormat
94-1433.pdf528.13 kBAdobe PDFView/Open
94-1433.ps132.91 kBPostscriptView/Open

Refworks Export

Items in eCommons are protected by copyright, with all rights reserved, unless otherwise indicated.

 

© 2014 Cornell University Library Contact Us