Giter Site home page Giter Site logo

pratikgl / knapsack Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.01 MB

A genetic algorithm (Local search) approach to solve the 0/1 Knapsack Problem.

License: MIT License

C++ 100.00%
knapsack-problem-genetic local-search artificial-intelligence genetic-algorithm

knapsack's Introduction

KnapSack

A genetic algorithm (Local search) approach to solve the 0/1 Knapsack Problem.

The genetic algorithm is implemented in the header file utility.hpp. The program after solving Knapsack using genetic algorithm compares the result with the optimal answer calculated using dynamic programming. This dynamic programming algorithm is implemented in dp.hpp.

Installation

  1. Clone the whole repo on your local machine using
git clone https://github.com/pratikgl/KnapSack.git
  1. The project is tested on g++ (GCC) 9.3.0. Check your GCC version using
g++ --version
  1. Compile main.cpp
g++ -o KnapSack.exe main.cpp
  1. Run the compiled program
./KnapSack.exe

Contributing

The implementation is simple and straightforward. However, the efficiency of the implementation can be improved. Please feel free to contribute.

License

MIT

knapsack's People

Contributors

pratikgl avatar

Stargazers

 avatar  avatar

Watchers

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