Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soulcutter/no_change_please
Knapsack problem solver
https://github.com/soulcutter/no_change_please
Last synced: 22 days ago
JSON representation
Knapsack problem solver
- Host: GitHub
- URL: https://github.com/soulcutter/no_change_please
- Owner: soulcutter
- License: mit
- Created: 2012-11-07T14:09:25.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-14T03:36:12.000Z (almost 12 years ago)
- Last Synced: 2024-10-06T03:17:04.489Z (about 1 month ago)
- Language: Ruby
- Size: 113 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
No Change Please
================Given a file `menu.txt` containing:
```
$15.05
mixed fruit,$2.15
french fries,$2.75
side salad,$3.35
hot wings,$3.55
mozzarella sticks,$4.20
sampler plate,$5.80
```This script will try to find a combination of menu items that will result in exact change for the first line.
```
$ script/solve.rb menu.txt
The following combination of items equals $15.05 exactly:
sampler plate,$5.80
hot wings,$3.55
hot wings,$3.55
mixed fruit,$2.15
```#### Legal Stuff ####
Copyright © Bradley Schaefer. MIT License (see LICENSE file).