CFP last date
20 May 2024
Call for Paper
June Edition
IJCA solicits high quality original research papers for the upcoming June edition of the journal. The last date of research paper submission is 20 May 2024

Submit your paper
Know more
Reseach Article

ASH CC Algo.: Coin Change Algorithm Optimization

by Ashar Mehmood
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 178 - Number 15
Year of Publication: 2019
Authors: Ashar Mehmood
10.5120/ijca2019918787

Ashar Mehmood . ASH CC Algo.: Coin Change Algorithm Optimization. International Journal of Computer Applications. 178, 15 ( May 2019), 1-9. DOI=10.5120/ijca2019918787

@article{ 10.5120/ijca2019918787,
author = { Ashar Mehmood },
title = { ASH CC Algo.: Coin Change Algorithm Optimization },
journal = { International Journal of Computer Applications },
issue_date = { May 2019 },
volume = { 178 },
number = { 15 },
month = { May },
year = { 2019 },
issn = { 0975-8887 },
pages = { 1-9 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume178/number15/30603-2019918787/ },
doi = { 10.5120/ijca2019918787 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2024-02-07T00:50:27.269541+05:30
%A Ashar Mehmood
%T ASH CC Algo.: Coin Change Algorithm Optimization
%J International Journal of Computer Applications
%@ 0975-8887
%V 178
%N 15
%P 1-9
%D 2019
%I Foundation of Computer Science (FCS), NY, USA
Abstract

The Coin Change problem is to represent a given amount V with fewest number of coins m. As a variation of knapsack problem, it is known to be NP-hard problem. Most of the time, Greedy alogrithm (time complexity O(m), space complexity O(1)), irrespective of real money system, doesn’t give optimal solution. Dynamic algorithm (time complexity O(mV), space complexity O(V)) gives optimal solution but is still expensive as amount V can be very large. In this paper, we have presented a suboptimal solution for the coin change problem which is much better than the greedy algorithm and has accuracy comparable to dynamic solution. Moreover, comparison of different algorithms has been stated in this paper. Proposed algorithm has a time complexity of O(m2f) and space complexity of O(1), where f is the maximum number of times a coin can be used to make amount V. It is, most of the time, more efficient as compared to dynamic algorithm and uses no memoization, this is a significant advantage over dynamic approach.

References
  1. Richard E. Bellman, “Dynamic Programming”, Princeton University Press Princeton, Dover Publications, NY, USA, 1957.
  2. Kevin Q. Brown, “Dynamic Programming in Computer Science”, Technical Report CMU-CS-79-106, pp. 1-3, 1979.
  3. Donald E. Knuth, “The Art of Computer Programming”, Addison-Wesley, US, ISBN: 0-201-03801-3, 1968.
  4. John J. Bartholdi, “The Knapsack Problem”, DOI 10.1007/978-0-387-73699-0_2, ISSN 0884-8289, 2008.
  5. S Needleman, C Wuncsch, “A general method applicable to the search for similarities in the amino acid sequences of two proteins”, Journal of Molecular Biology, 1970.
  6. Richard E. Bellman, “On a routing problem”, Quarterly Applied Mathematics, DOI: 10.1090/qam/102435, 1958.
  7. G. S. Lueker, “Two NP-complete Problems in Non-negative Integer Programming”, Comput. Sci. Lab. Univ. Princeton, 1975.
  8. J. W. Wright, “The Change-Making Problem”, J. Assoc. Comput. Mach., Vol. 22, Issue 1, pp. 125-128, NY, USA, 1975.
  9. Thomas H. Cormen, Charles Eric Leiserson, Ronald Linn Rivest, Clifford Stein, “Introduction to Algorithms”, Chapter 16, Greedy Algorithm, ISBN: 978-0-262-03384-8, 2001.
  10. Xuan Chai, “Canonical Coin System for Change-Making problems” in Ninth International Conference on Hybrid Intelligent Systems MOE- Microsoft Laboratory for Intelligent Computing and Intelligent Systems”, pp. 1-2, DOI: 10.1109/HIS.2009.103, 2009.
  11. Susanna S. Epp, “Discrete Mathematics with Applications (4 th ed.)”, p.427, ISBN-10: 0495391328, 2010.
  12. Edsger W. Dijkstra, “Recursive Programming”, Numerische Mathematik, Vol. 2, Issue 1, doi: 10.1007/BF01386232, New Jersey, USA, pp. 312-318, 1960.
  13. Elmirap, “Coin Change”, LeetCode, Retrieved August 10, 2018 from url: https://leetcode.com/articles/coin-change/#, May 2016.
  14. Eric W. Weisstein, “Exhaustive Search” MathWorld—A wolfram Web Resource, Retrieved August 13, 2018 from url:http://mathworld.wolfram.com/ExhaustiveSearch.htl.
  15. Christian Charras, Thierry Lecroq, “Brute Force algorithm”, Retrieved August 13, 2018 from url: http://www-igm.univ-mlv.fr/~lecroq/string/node3.html, 1997.
Index Terms

Computer Science
Information Sciences

Keywords

Dynamic programming Coin change problem optimization methods Algorithm design and analysis.