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)

Requirements

  • Python 2 or Python 3

Features

  • nothing

Setup

$ pip install knapsack
or
$ easy_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.4.tar.gz (1.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: knapsack-0.0.4.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for knapsack-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7eb6135a7274015145b5d6a3245b7c3b56a66381714fde913aef985b7e25ba17
MD5 8770d31b7f83be5cab6031df97b6615f
BLAKE2b-256 038bc86c677ffbaa2738843f3d7ab4dcf085d72fd413d699543072d1a2d1cd80

See more details on using hashes here.

Supported by

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