Awesome! I'll adapt your code so that I can use it in a Machine Learning class in my college. I won't forget to give you the credits, it helped me a lot. Tkx!
@@cerupsly hey buddy, I have a hub location problem to solve using GA. but i am creating random population from some data from excel... how can i continue the following steps such as mutation and crossover and till the final steps as shown in your video? how can i adapt your code and replace the initial population using my excel data???can you guide me???
@@cerupsly Here it is. It's all in Portuguese, but i thought it would be nice to share with you. Thanks again! github.com/DimitriLeandro/SistemasInteligentesUFABC/blob/master/ECs/EC_5.ipynb
I was looking through the map matrix, not sure if it was mentioned or not but theres one point i dont quite get. Lets say, its a 2 by 2 matrix. Row 1 Col 1 reads say 26 and Row 1 Col 2 reads 67. I understand that the respective nodes to go from point A(row 1) to point B(col 2) is 67. However, Row 1 Col 1 reads 26 despite pointing towards the same place and having no arcs. Should it be 0 instead of 67?
That was kinda cool. And did not mention Genome once ! I was a bit puzzled by some of the seaborne and style of code. But I have played around a bit from your jupyter download to understand some more parts of the code. Thanks so much for sharing. I did note once problem, in that the initialise code, could potentially set up none possible solutions, especially for much smaller maps. (e.g. No Paths from a Node, as probability of a value falls below p_zero threshold.) So may need a fudge that there is at least one path from each node, within initialise_map regardless of p_zero ? - at least from my quick 15 minutes of play.
Thank you for this. I like the idea of a grid on connections as this could be a grid of actions/choices for a character in a game ie you cant build army without a barracks so kinda of a tier control thing. Also it would be interesting to instead of random map - draw a circle as we can visually see the optimal route that way. Cheers thanks again.
I'm getting this error : FileNotFoundError: [Errno 2] No such file or directory: 'images/new1000plot_0.png' I created the image folder. Now where do i get this image from?
Hi I was wondering if you could help me with an optimization process based on the granulometric size of minerals, I’m finishing my ChemE degree and this is my final work, thanks!
Amazing tutorial! The 'mutate' method is buggy though. As far I could see and test, the "mutated" route is nothing but the original input route with an additional random element appended to it, which makes it senseless, since once you reach the final node, the route should be completed.
Can I have the python code using genetic algorithm for finding shortest path... Please sir... Please... Past 3 months I'm trying but no use... Please help me sir
Thank you for the video, I’m trying to make a program that takes peoples address and finds the best route to pick them up to go hospital , what changes would I have to make to use your genetic algorithm and could using google map api be possible? Thank you
Hi, I have unconstrained multi-objective optimization model and I am not sure if Genetic algorithm works for such kind of problems ??. Could you help me out in this regards Thanks
Is there any particular reason you wrote this in more of a functional programming style rather than OO? Is there some advantage to that approach for this sort of algorithm, or is that just the style you're used to?
hi, thanks for your video. may i know why >> FileNotFoundError: [Errno 2] No such file or directory: 'image/new1000plot_0.png' occurred in my code? got any solution? or i need to add a file?
By timetable - I mean a revision kind of timetable where the matrix is basically hour slots in a day and days should be avoided that the user doesn’t want to do work in(constraints). Kind of like an automated timetable where a genetic algorithm is used to determine the best order of specific sessions. Does that kind of make sense?
@@suzanneonaeko9310 Two main changes that you'll have to make. First, you need to figure out a way to encode a solution to the problem as a matrix/vector. Second, you need to adjust the fitness function to calculate the quality of each solution.
hi Greg, thank you for posting this. I was interested in knowing if you done comparisons with genetic algorithms and convolutional neural networks or recurrent neural networks for performance and 'best solutions'. Also, is it probable that a potential solution that is terminated early in simulation ultimately may be superior to any future generations? Lastly, you mentioned at 9:00 about 'good' solutions versus 'best' solutions. Isn't the point to produce the best?
Good questions. First, genetic algorithm and neural networks aren’t really comparable because they aren’t in the same category. Genetic algorithm is an optimization scheme, while a neural network is a supervised learning algorithm. You might even use a genetic algorithm to train a neural network (although that isn’t typically how it’s done). Second, usually the best member of the population is carried on to the next generation as a matter of course, so that you don’t lose good solutions. However, it is often helpful to throw out the “best” solution occasionally to avoid being trapped at a local minimum. I would typically do this randomly at some low percentage. Finally, identifying the best solution is the overall goal, but the only way to guarantee that you have found the best solution is to search the entire space. If you have the computational power and sufficient time, then you can definitely do that. Most times, though you’re using the genetic algorithm because you don’t want a full brute force search. Simulated annealing, genetic algorithm, and all the other optimization algorithms are developed to help you get close to the best (and possibly the best) without having to search the entire solution space. Even if you find the best, though, you will never know that for sure. Hope that helps.
This video was very helpful. Thanks a lot. I am curious about solving any benchmark problems in cultural algorithms. If you could have a tutorial about that in later videos it will be great.
Great work! I am just curious, did you choose this problem just for the sake of explaining it? As far as I know, Dijkstra algorithm can find the shortest path in just a few milliseconds even for a network (map) size like this (1000 nodes). It might be interesting to see if GA will outperform Dijkstra for a very big network size.
Hi, Thank you very much for the video / and also the new one, could you maybe make 4-6 videos of one of your (fast forwarded) tutorials where you explain it in more detail? maybe just for the next video as sometimes it helps to see the way how you get in to the solution and whats the way you choose as there are many possible ways. Very good edit and thanks again.
I have a dataset that contains 5 columns (about 1GB), each of this rows gets 500'000 features columns that means i would require 500TB diskspace to train it on my model with LSTM. Now my approach that i was thinking about is using a genetic algorythm and generate the 500'000 features on the fly per member. All data inputdata is between 0 and 1. the problem i have or cant think around is how i dynamically assign every member random 400 rows (for example 5000-54000 or 1000-1400....) with the equaling result. Will try to create a github repo with sample data so that i can play with it. I know i would be better off in dividing the data and train a lstm on my dataset, then save the training status, generate the next bunch, train, save, generate the next bunch. It would be much more convenient to use a genetic algorythm in this case.
yes. That's right. In practice you would probably set the start and end points based on where you are and where you're going, but in this case, I just chose two points arbitrarily (the first and the last)
Thank you for this video. It's very good. My problem is directed graph. It means we can go from node A to B but we can't go from B to A. Could you help me that I solve that problem please?
Could you more explain? Actually the problem is maximum flow with genetic algorithm. Usually it solve with fulkerson algorithm but I want to solve it with genetic algorithm.
@@mahdieshraghi when you convert the graph into a matrix, for an undirected graph, the matrix is symmetric -- because each half of the adjacency matrix is one direction; i.e., If X is your adjacency matrix, x[i,j] in the matrix is the value of the edge from node i to node j. For an undirected graph, X[i,j] = X[j,i]. For a directed graph this is not true. In this example, I think I used distances as the values of the connections between the nodes and treated "0" as no connection. In your case, you will just need to figure out how to handle the values going in each direction. Does this make sense?
@@cerupsly yes it make sense and your explanation is very helpful for me I got it. In my case we want maximum flow with genetic algorithm in directed graph. It name is network flow.
Love your video! You cool! Please help me ! Could you optimise like 3D CAD designs using this strategy could you tell me how I could lay out the problem so that I could use the genetic algorithm
The Real GM when it is fit for purpose. When it handles the environment it’s exposed too aka the forces. So my fitness function will be too do with forces acting on the design ?
When you do the crossing over/breeding step, you do so based on the quality of the solution. So lower travel times have a higher chance of being selected.
Thanks for your video but you wasted 30% of screen space surroundi your video with bla k bands. More over, try to watch it on a 10" tablet and tell me if you can read what are you coding. Next time, please, change the font size or zoom in. Thanks.