Giter Site home page Giter Site logo

olenerollie924 / knapsack_algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tamilselvanarjun/knapsack_algorithm

0.0 0.0 0.0 76 KB

A simple implementation of the Knapsack problem using dynamic programming.

Home Page: https://pypi.org/project/knapsack-algorithm/

Python 100.00%

knapsack_algorithm's Introduction

Knapsack Algorithm

knapsack_algorithm is a Python package that provides a simple and efficient solution for the 0/1 knapsack problem.

Features

  • Dynamic Programming Solution: Utilizes dynamic programming to solve the 0/1 knapsack problem efficiently.
  • Error Handling: Provides comprehensive error handling for input validation.
  • Easy to Use: Offers a user-friendly interface for solving knapsack problems with given values, weights, and capacity.

Installation:

You can install KnapsackAlgorithm using pip:

pip install knapsack_algorithm

Usage:

Here's an example of how you can use knapsack_algorithm:

from knapsack_algorithm import knapsack

Documentation

For detailed documentation and additional options, refer to the official documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

If you would like to contribute or report issues, please check our contribution guidelines.

Example usage:

values = [60, 100, 120]  # The values of the items

weights = [10, 20, 30]  # The weights of the items

capacity = 50  # The maximum capacity

result = knapsack(values, weights, capacity)

if result is not None:

      print("Maximum value in the knapsack:", result)

knapsack_algorithm's People

Contributors

tamilselvanarjun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.