`knapsack` is a package for for solving knapsack problem.
Project description
knapsack is a package for solving knapsack problem.
- Maximize sum of selected weight.
- Sum of selected size is les than capacity.
- Algorithm: Dynamic Optimization
Usage
import knapsack
size = [21, 11, 15, 9, 34, 25, 41, 52]
weight = [22, 12, 16, 10, 35, 26, 42, 53]
capacity = 100
knapsack.knapsack(size, weight).solve(capacity)
See also https://pypi.org/project/ortoolpy/
Requirements
- Python 3
Setup
$ pip install knapsack
History
- 0.0.1 (2015-6-26): first release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knapsack-0.3.0-py3-none-any.whl.
File metadata
- Download URL: knapsack-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba4d6928414321f5ca6bb130edf3486e61e5f8f69125321b0b1bfe7ddc46b55
|
|
| MD5 |
f8af3620c8e8934a203f1cf7f1472a96
|
|
| BLAKE2b-256 |
1b57897826aafc9086696b804bb7f73d0b524f9314845b3e1618563a5e91d501
|