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.2.zip (3.6 kB view details)

Uploaded Source

File details

Details for the file knapsack-0.0.2.zip.

File metadata

  • Download URL: knapsack-0.0.2.zip
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for knapsack-0.0.2.zip
Algorithm Hash digest
SHA256 232614b87107f282a2a65c5f53e01e538cf86f11715a0fed74ce74cc3497c586
MD5 217c6f8e71e33dfb1c37c1143ea7087f
BLAKE2b-256 7ec2de03513bb7bc6d79d03ccf7192de5ae2457ea7375d787192b36c50f489cb

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