Skip to content

SaitoTsutomu/knapsack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knapsack is a package for solving knapsack problem.

  • Maximize sum of selected weight.
  • Sum of selected size is less than capacity.
  • Algorithm: Dynamic Optimization

Usage

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

Setup

$ pip install knapsack

History

  • 0.0.1 (2015-6-26): first release

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages