Git Product home page Git Product logo

2d-bin-packing-with-genetic-algorithm's Introduction

2D Bin Packing with Genetic Algorithm

C# project explain all steps of genetic algorithm on a simple application for 2D bin packing problem

Installation

you should install:

  • visual studio with .net 3.5
  • DataVisualization (Microsoft Chart Controls for Microsoft .NET Framework 3.5) here

Genetic Algorithm Pipeline

Population representation for this problem

Each order of bins/numbers in each chromosome represent one solution/packing for those 2d-bins each number in a chromosome represent 2D-Bin/Rectangle. the optimal solution/chromosome will have the correct order where the cost of fitness function will be minimal ('0' for no wasted space)

Main Form

when you run the project -> File -> choose xml file -> choose one of the examples that you want to pack (you can even draw your own ones - just keep same structure for the xml file)

you can watch the draw of the best solution/order/chromosome in each population from the GridView by clicking over the order you want:

comparison between the effect of mutation and crossover

this will show if running only mutation will find the best chromosome faster than running only crossover and vice versa. this is only a comparison between the implemented mutation & crossover for this problem.

comparison between random initial Generation against initial generation with 'tall/small/big/...' bins first

this will show you that ordering the 2d-bins even simply is much better than keeping them totally random in the initial/first Generation. ordering here means create a chromosome that will have tall bins first, and another chromosome will have small bins first ...

important note:

the reason of why .net 3.5 is because this is an old project that I wrote in 2012. I am sharing it now it might help someone to understand the different steps of genetic algorithm on this specific application.

2d-bin-packing-with-genetic-algorithm's People

Contributors

anas-899 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

2d-bin-packing-with-genetic-algorithm's Issues

Question About Crossover

Hi, I have a question about crossover. What do genes represent? Is it the order of the bins or the bins themselves?
One more question :)
Is it really random when initializing the population or is there a rule for bin sorting?
Have a nice day from Turkey :D

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.