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.1.1.tar.gz (5.4 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.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: knapsack-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for knapsack-0.1.1.tar.gz
Algorithm Hash digest
SHA256 816930e06a19880c50edba40b168112bcb0b32404e1684122b03ad86555bac58
MD5 44ce3effd7040a441268b54101203456
BLAKE2b-256 857af3335c991dfca892fe121363581e530af9636b3253ea17b15447d8622634

See more details on using hashes here.

File details

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

File metadata

  • Download URL: knapsack-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for knapsack-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75eab1af005cb0cf617d10f0107ce5fd0f0725d68a672a46a838639d00ba7f3f
MD5 4c90caafaa8dc3328c8bb88896def0fe
BLAKE2b-256 0224d806f66630bd682996b03e420b7a33e6489cbb7aa6d0a3768c10fa204c3a

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