Code Monkey home page Code Monkey logo

turner-tech / genetic-algorithms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiecodes/genetic-algorithms

0.0 0.0 0.0 13 KB

This repository belongs to the youtube videos "What are Genetic Algorithms" (https://youtu.be/uQj5UNhCPuo) and "Genetic Algorithm from Scratch in Python" (https://youtu.be/nhT56blfRpE). If you haven't seen it, please consider watching part one of this series, to get a better understanding of this code.

License: MIT License

Python 100.00%

genetic-algorithms's Introduction

Genetic Algorithms

Hello. Thank you for being here. This repository belongs to the youtube videos What are Genetic Algorithms and Genetic Algorithm from Scratch in Python. If you haven't seen it, please consider watching part one of this series, to get a better understanding of this code.

What are Genetic Algorithms

Content

This repository contains the codebase I used to do the comparison between the stupid brute-force attempt to solve the Knapsack problem and the implementation of the genetic algorithms.

The codebase is structured into three modules: algorithms, problems, and utils.

Inside of algorithms you find the implementation of the brute-force approach and the non-problem-specific parts of the implementation of the genetic algorithm.

problems contains all problem-specific parts related to the Knapsack problems, like the definition of Things and the problem specific fitness function for the genetic algorithm.

utils simply contains a utility function I wrote myself to measure time using a context manager. (https://book.pythontips.com/en/latest/context_managers.html)

genetic_algo.py uses the brute-force approach to find the best solution for a given Knapsack problem and tries to find the same solution using the genetic algorithm and compares the performance.

bruteforce_time.py and genetic_time.py compare the needed time a brute-force or genetic algorithm needs for a given number of items. (Be careful the brute-force approach gets slow very fast.)

Contribution

Corrections and additions to the documentation to help fellow learners are always welcome.

genetic-algorithms's People

Contributors

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