{"id":19150377,"url":"https://github.com/coffeeeatnight/genetic_algorithm_maze_solver","last_synced_at":"2025-06-30T06:04:18.489Z","repository":{"id":256357315,"uuid":"854635967","full_name":"CoffeeeAtNight/Genetic_Algorithm_Maze_Solver","owner":"CoffeeeAtNight","description":"Utilizing evolutionary algorithms to mutate agents gens so they are able to find the best possible way through a maze represented as a 2D matrix written in Nim","archived":false,"fork":false,"pushed_at":"2024-09-10T07:31:20.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T20:45:19.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoffeeeAtNight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-09T14:18:14.000Z","updated_at":"2025-02-22T09:39:35.000Z","dependencies_parsed_at":"2024-09-10T09:47:22.410Z","dependency_job_id":"c019e498-5da8-4381-8299-d5035f064c20","html_url":"https://github.com/CoffeeeAtNight/Genetic_Algorithm_Maze_Solver","commit_stats":null,"previous_names":["coffeeeatnight/genetic_algorithm_maze_solver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CoffeeeAtNight/Genetic_Algorithm_Maze_Solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoffeeeAtNight%2FGenetic_Algorithm_Maze_Solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoffeeeAtNight%2FGenetic_Algorithm_Maze_Solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoffeeeAtNight%2FGenetic_Algorithm_Maze_Solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoffeeeAtNight%2FGenetic_Algorithm_Maze_Solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoffeeeAtNight","download_url":"https://codeload.github.com/CoffeeeAtNight/Genetic_Algorithm_Maze_Solver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoffeeeAtNight%2FGenetic_Algorithm_Maze_Solver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262720642,"owners_count":23353447,"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":"2024-11-09T08:11:49.001Z","updated_at":"2025-06-30T06:04:18.465Z","avatar_url":"https://github.com/CoffeeeAtNight.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧬 Genetic Algorithm Maze Solver\n\n### A simple genetic algorithm project that evolves agents to navigate a 2D maze! 🚀\n\n---\n\n## Overview 🎯\n\nThis project implements a **genetic algorithm (GA)** to evolve agents that can find their way through a maze. The agents start with random movements, and through natural selection, crossover, and mutation, they gradually improve their ability to reach the goal.\n\nKey Features:\n- **Genetic Algorithm Core**: Includes selection, crossover, and mutation mechanics.\n- **Maze Representation**: The maze is represented as a 2D grid with walls, paths, and a goal.\n- **Real-time Visualization**: Watch agents as they evolve in the maze with a simple ASCII representation.\n- **Elite Selection**: Top-performing agents are selected as the basis for the next generation.\n\n---\n\n## How It Works 🧠\n\n1. **Initialization**:\n   - Agents are created with a random genome (sequence of moves: up, down, left, right).\n   - Agents are placed at the start position in the maze.\n\n2. **Fitness Evaluation**:\n   - Each agent’s fitness is determined by how close it gets to the goal. The closer, the better the fitness.\n\n3. **Evolution Process**:\n   - **Selection**: The top-performing agents (elite agents) are selected to reproduce.\n   - **Crossover**: Two parents’ genomes are combined at a random point to create offspring.\n   - **Mutation**: Some offspring may experience small random changes to their genome to introduce variation.\n\n4. **Next Generation**:\n   - The new generation replaces the old one, and the process repeats until agents successfully reach the goal or the set number of generations is reached.\n\n---\n\n## Maze Layout 🗺️\n\nThe maze is represented as an 8x8 grid:\n- **#**: Wall\n- **A**: Agent\n- **G**: Goal\n- **(Blank Space)**: Path\n\n---\n\n## Todo:\n\n- **Fix problem where generation stops after some time**\n- **Improve fitness function to prevent local maximum**\n- **Integrate OpenGL to better represent generations**\n\n---\n\n![image](https://github.com/user-attachments/assets/e8d83414-d388-45f2-ac5b-3571967c034d)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoffeeeatnight%2Fgenetic_algorithm_maze_solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoffeeeatnight%2Fgenetic_algorithm_maze_solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoffeeeatnight%2Fgenetic_algorithm_maze_solver/lists"}