Questions tagged [genetic-algorithm]
A genetic algorithm (GA) is a search heuristic that mimics the process of natural evolution.
2,079
questions
0
votes
0
answers
17
views
My genetic algorithm doesn't find the minimum of the Schwefel function. Could you please tell me why?
I'm supposed to make my own genetic algorithm to find the minimum of the Schwefel function in matlab.
I did my best but I'm not the sharpest pencil in the pencil case. My tutor said that he doesn't ...
-2
votes
0
answers
49
views
Genetic algorithm to maximize result of a function
I have a function F(a, b, c, d) = X , a b c and d being parameters with the following constraints:
5 < a < 200
1 < b < 100
c > 0.05
1 < d < 1000.
Function F is using the ...
1
vote
0
answers
12
views
How can I change Value of Bounds during evolution in a genetic algorithm by DEAP implementation?
def checkBounds(min, max):
def decorator(func):
def wrapper(*args, **kargs):
offspring = func(*args, **kargs)
for child in offspring:
for i in range(len(child)):
...
0
votes
0
answers
41
views
How do i fix this error IndexError: index 30 is out of bounds for axis 1 with size 30?
I am trying to carry out feature selection on the Winscosin breast cancer dataset from Kaggle. The dataset has 32 colunms. I removed the iD column and i have 31 colunms left. Counting from 1. The ...
-2
votes
1
answer
27
views
Genetic Algorithm for Decision Trees
I made a natural selection simulator in pygame where there are ten characters that each take in sensor inputs that are fed into a decision tree (with randomly initialized nodes) and tell them to ...
-2
votes
0
answers
18
views
Using GA algorithm to find optimal hyperparameters in a binary classification problem
Is it possible to use a genetic algorithm to find optimal hyperparameters for e.g. neural networks in a binary classification problem? What should the example code look like for the Iris dataset?
0
votes
0
answers
14
views
Jupyter kernel keeps dying after some time
I'm currently trying to implement a genetic algorithm that works with Decision Trees in order to make an AI play a game of Geometry Dash.
I made a function to combine trees (see below) that seems to ...
0
votes
1
answer
55
views
Solving Knapsack Problem for large dataset using PULP library in Python
I have the below dataframe:
import itertools
import pandas as pd
import numpy as np
p1_values = np.arange(19, 29.1, 0.1)
p2_values = np.arange(23, 33.1, 0.1)
p3_values = np.arange(36, 46.1, 0.1)
...
0
votes
0
answers
8
views
LIBSVM-can't reture the scalar(cross-validation accuracy)
I'm using LIBSVM in Matlab for classification. By adding '-v'(cross-validation) in cmd to get the accuracy value, it returns a struct data. Is any problem with my code?
cmd = ['-t 2', ' -c ', num2str(...
0
votes
0
answers
20
views
Mutation Error and Crossover Error not working properly
library(GA)
# Define the problem
set.seed(123)
assets <- c("Asset 1", "Asset 2", "Asset 3", "Asset 4", "Asset 5", "Asset 6", "Asset ...
-2
votes
0
answers
38
views
Uniform Crossover In Genetic Algorithm
I'm confused by the crossover rate and the probability that are used in uniform crossover. Is it the same? Can you please cite a paper or articles because I just cannot find any reference that talks ...
0
votes
1
answer
44
views
Fitness function in a Genetic Algorithm in Python
I'm trying to code a proper fitness function for a problem that we've choose to solve with a GA.
The problem consists in identifying the start dates of production for different items and minimize the ...
0
votes
1
answer
86
views
Genetic algorithm (n-queens problem) in MATLAB is stuck
I need to solve the n-queens problem in MATLAB and I have tried with the code attached below.
The problem that I have is that, at some point of the simulation the "checks" of the populations ...
0
votes
0
answers
12
views
How to output the of the Genetic algorithm for RSU Deployment in python
actually i have developped a genetic algorithm for RSU(road side unit) deployment using python. i took the map from OSM converted to .net.xml and used in python. but after the algorithm execussion i ...
0
votes
0
answers
32
views
DEAP Genetic Algorithm to solve my particular timetable problem
I would like to use DEAP to solve my timetable problem.
I have the following parameters:
n teachers (around 15)
m rooms where teachers (around 8) teach some lessons
8 hours per day / 5 days per week ...
0
votes
0
answers
22
views
is there any algorithm for finding the target genes of some motifs based on the motifs sequences?
I have an issue and till now I could not find any directions regarding that.
I have the position of my ChIP-Seq peaks in the BED format (fig2) and I found some motifs related to them by HOMER. As you ...
0
votes
0
answers
14
views
How to produce Contigs?
Good day,
I've been trying to produce contigs out or read and read-pairs(could be both simultaneously) but I can't figure out how to make contigs.
0
votes
1
answer
22
views
How do I use a Genome (string) to generate a Body (tree) that will then be controlled by a Brain (neural network) in Unity?
My Scenario
I have a rather large project I'm working on in Unity involving genetic algorithms and neural networks. I am just getting started and need help with my initial implementation. I am not yet ...
0
votes
0
answers
20
views
Why is the velocity at my G.A. getting slower after the first try?
I'm doing a Genetic algorithm and it looked fine until I tested it. What is happening is, after the first and initial try, the take-off velocity gets slower.
In the first try, right after I call the ...
0
votes
0
answers
19
views
How to solve a problem with null values in SVM and GA
Unfortunately, I have a problem with my code in R. I am trying to use GA to tune up hyperparameters, but I received null values, so it is impossible to train svm.
Do you have any idea how to solve the ...
1
vote
0
answers
47
views
Genetic Algorithm in R: Specify number of 1s in binary chromosomes
I am using the rbga function, but my question still stands for other genetic algorithm implementations in R. Is there a way to specify the number of 1s in binary chromosomes?
I have the following ...
0
votes
1
answer
37
views
R: Refer to the chromosome in the evaluation function of rbga.bin
I am trying to use the rbga.bin genetic function in R.
I have a dataframe with 40 observations (rows) and 189 metrics (columns). In the evaluation function, I have to run a Principal Component ...
0
votes
0
answers
14
views
How to find minimum value of function from smoof package?
I am using genetic algorithm for finding maximum of Ackley function
lbound <- c(-10, -10)
ubound <- c(10, 10)
m <- makeAckleyFunction(2)
GA <- ga(type = "real-valued", fitness = ...
0
votes
0
answers
23
views
Java Jenetics lib. Fitness progress stops in the first few generations
I am trying to solve a problem using a genetic algorithm:
A gene stores ints approximately in the range of 0 to 500.
The size of one genotype is approximately in the range of 10 to 10000.
This ...
0
votes
1
answer
31
views
My genetic algorithm in last generation not improve fitness score
I write simple genetic algorithm, the code is show below
Fitness function is define as
def fitness(a, b, c, d, e):
return a**2 + b**2 + c**2 + d**2 + e**2
function to generate first population
...
0
votes
0
answers
24
views
NEAT - population number varies every generation
I'm trying to implement my own neat implementation and I can't get myself to understand how speciation works
I tried my best to follow the pesudocode I found in this paper (start of page 13)
but I'm ...
0
votes
1
answer
93
views
Using Google OR-Tools to solve a Vehicle Routing Problem (VRP) for UAVs
I have tried to use OR-Tools to solve a VRP. The problem is that I don't want to find the shortest routes for every vehicle, but the ones that uses the least energy.
Explanation on that: If a vehicle ...
0
votes
0
answers
37
views
Defining a fitness function for the binary problems
I have been trying to define a fitness function that evaluates a method and the buggy version of the method:
import numpy as np
# original method
def divide(a, b):
if b == 0:
raise ...
3
votes
0
answers
64
views
Flappy bird game with AI - Genetics algorithm doesn't work properly
I have a flappy bird game built with p5.js, every bird in my game is a neural network with 4 inputs, 4 hidden nodes, and 1 output.
if the output is bigger than 0.5, the bird should jump.
I use the ...
1
vote
1
answer
28
views
DEAP package for genetic algorithm in pyhton
The DEAP package which is used to execute GA has the below codes and can be found here http://aqibsaeed.github.io/2017-08-11-genetic-algorithm-for-optimizing-rnn/
population_size = 4
num_generations = ...
0
votes
0
answers
27
views
How can I improve my neural network and genetic algorithm?
I have already implemented all parts of race simulation, but it doesn't work as I have planned. I have track and bunch of cars, cars know distance to walls in the direction of the ray.
Image of ...
0
votes
0
answers
27
views
AForge Genetic algorithms for solving expression
For example my expression is 2*x+y^2.
I have to use genetic algorithms to solve it with getting output closest to 0.
I was trying to define a population but I don't know how to start.
Population size ...
0
votes
0
answers
31
views
How to create Chromosomes and Fitness function for this NP-Hard Genetic algorithm problem
Hi i am very new to genetic algorithm and i am stuck with this problem:
A move is provided for a student. He has to store his things in small plastic boxes in a cardboard box with a capacity of 2 ...
0
votes
1
answer
112
views
overlapping in matplotlib plot
I am comparing the execution time of an exhaustive search and genetic algorithm along with sample solutions.
In the graph below, I am trying to improve the readability of my graph. However, they ...
1
vote
2
answers
47
views
Why am I getting a segfault in this genetic algorithm problem?
I'm trying to solve a CodeWars problem called "Training on Binary Genetic Algorithms." There is a fitness function that is preloaded. When the program is run, a test function creates a ...
0
votes
1
answer
65
views
How to optimise a function of binary variables
I have a function f(x1,…,xN), where variables xi take only binary values, xi = 0 or 1. I.e. the input space is a space with Hamming distance as metric.
I want to optimise this function numerically and ...
0
votes
0
answers
14
views
How can I only display the first and last three generations of my GA using deap
I am writing a GA to calculate maximums in a function. Whith the attribute verbose it will display every single generation but I want to only show the fist and last three generations so they can be ...
0
votes
1
answer
26
views
How to put input matrix in function in R (rmoo nsga2)
I am trying to solve a multi-objective problem using nsga2 function in rmoo package of R
However, some errors keep occurring in my code.
"Error in tourLength(x, ...) : argument "data" ...
0
votes
0
answers
15
views
Different rmse value for every run while optimizing Recurrent Neural Network
I am trying to use Genetic Algorithm for optimizing Recurrent Neural Network.
For this I followed the Python codes mentioned here: http://aqibsaeed.github.io/2017-08-11-genetic-algorithm-for-...
0
votes
0
answers
24
views
Objective function for pendulum genetic algorithm
I am looking for help developing an objective function to minimise, to evolve (through genetic algorithm) a control system for this frictionless inverted pendulum (https://www.gymlibrary.dev/...
0
votes
0
answers
19
views
How to go about forwarding inputs through a randomly connected neural network
I saw a youtube video on genetic algorithms by davidrandallmiller and wanted to see if I could code it myself but I'm not sure how to go about doing it
if I generate a bunch of random binary encoded ...
0
votes
0
answers
110
views
Select best individuals from generation with DEAP
I am developing a Genetic Algorithm, and am currently trying to not only to generate offspring, but also to take for the next generation the best individuals from the previous generation.
I am ...
0
votes
0
answers
44
views
Multi Agents in OpenAi gym?
We are planning to do a multi-agents in a openai gym super mario, is it possible to have multiple agents in one level? to see what agent will accomplish (with the mixture of genetic algorithm and deep ...
0
votes
0
answers
18
views
There are 50 courses and 500 students. Ecah student will register 5 course from it. How could I tell if there exsit a time table with no conflict?
I am doing a project that makes a course-table(location and time) for students that minimize their walking distance by using genetic algorithm.
There are 500 students and each of them will register ...
1
vote
0
answers
24
views
Pros and cons of binary representation in a genetic algorithm
I'm solving problem of making teams of players for some game, using genetic algorithm.
Having pool of players to split, I represent individual from population as a row of teams, where each team is ...
3
votes
1
answer
90
views
PyGAD: How to constrain genes to sample set without replacement?
Suppose I have an assignment problem where I need to assign riders to seats. I need to enforce the constraint that at most, one rider is assigned to any given seat and every rider is assigned one seat....
1
vote
0
answers
54
views
Why is my genetic algorithm not improving?
The fitness output is always 0 when my genetic algorithm is training. This should be normal at first but it does this for the entire duration of the training and does not improve at all. I have the ...
0
votes
1
answer
43
views
How to avoid selecting parents 'twice' using Roulette Wheel Selection?
I am working on a genetic algorithm in Python, where I want to use the roulette wheel selection for selecting parents. However, I came to the conclusion that with my current code, it is possible that ...
1
vote
0
answers
31
views
evosuite doesn't generate tests with a different GA
for university purposes i'm trying to extend evosuite.
before i'm tryng to run it first with a different GA, without success.
I'm using evosuite 1.2.1 on ubuntu 12.0.4 and after compile it with maven, ...