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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

knapsack-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: knapsack-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.6 Darwin/23.1.0

File hashes

Hashes for knapsack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa8be2ed0bde0a787c6d01a90fb5dbfc81bffc80802241f73e49e6ea39c070b
MD5 11c9f277016b2ac8be0d25d2d0c32e7f
BLAKE2b-256 54946233232c0e909857840781ab79bff27e7390887b38b04722e72a3f5e2ea8

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