Dynalglib is a library which is designed to solve problems using dynamic programming algorithms in Python.
Project description
dynalglib
Dynalglib is a library which is designed to solve problems using dynamic programming algorithms in Python.
Released algorithms:
- Fibonacci
- Knapsack Problem
- Traveling Salesman Problem
- Resource Allocation Problem
- Coin Change Problem
Installing
To install this library you should run:
pip install dynalglib
To update the library you should run:
pip install -U dynalglib
A simple example
from dynalglib import Item
from dynalglib import Knapsack
knapsack = Knapsack(
items=[
Item(name="apple", weight=2, value=3, quantity=6),
Item(name="pineapple", weight=4, value=8, quantity=3),
Item(name="kiwi", weight=3, value=6, quantity=3),
Item(name="strawberry", weight=1, value=7, quantity=8),
],
capacity=10,
)
knapsack.fill()
print(knapsack.total_value)
print(knapsack)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dynalglib-1.3.tar.gz
(8.5 kB
view hashes)
Built Distribution
dynalglib-1.3-py3-none-any.whl
(10.8 kB
view hashes)