Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [genetic-algorithm]

A genetic algorithm is an optimization heuristic that is inspired by the principles that drive natural evolution: mutation, recombination and selection. In comparison to traditional search methods such as hill-climbing, genetic algorithms have the ability to escape from local minima/maxima.

3
votes
2answers
64 views

Binary genetic programming image classifier's fitness function

I am trying to figure out how to improve my binary image genetic programming classifier's fitness. It takes images and classifies them if it has some feature X or not in it. These are the main ...
4
votes
2answers
127 views

Portrait Painting Genetic Algorithm

Inspired by this article. I've been trying to learn more C# and OOP. Here is my take on a genetic algorithm as described in the article. Here are some of the results flower jelly lighthouse beach ...
3
votes
0answers
31 views

Implementation of merge sort that takes sublinear extra space

I implemented an algorithm that takes only sublinear extra space as required in the exercise description: Develop a merge implementation that reduces the extra space requirement to max(M, N/M). (...
2
votes
2answers
90 views

Genetic Algorithm - heavy memory usage

I have implemented two pieces of code as part of an Evolutionary Algorithm study: Particle Swarm Optimisation (PSO) and Genetic Algorithm (GA). Both are designed to find an optimal solution to a ...
2
votes
1answer
131 views

Genetic algorithm fitness function for scheduling

For Job shop scheduling, I built a fitness function: ...
4
votes
1answer
976 views

Travelling salesman problem using genetic algorithm in C++

I have implemented travelling salesman problem using genetic algorithm. Since project is not so small I will give short introduction. GeneticAlgorithmParameters - ...
11
votes
1answer
695 views

Genetic algorithm to guess password

I was writing a Python script that starts with a random string and then using Genetic Algorithm tries to find the target string. Although I have successfully implemented the algorithm but it's taking ...
8
votes
2answers
2k views

Genetic algorithm for Traveling Salesman

I have implemented a genetic algorithm in python 3 for a programming assignment, and I think all the logic is correct. A friend of mine has also implemented one which carries out similar logic, ...
3
votes
1answer
509 views

C++ Genetic algorithm with templates

This is a genetic algorithm I made. Currently, it seems to be flexible enough for my purposes. Since I am quite new to c++, I'd like to know what you think. I am uncertain about several things and ...
2
votes
1answer
63 views

An open-source library for creating genetic algorithms

My code denotes an open source library that makes creating genetic algorithms easier. It's an encapsulated library and is called using the new constructor. ...
8
votes
1answer
538 views

Genetic algorithm for playing Tetris

Readme.md Tetris In my quest to building a Tetris game, where you can challenge an AI, I have created and trained an AI that plays Tetris all by himself. Github link I think the easiest way to run ...
7
votes
3answers
142 views

Python methods to reduce running times KTNS algorithm

I have been trying to develop an algorithm called keep the tool needed soonest (for more information about the KTNS explanation (page 3)) but during the simulations, I have realized that it takes too ...
4
votes
0answers
64 views

Macro that allows for Linear Problem notation to create Genetic Algorithm fitness functions

As a side toy project for my Genetic Algorithm, I decided to try to create a macro that lets you use maximize: ... subject to: ... linear problem notation to ...
3
votes
1answer
89 views

A running gene crossover function for a Genetic Algorithm

I'm writing a Genetic Algorithm, and need to write a function that crosses two gene sequences. Basically, I want it to work like this: ...
4
votes
1answer
269 views

Genetic algorithm to find the minimum of a three-variable function

I've implemented a simple genetic algorithm for continuous floating point parameter spaces and without recombination. However, the way I'm passing in parameters and acquiring results from ...
1
vote
1answer
71 views

Design of genetic algorithm which would allow TDD

I'm implementing genetic algorithm in Java and I want to learn TDD with this project. Currently I have this code: ...
7
votes
1answer
652 views

Genetic Algorithm for N-queens is very slow

Using Genetic Algorithm to solve N-Queens problem where N=22. My program is functional and is capable of solving N-Queen problems up to around where N=15, but everything after that is absurdly slow. ...
2
votes
0answers
59 views

Genetic operators in Haskell

I have implemented two genetic operators, which is really just a fancy way of mangling lists. In particular OX-1 (illustration) and displacement mutation. I found it necessary to extract out the ...
3
votes
2answers
5k views

Traveling Salesman Problem genetic algorithm

This is my take on this problem. I don't pre determine the distances, it's not suitable for the application I'll use it for. I'll use it in shool to determine some a mean total distance and how to ...
3
votes
1answer
182 views

Agar.io-like game

I've created a game (basically an Agar.io clone), where a human player is placed against AI controlled bots powered by a genetic algorithm and neural networks. The problem is that I think that my ...
3
votes
2answers
599 views

Python genetic algorithm

I haven't done any research into how you actually write a genetic algorithm, so this is my best guess. What I'm really curious to know is two-fold: Have I created a genetic algorithm? If I have, how ...
3
votes
2answers
2k views

Genetic algorithm implementation

Is this the best way to implement a genetic algorithm framework? I'm just a student and wanted to know if I can improve the code that I have done. Some of the code I copied from the framework ...
1
vote
0answers
842 views

Genetic algorithm in Java

I am working on a genetic algorithm using the following code. The variable best in generateNewPopulation stores the best ...
1
vote
1answer
66 views

Haskell Non-Dominated sorting

This algorithm sorts a list of Individuals, each with two fitness values, into what's called non-dominated fronts. A non-dominated front is a set of individuals where none of the individuals dominate ...
7
votes
1answer
561 views

Genetic algorithm to find the maximum binary number of a given length

I have written some codes in java implementing simplest genetic algorithm. The code finds (or rather tries to) the maximum value possible for a user-defined number of bits. For example, for 16 bit ...
2
votes
1answer
79 views

Performance optimization when switching from nested to flat representation (genetic algorithm)

The code below is the core of a Genetic Algorithm (NSGA-II to be precise, without crowding-distance calculation), but I've taken out all the GA-specific parts and made a generic example. I think I've ...
6
votes
1answer
496 views

Genetic algorithm to arrange rooms in a house

I am an architecture thesis student in my final year and I am developing a piece of software that, ideally, should design houses for me based on certain input. I got the program to work when it was ...
3
votes
1answer
270 views

Hash Matrix performs Gaussian elimination

This is the Hash-Matrix that I used in order to process the matrix for my quadratic sieve algorithm. You can find the full code at here(it's java 7), but I only want you to review this class. My ...
7
votes
1answer
2k views

Travelling Salesman problem using GA, mutation, and crossover

I created a short python program that can create a list of random unique nodes with a given length and a given number of strategies. The GA runs through a given number of generations, changing a ...
3
votes
1answer
101 views

Evolutionary algorithm to optimize the range of a glider

I created an evolutionary algorithm that optimises the range of a "glider"...ignore the accuracy of the physics behind the problem! Any comments on how to improve the algorithm/my coding style would ...
5
votes
1answer
115 views

Alberi creator. Keepalive

This post is a follow-follow-up to this post and its follow-up. In those two posts we managed to speed-up the solution of an Alberi puzzle, and to create a one-tree-per-region puzzle. The complete ...
1
vote
1answer
10k views

Genetic algorithm to fill timetable for school

I wrote a program to fill a timetable for a school. There are some simple rules: Each subject has a preset number of blocks (blocks are 2 hour periods). Professor provide a valid hours they have to ...
2
votes
2answers
399 views

PMX crossover implementation in Clojure

I'm starting to learn Clojure and as an exercise I've implemented the following functions (written in Java) in Clojure: ...
3
votes
3answers
1k views

Genetic search algorithm for TSP

I made a genetic search algorithm in Python for the Travelling Salesman Problem for a midterm project. The grade was fine, but I was hoping to get some pointers on style and documentation. Please ...
1
vote
1answer
1k views

Neural Net XOR Genetic Algorithms

New to Neural Networks and before I move on to gradient descent I would like to make sure I have got basic idea right. (Sorry that the class is called perceptron I know that this isnt technically ...
1
vote
1answer
141 views

Genetic algorithm final stage

I have written the code for a genetic algorithm and have the crossover function, mutation function, parent selector function and a function to transfer genes. Now I want to put it all together and ...
4
votes
3answers
105 views

Genetic Drift Simulator - Follow Up

This question is a follow-up of a previous question of mine: Genetic Drift Simulator. Following the advice given in the last question, and some more general improvements, the code has been slimmed ...
2
votes
2answers
438 views

Genetic Drift simulator

Genetic drift — along with natural selection, mutation, and migration — is one of the basic mechanisms of evolution. In each generation, some individuals may, just by chance, leave behind a few ...
11
votes
1answer
2k views

Backpropagating with Neural Network

I wrote a Java program implementing a neural network with backpropagation. For anyone who isn't familiar with Neural Networks and Backpropagation, here is a good resource. Here is another ...
3
votes
1answer
4k views

Genetic Algorithm for TSP

This is something that I am proud of and would like to have people dissect and tell me where my faults are in. I feel that if I open my best for criticism then maybe it will reveal the deep seeded bad ...
2
votes
2answers
182 views

Genetic algorithm for solving a puzzle (v. 2)

Thanks to your wonderful comments regarding the first version of my code, I have been able to improve it. This new version is more readable (I guess). The problem is that it seems to me that there is ...
8
votes
3answers
2k views

Genetic algorithm for solving a puzzle

Edit. Version 2. I am working on a genetic algorithm in order to solve a little "puzzle." Given a text file with N rows with 4 int each, the idea is to ...
2
votes
2answers
1k views

Image similarity measure

I'm attempting to speed up my genetic algorithm that modifies images. After searching, I've found that my fitness function is the bottleneck, taking sometimes up to ...
20
votes
2answers
1k views

Genetic algorithm for “Hello World”

This programme uses a genetic algorithm to get the string "Hello, World!". It can be summarized as follows: Create a random initial population. Let the best ...
24
votes
2answers
632 views

Where equations are born and mutants are buried

I've read up on genetic programming yesterday so I figured I'd try to implement something myself. I would like the main focus to be on whether or not I've implemented the idea behind it correctly. ...
11
votes
1answer
795 views

Genetic algorithm for “Hello World”

I've written an Erlang implementation of the genetic algorithm for a "Hello World" program as described here. This is my first time writing any code in Erlang and also my first time writing code in a ...
5
votes
2answers
2k views

Genetic algorithm in Python that plots its evolution

After programming in Haskell for a while, I've gotten attached to a functional style. This is clearly evident in the code for my genetic algorithm. Could you provide me with some hints as to how I ...
17
votes
4answers
1k views

Genetic algorithm for Clever Algorithms project

I wrote a bunch of Ruby code for a book project I've just finished. One criticism is that it is fine code but not very "ruby like". I agree my style was simplified for communication reasons, and ...