Skip to main content

`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

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

Features

  • nothing

Setup

$ pip install knapsack

History

0.0.1 (2015-6-26)

  • first release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knapsack-0.0.6.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knapsack-0.0.6-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file knapsack-0.0.6.tar.gz.

File metadata

  • Download URL: knapsack-0.0.6.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Darwin/19.0.0

File hashes

Hashes for knapsack-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d5004d21c5c834ff2bfc676a05abd487ed5a8cf2c4bf9d41b6749c60d372c75f
MD5 6e5611bb25da6cc8ab11394ec0d8f4ad
BLAKE2b-256 aecb29e0f29e5bc0e50b20db544b6e2e10126c4d27d8e5aa3ff27d5db981c274

See more details on using hashes here.

File details

Details for the file knapsack-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: knapsack-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Darwin/19.0.0

File hashes

Hashes for knapsack-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 70eeefc3f30da14a11677547ac644449cdd8167d37d80abe4e9bd2fd3a048a75
MD5 2be6dea97ad1085f7d35d09f8a01393a
BLAKE2b-256 98aab81fbab9ff556c35e736b37f733e1e2644e80c33f6f289228333d9c21a78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page