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 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.

Files for knapsack, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size knapsack-0.0.5-py3-none-any.whl (1.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size knapsack-0.0.5.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page