{"id":26218436,"url":"https://github.com/aftersol/basic_genetic_algorithm","last_synced_at":"2025-12-26T02:53:41.145Z","repository":{"id":252191306,"uuid":"839701535","full_name":"Aftersol/basic_genetic_algorithm","owner":"Aftersol","description":"Basic genetic algorithm that computes tries to find best global maximum of two variables functions","archived":false,"fork":false,"pushed_at":"2024-08-08T21:35:40.000Z","size":329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-09T08:31:55.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aftersol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T06:46:58.000Z","updated_at":"2024-08-08T21:36:45.000Z","dependencies_parsed_at":"2024-08-08T08:31:03.648Z","dependency_job_id":"8bf22849-87a5-4cf9-bb31-ab39e4eacb21","html_url":"https://github.com/Aftersol/basic_genetic_algorithm","commit_stats":null,"previous_names":["aftersol/basic_genetic_algorithm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aftersol%2Fbasic_genetic_algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aftersol%2Fbasic_genetic_algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aftersol%2Fbasic_genetic_algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aftersol%2Fbasic_genetic_algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aftersol","download_url":"https://codeload.github.com/Aftersol/basic_genetic_algorithm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243222141,"owners_count":20256229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T13:16:59.431Z","updated_at":"2025-12-26T02:53:41.096Z","avatar_url":"https://github.com/Aftersol.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic Genetic Algorithm From Scratch\n\n  ![alt text](intro.png \"Using elite selection, the best chromosomes over many generations slowly rises starting from 0.60 to 0.67\")\n\nThis code calculates the best fitness of the equation below:\n\n$$\\left(f(x,y)=(1-x)^2*exp(-x^2-(y+1)^2)-(x-x^3-y^3)*exp((-x^2-y^2))\\right)$$\n\nWhere\n\n$$-2\u003c=x,y\u003c=2$$\n\n## How to run\nA Jupyter Notebook software such as Google Colab is required. Copy genetic_ai.ipynb to your Jupyter Notebook software and then run the code.\n\nElite Selection is enabled by default. You can disable this by setting\n  elite_selection=False\n\nChange this variable to set the amount generations the genetic algorithm will run for\n  generation=200\n\nYou can adjust the fitness equation in the genetic_ai.ipynb provided to find the best fitness of different functions given the variables x and y\n\nAdjust the left and right limits to adjust the range of the decoding function\nIncreasing the range will decrease the accuracy of the solution\n  left_limit = -2.0\n  right_limit = 2.0\n\nAdjust the crossover and mutation probability to change how fast each member mutates and crossover with each other within the next generation.\n  crossover_prob = 0.7 # probabity of crossover\n  mutation_prob = 0.01 # probabity of mutations\n\n## Requirements\n- A Jupyter Notebook software such as Google Colab\n- Numpy\n- Deepcopy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faftersol%2Fbasic_genetic_algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faftersol%2Fbasic_genetic_algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faftersol%2Fbasic_genetic_algorithm/lists"}