endygamedev / dynamic-programming

:snake: Python module written in C that solves favorites dynamic programming problems.

Home Page:https://endygamedev.github.io/dynamic-programming/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

«Favorites dynamic programming problems»

Contributors

A module for Python in C that solves some dynamic programming problems.

parrot Table of content
  1. Algorithms
  2. Module
  3. Contributors
  4. License

Algorithms

The selected tasks are the following tasks.

1. 0–1 Knapsack problem
Short description

In the 0–1 Knapsack problem, we are given a set of items, each with a weight and a value, and we need to determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.

View full on Wiki
2. Rod Cutting Problem
Short description

Given a rod of length n and a list of prices of rods of length i, where 1 <= i <= n, find the optimal way to cut the rod into smaller rods to maximize profit.

View full on Wiki
3. Coin Change Problem
Short description

Given an unlimited supply of coins of given denominations, find the total number of distinct ways to get the desired change.

View full on Wiki
4. Coin Change-Making Problem
Short description

Given an unlimited supply of coins of given denominations, find the minimum number of coins required to get the desired change. That is, you need to find the minimum number of coins to exchange and withdraw this set.

View full on Wiki
5. The Levenshtein Distance Problem
Short description

Edit distance is a way of quantifying how different two strings are from one another by counting the minimum number of operations required to transform one string into the other.

View full on Wiki
6. Matrix Chain Multiplication Problem
Short description

Matrix chain multiplication is an optimization problem concerning the most efficient way to multiply a given sequence of matrices. The problem is not actually to perform the multiplications, but merely to decide the sequence of the matrix multiplications involved.

View full on Wiki
7. Minimum Cost to Reach Last Cell of Matrix From Its First Cell Problem
Short description

Given an M × N matrix where each cell has a cost associated with it, find the minimum cost to reach the last cell (M-1, N-1) of the matrix from its first cell (0, 0). We can only move one unit right or one unit down from any cell, i.e., from cell (i, j), we can move to (i, j+1) or (i+1, j).

View full on Wiki
8. Const Cost to Reach Last Cell of Matrix From Its First Cell Problem
Short description

Find the number of paths of a given cost from the upper left to the lower right element of the matrices.

9. Minimum Sum Partition Problem
Short description

Given a set of positive integers S, partition set S into two subsets, S1 and S2, such that the difference between the sum of elements in S1 and the sum of elements in S2 is minimized.

View full on Wiki
10. Find All N-digit Binary Strings Without Any Consecutive 1's Problem
Short description

Given a positive integer n, count all n–digit binary strings without any consecutive 1's.

View full on Wiki

Module

The task is decomposed into three modules:

  1. Change-Making Problem
  2. Knapsack Problem
  3. FDPP (other problems)

Install

$ ./run

And also you can instant test installed packages

Usage

import fdpp
import knapsack
import change_making

Contributors

egor bronnikov parrot Egor Bronnikov
roman postolnik parrot Roman Postolnik

License

dynamic-programming provided under the terms of the GPL-3.0 license. See the LICENSE files for details.

Creative Commons License


⬆️ Back to top ⬆️


👨‍💻 endygamedev

About

:snake: Python module written in C that solves favorites dynamic programming problems.

https://endygamedev.github.io/dynamic-programming/

License:GNU General Public License v3.0


Languages

Language:C 91.0%Language:Python 8.4%Language:Shell 0.6%