Subset sum related problem
Submitted by Kestrel on Fri, 2005-12-09 02:19.
This is not a java related question, but i think it could be interesting to some of you guys. I appreciate if someone has more info about this.
I have encountered a problem in my current project that seems pretty
much related to the subset sum problem. I just want to make sure it is
not a special case of the subset sum problem and whether it has a
efficient solution or not.
We are doing an application for tellers in a bank. The teller basically
has a cash box that contains money of different denominations.
He wants us to provide a function that assists him in determining
whether his cashbox contains any collection of coins and notes that sum
up to certain value or not. That is, he wants to ask, can I get 123.25
out of my cashbox?
a typical cashbox will look like the illustrated figure. It seems to me
a typical subset problem. The guy in the team who was doing this
function came up with greedy algorithm and I showed to him that it is
not always correct for the showed coin system . Yet, I am not quite
sure if there are some special cases in this problem or not.
----------------------------------------------------------------
Avail. No. In Cashbox Denomination Value Total
----------------------------------------------------------------
100 500 50,000<-- Notes
40 200 8,000
10 100 1,000
100 50 5,000
100 20 2,000
44 10 440
20 5 100
100 1 100
100 1 100 <--Coins
100 0.5 50
100 0.25 25
100 0.1 10
100 0.05 5
100 0.01 1






Back to the old days :-)
Thank you for the info. Yes
mmm, Since the amount of