Knapsack Algorithm
knapsack_algorithm is a Python package that provides a simple and efficient solution for the 0/1 knapsack problem.
Features
- Dynamic Programming Solution: Utilizes dynamic programming to solve the 0/1 knapsack problem efficiently.
- Error Handling: Provides comprehensive error handling for input validation.
- Easy to Use: Offers a user-friendly interface for solving knapsack problems with given values, weights, and capacity.
Installation:
You can install KnapsackAlgorithm using pip:
pip install knapsack_algorithm
Usage:
Here's an example of how you can use knapsack_algorithm:
from knapsack_algorithm import knapsack
Documentation
For detailed documentation and additional options, refer to the official documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
If you would like to contribute or report issues, please check our contribution guidelines.
Example usage:
values = [60, 100, 120] # The values of the items
weights = [10, 20, 30] # The weights of the items
capacity = 50 # The maximum capacity
result = knapsack(values, weights, capacity)
if result is not None:
print("Maximum value in the knapsack:", result)
Metadata
Release files for knapsack-algorithm 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| knapsack_algorithm-1.0.0.tar.gz | 1.8 kB | Without provenance | Details for knapsack_algorithm-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| knapsack_algorithm-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for knapsack_algorithm-1.0.0-py3-none-any.whl |
Total release size: 3.7 kB
Release files / knapsack_algorithm-1.0.0.tar.gz
| Download URL | knapsack_algorithm-1.0.0.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce517c28619623500911c55b997cd7241b6a12a393a9f4468fa03ecfb4ea61b4
|
|
BLAKE2b-256 checksum How to use checksums |
e0b7330687c8e19f0b013f11e7c84a917b6b13fed91ffa319fbc83c7f1da03e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.4
|
Release files / knapsack_algorithm-1.0.0-py3-none-any.whl
| Download URL | knapsack_algorithm-1.0.0-py3-none-any.whl |
|---|---|
| Size | 1.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f16b9cd106708d43c7da4a619ef41946dfb3fd065e18aa9edc2e0ad84ffb095
|
|
BLAKE2b-256 checksum How to use checksums |
85dd655484c326e0107cdf5683c1ec4a4e184b35b8eb7b41d12c680cb51f68d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.4
|
Security for knapsack-algorithm 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.