2,086 questions
-2
votes
1
answer
56
views
I want to fix a "int' object is not subscriptable" error [closed]
I'm using genetic algorithm for knapsack problem and when I wanted to debug it says : int' object is not subscriptable
it just pointed this 3 spots in the code and in the end it just said this is the ...
0
votes
1
answer
29
views
platypus NSGA-II, Optimal input variable printing issue
I am running into a problem when trying to print the "best" decision variable values based on a certain case (that the one objective is less than 1). I am using the NSGA-II algorithm from ...
1
vote
1
answer
86
views
Why does this Genetic Algorithm give such bad solutions to a TSP?
I coded a Genetic Algorithm in Python using the DEAP library to solve a modified TSP problem, where the evaluation function is:
def evaluate(self, individual: list[int]) -> float:
...
0
votes
0
answers
72
views
Paralellizing a Genetic Algorithm in Python is slower
I've been coding a Genetic Algorithm to solve TSP using python's DEAP library. I've implemented my own Graph class, and an Algorithm class that runs the GA on a Graph instance. However, when adding ...
0
votes
0
answers
35
views
How to calculate neural net for different weights and inputs in parallel in pytorch?
I am working with machine learning using pytorch.
There is some class implementing neural network inherited from nn.Module. Some network structure is implemented.
There are different parameters (...
0
votes
1
answer
132
views
Differential evolution fails when worker argument is added
To set up my differential_evolve curve-fit function, I borrowed heavily from https://bitbucket.org/zunzuncode/ramanspectroscopyfit/src/master/RamanSpectroscopyFit.py. My implemented function works ...
0
votes
0
answers
23
views
Algorithm to find the set of K solutions candidates based on two criteria
The context is the initialization of optimization algorithms (for example, differential evolution), where we generate a random population of vectors that represent the solution's parameters.
We are ...
1
vote
1
answer
150
views
How to specify range of genes in PyGAD for genetic algorithms?
I have an optimization problem with a lot of variables. Let suppose there is just three: car speed (km/h), car weight (tons) and car price ($). Obviously, the range of each variable is different: car ...
2
votes
1
answer
118
views
How to solve genetic algorithm stagnation in the Zen garden problem?
I have a genetic algorithm problem but I'm stuck in local optimum. As you can see in the snippet, it simply can't solve the problem, no matter how many gens or genomes I add to the generation.
Code:
...
0
votes
0
answers
48
views
Genetic Algorithm Implementation – Error in Selection/Mutation/Population Formation Steps
I’m working on a genetic algorithm for an optimization task where I need to compare different parameters across three functions, including:
Crossover: One-point (OT), two-point (DT)
Mutation rates: 0....
2
votes
1
answer
110
views
Genetic algorithm for kubernetes allocation
I am trying to allocate Kubernetes pods to nodes using a genetic algorithm, where each pod is assigned to one node. Below is my implementation:
from string import ascii_lowercase
import numpy as np
...
-1
votes
1
answer
111
views
Genetic Algorithm with constraints on genes
I have a really big (exponential) search space for a problem, and as such i've been attempting to use genetics/evolution to find the approximate best solution, however I'm extremely inexperienced on ...
3
votes
0
answers
102
views
Finding the optimum value of all Decision Variables in a MixedVariable problem with Pymoo
I've successfully built my model and it runs and plots a Pareto front. However, I don't know how to store X* (the optimum value of ALL the decision variables that resulted in the optimum F).
My model ...
0
votes
1
answer
31
views
VISSIM Matlab COM interface optimization problem
I m trying to perform optimisation in MAtlab to obtain the best set of car following parameters of Weidmann 99 model. The code is as follows :function optimize_vissim_params()
% Lower and upper ...
1
vote
2
answers
68
views
Genetic Algorithm - car trajectory
I'm trying to implement Genetic Algorithm to get from point A to point B by car in python. So it's more like a proof of concept.
import sys
import math
import random
POPULATION_SIZE=10
GENE_LENGTH=10 ...
1
vote
0
answers
47
views
Neural Network with Genetic Algorithm Connect4
I have created a program that learns how to play connect4 using a neural network and genetic algorithms.
It starts with random weight neural networks, lets every network play against each of the other ...
1
vote
1
answer
89
views
genetic optimizer using pulp library
Is it possible to solve a linear problem using the pulp library to create decision variables and write fitness functions and penalties using the Pypi genetic algorithm library? I have done this, but ...
3
votes
0
answers
78
views
Problem converging to Pareto optimal front of DLTZ1 with NSGA-II implementation
I'm trying to implement the NSGA-II to solve multi objective optimization problems, I think my implementation is correct but it is very unstable, DLTZ1 is supposed to be not that hard to solve but if ...
2
votes
0
answers
62
views
Can a genetic algorithm give an variable sized solution?
I'm trying to use an simple genetic algorithm with only one goal, however my problem is kinda of complex. So, I have an initial chromosome that will have to be made up of 2 or more groups that also ...
-1
votes
1
answer
80
views
abnormal behaviour with preserving the elitism
I hope you are doing well.
I am writing a simple genetic algorithm in Java. However, I am encountering an issue with elitism. When I try to preserve the best individuals, I observe abnormal behavior ...
1
vote
1
answer
114
views
firness function of multi output pygad
I am not understanding what will be my fitness function for regression problem.basically i have 1000 datasets with input shape (72,2) and 1000 output dataset (72,4).I want my model to be trained with ...
0
votes
0
answers
72
views
Ant Colony Optimization and Genetic Algorithms in Terms of Efficiency in Solving the Traveling Salesman Problem
How could I gather data for an experiment solving the traveling salesman problem by comparing ant colony optimization to genetic algorithms in terms of efficiency? Are there any recommended tools? My ...
1
vote
0
answers
49
views
Matlab Optimization Solver not Applying Options or Converging (Genetic Algorithm)
I am using matlab's optimization toolbox to find the maximum of a function I am calculating numerically/do not have a closed form for. My two inputs are arrays of binary values, and a genetic ...
0
votes
1
answer
61
views
Array Operations in Genetic Algorithms
I've been trying to implement simple Gen. Algorithm but I can't wrap my head around splitting up an array into pieces and assigning that to the new array.
My problems:
1.I don't know how to split rows ...
0
votes
0
answers
354
views
How to approach cutting stock problem that minimises waste and calculates the number of borads to use for cutting
I am trying to develop an algorithm for two dimensional cutting stock problem, but it should also be able to calculate the number of boards to cut from. Here is an example:
Base boards are all the ...
0
votes
0
answers
34
views
how to make inversion mutation using matlab code
if I have a chromosome =[1.01, 2.03, 4.06, 6.03, 0, 5.06, 4.12, 0, 3.03, -1, 1.12, 10.01, 4.05, 8.05, 3.07, 5.08, -1, 7.10, 8.01];
how can I separate it into segments using -1 gene
and -1 will be ...
1
vote
0
answers
73
views
Matlab's genetic algorithm ignores obstacle when pathfinding in 2D space
I'm playing with Matlab's Global Optimization Toolbox and learning about genetic algorithms. My goal is to implement an algorithm that can navigate in 2D space, searching for the shortest path from a ...
1
vote
1
answer
88
views
How to group rows in dataframe based on timestamps ranges and mean group size maximization?
I have a data frame:
prod_id timestamp1 timestamp2
1 2023-12-02 2023-12-01
2 2023-12-05 ...
2
votes
0
answers
121
views
How to convert CIFAR-10 to a tensor object
I'm attempting to build a CNN deep learning model utilizing a genetic algorithm to learn on CIFAR-10. I have so far found a few libraries, but I have mainly encountered pyGAD and some derivatives ...
0
votes
0
answers
42
views
Schemata Theorem, Crossover Probability and Mutation Probability in different techniques
For the mutation probability, the definition I found is "Mutation probability (or ratio) is basically a measure of the likeness that random elements of your chromosome will be flipped into ...
-1
votes
1
answer
126
views
Assistance formatting and solving a very large system of equations problem
This is a real world problem that has been solved in the past via thousands of manual iterations.
Please forgive my inexperience with stackoverflow and with how to format my question. Dave, I believe ...
0
votes
1
answer
26
views
how can i select parents using tournament selection
I'm create this code but now I need select parents using the tournament selection and if I enter an odd number like 5 the program don't should give me 5 parents should give me 4 parents
this is what I ...
0
votes
1
answer
66
views
How do I exclude missing entries when using quantmode getSymbols() in R?
So I am just trying to extra 100 different stocks from YH using yfR and quantmod then calculate the daily returns for these stocks (eventually I will use this data to calculate the mean daily returns ...
0
votes
0
answers
53
views
How to Avoid Duplicate Selection in Combinatorial Optimization Problems Using Genetic Algorithms
Abstracts
I am currently developing a program that uses a genetic algorithm to solve a combinatorial optimization problem.
The objective is to select a control group of 2000 people from 5000 people ...
0
votes
0
answers
86
views
Python geneticalgorithm2 bounds with stepsize
I'm using the geneticalgorithm2 module for minimization. I use mixed variables and my code is similar to the example given by them:
import numpy as np
from geneticalgorithm2 import geneticalgorithm2 ...
1
vote
1
answer
303
views
C++ genetic algorithm for 8 queens problem
I am trying to implement 8 queens problems in c++.
This is my code
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <algorithm>
#...
-1
votes
1
answer
68
views
Suggestions about optimal way to run neural networks in parallel
I started in the last days of 2023 a personal project just for fun - I recreated the classical "Snake Game" (from old Nokia mobiles) in Python and I wanted to integrate it with some Machine ...
0
votes
0
answers
123
views
MPI coding error : program exiting without completing execution
I am doing small coding on Genetic Algorithm and the below is my main function :
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <mpi.h>
#include <limits.h&...
0
votes
0
answers
506
views
job shop scheduling using python
I'm working on a project related to solving the job shop scheduling problem using Tabu search, genetic algorithms, or any suitable algorithm in Python. I've referred to this GitHub repository: https://...
1
vote
1
answer
363
views
Pygad create new population if fitness is saturated
I am using Pygad to compute an optimization problem, however the algorithm is reaching local minima (not the ideal solution) before all the generations have run. I would like to be able to check ...
0
votes
0
answers
48
views
Theory of algorithms and counting the number of operations
If 100 assignment operations m=n are performed in 1 second, then how many operations n^2 and 2^n will be performed in a second?
It seems to me that it is necessary to perform an operation that is the ...
0
votes
0
answers
89
views
Datacenter Job Scheduling using Genetic Algorithm or Linear Programming
I'm looking for some advice for an optimization problem regarding scheduling jobs in a datacenter.
So I have a list of jobs and each job has a required time for finishing and a number of cores it has ...
0
votes
1
answer
277
views
Get the best individual in each generation with DEAP
I learning genetic algorithms with DEAP and i want to animate how the best individual changes in each generation.
For it i use class Statistics and Multistatistics:
stats = tools.Statistics(lambda ind:...
0
votes
1
answer
475
views
Is it possible to optimize a function with discrete variables in `mealpy`?
I have been working with the mealpy Python library for quite some time-- the repository of around 200 metaheuristic algorithms including GA, DE, ACO, PSO, ...authored by Nguyen Van Thieu, alias ...
0
votes
1
answer
833
views
How select a first population from my code in Pymoo
I am need of a help.
My code is to maximize the profit and minimize the area, which is the sum of Xs. The X are the áreas, and 4 of them are free to use, and the other 4 have a cost to use, and have ...
0
votes
1
answer
91
views
Error invalid index to scalar variable how to solve when using shape function
I am trying to use the following function to make mutation step in agametic algorithm. Unfortunately, I have got an error as follows:
IndexError Traceback (most recent ...
0
votes
1
answer
157
views
Single objective multiple integer variable optimisation of an Excel model - Python Pymoo library
I am trying to optimize a large Excel model using Pymoo, I have set up the problem to communicate with Excel via pyWin32.
During debugging in VSCode, I get the following exception:
Exception
('Problem ...
0
votes
1
answer
427
views
Scipy differential evolution - non-continuous bounds
I am trying to setup a differential_evolution algorithm.
I have approximately 15 variables, each with its own bounds (let's suppose they all share the same bounds (150,250). I have successfully ...
0
votes
1
answer
479
views
Couldn't get more than two solutions in pymoo
I have a problem with two objectives. The problem is minimized by NSGA-2 algorithm. I run minimize with different population sizes and different termination criterias, but every time the algorithm ...
0
votes
1
answer
80
views
How to optimize an output (via Genetic Algorithms), given a dataset?
I have a .csv file with 5 inputs and 1 ouput. How can I optimize the output via the use of Genetic Algorithms? Many people that have written a tutorial online do not give instructions on problems such ...