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.

Filter by
Sorted by
Tagged with
4 votes
2 answers
471 views

Solving The Travelling Salesman Problem Using Genetic Algorithm

I was looking to learn about AI and found the traveling salesman problem very interesting. I also wanted to learn about genetic algorithms, so it was a fantastic combo. To clarify, this is my second ...
zellez's user avatar
  • 47
2 votes
2 answers
76 views

Slow Bioinformatics algorithm - Clump finding algorithm in Haskell

I'm working on the famous clump finding problem to learn Haskell. Part of the problem involve breaking nucleotide sequences, called kmers, into subsequences as follows: ...
plaffont's user avatar
2 votes
1 answer
158 views

An evolutionary algorithm written in Java to crack an XOR cipher

Alright. So TryHackme is a website that tries to teach hacking with hands on labs. They have a room called JVM Reverse Engineering where the user gets to reverse engineer Java apps, and in particular ...
Aleksey's user avatar
  • 153
0 votes
1 answer
74 views

Optimization using a differential evolution technique, ideally with a million iterations

I'm working on an optimization code using differential evolution to solve. However, it is taking a long time to get the solution. See that I have a variable called number_of_iterations that must equal ...
krisllen's user avatar
2 votes
2 answers
151 views

Much more efficient trisexual genetic algorithm for TSP in Java

(The entire project lives there.) This time, I have made the previous version of the GA for TSP run faster by around the factor of 6+. The idea is to cache the tour costs with the actual tour objects ...
coderodde's user avatar
  • 27k
2 votes
0 answers
64 views

Genetic trisexual algorithm for TSP in Java [duplicate]

(A more efficient version of the GA.) This is my the very first take ever on GA: GeneticTSPSolverV1.java: ...
coderodde's user avatar
  • 27k
1 vote
1 answer
89 views

Genetic TSP in Java with graph expansion

This post presents my take on TSP (travelling salesman problem). The idea is to: Take an input node i, Compute the entire graph ...
coderodde's user avatar
  • 27k
1 vote
0 answers
675 views

Solving the Knapsack Problem With a Genetic Algorithm Simulation in Python

I was watching Computerphile's video on using genetic algorithms to solve the Knapsack problem, and I decided to give it a whack. For anyone running the code, the ...
Jose Fernando Lopez Fernandez's user avatar
2 votes
0 answers
38 views

AI learning to drive (simplistic) needing optimisation

So I have done a little program where the goal is trying to teach some cars (red and blue rectangles) to "drive" through genetic algorithm. It works well and I haven't seen any bugs, but the ...
Clement Genninasca's user avatar
2 votes
0 answers
99 views

Giffler Thompson Algorithm for decoding individuals of a Genetic Algorithm

First of all: Hi, my name is Henrik and I am a mechanical engineer, who loves to code in his free time. To get better in programming I wrote a genetic algorithm compined with a list planning algorithm ...
HenrikTe's user avatar
1 vote
1 answer
232 views

Crossover in eight queens

I used uniform crossover to solve eight queens problem. It is taking more than an hour to get the result. Is there any way to reduce the running time or improve the crossover to solve eight queens ...
Chandan's user avatar
  • 11
8 votes
1 answer
1k views

Genetic algorithm to guess coefficient of a polynomial

I have tried to code a genetic algorithm to guess the coefficients of a degree 4 polynomial. The information initially provided is values of y = f(x) for different x using the original polynomial. I ...
Roni Saiba's user avatar
4 votes
1 answer
248 views

Python Genetic Algorithm Implementation

I've made this to pick the LQR parameters for my self balancing robots simulation. So to break down what I have done, Randomly Create Population I create a random population. The population is a list ...
AfiJaabb's user avatar
  • 141
5 votes
2 answers
104 views

Route finding Genetic Algorithm

In order to get more accustomed with classes in Python, I have written a genetic algorithm, which takes a level with a start and end point and searches for a route (not necessarily the optimal one). ...
p.vitzliputzli's user avatar
7 votes
3 answers
235 views

Genetic Programming - Pathfinding not enougth couples

I do genetic programming. I have 5 parcours, the first on the left is the easiest parcour. The first parcour can be solved by place one belt in the middle pointing downwards to solve the problem. If ...
Grim's user avatar
  • 520
2 votes
1 answer
246 views

Crossover and Mutation functions for Genetic Algorithm

I'm writing a decryption algorithm using GA with crossover and mutation. My performance is (very) poor, often stagnating early or converging to the incorrect solution. I just want some other people to ...
gator's user avatar
  • 455
8 votes
2 answers
342 views

An Algorithm Which Schedules Your Life

An Algorithm For Scheduling Your Time There is a strong body of research in cognitive science which has large implications for how best to plan your day to get the most out of it. However, it isn't ...
John Salter's user avatar
2 votes
1 answer
2k views

Simple Genetic Algorithm in Python

For past few months I was trying to understand genetic algorithms (GA) and most of the materials availble in the web was not always easy for me. Then I came across this article written by Ahmed Gad ...
Eka's user avatar
  • 349
3 votes
0 answers
163 views

Simplified Smart Rockets using Genetic Algorithm

This is a very bare bones program where a population of blocks learn to reach a target on a 2d screen (My attempt at making a smart rockets program) I've only used python for 2 weeks so i'm positive ...
Alex's user avatar
  • 31
4 votes
2 answers
114 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 ...
Gabriele's user avatar
  • 155
5 votes
2 answers
300 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 ...
jreese's user avatar
  • 63
3 votes
0 answers
91 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). (...
Lerner Zhang's user avatar
2 votes
2 answers
249 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 ...
McGuile's user avatar
  • 153
2 votes
1 answer
412 views

Genetic algorithm fitness function for scheduling

For Job shop scheduling, I built a fitness function: ...
Khái Duy's user avatar
4 votes
1 answer
3k 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 - ...
Newbie's user avatar
  • 700
11 votes
1 answer
2k 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 ...
Sourabh Khandelwal's user avatar
8 votes
2 answers
3k 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, ...
Luke Collins's user avatar
3 votes
1 answer
2k 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 ...
zalavari's user avatar
  • 131
2 votes
1 answer
301 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. ...
faroukcharkas's user avatar
8 votes
1 answer
2k 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 ...
Ludisposed's user avatar
  • 11.5k
7 votes
3 answers
176 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 ...
A.Piquer's user avatar
  • 185
4 votes
0 answers
85 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 ...
Carcigenicate's user avatar
3 votes
1 answer
106 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: ...
Carcigenicate's user avatar
3 votes
1 answer
500 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 ...
Seanny123's user avatar
  • 1,527
1 vote
1 answer
84 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: ...
Jump3r's user avatar
  • 175
7 votes
1 answer
1k 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. ...
Oscar's user avatar
  • 71
2 votes
0 answers
72 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 ...
tsorn's user avatar
  • 285
3 votes
2 answers
7k 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 ...
Simon's user avatar
  • 1,012
3 votes
1 answer
280 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 ...
Jaden Wang's user avatar
3 votes
2 answers
701 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 ...
Colton Allen's user avatar
3 votes
2 answers
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 ...
Angelo Bastos's user avatar
1 vote
0 answers
1k views

Genetic algorithm in Java

I am working on a genetic algorithm using the following code. The variable best in generateNewPopulation stores the best ...
Learning's user avatar
1 vote
1 answer
82 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 ...
tsorn's user avatar
  • 285
7 votes
1 answer
791 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 ...
Sнаđошƒаӽ's user avatar
2 votes
1 answer
94 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 ...
tsorn's user avatar
  • 285
5 votes
1 answer
589 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 ...
asibahi's user avatar
  • 927
2 votes
1 answer
297 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 ...
Ilya Gazman's user avatar
7 votes
1 answer
3k 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 ...
WaterlessStraw's user avatar
3 votes
1 answer
117 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 ...
soarjay's user avatar
  • 227
5 votes
1 answer
135 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 ...
N74's user avatar
  • 513