{"id":22347671,"url":"https://github.com/ayax537/depth-first-search-dfs-maze-solver","last_synced_at":"2025-03-26T10:43:02.243Z","repository":{"id":262228360,"uuid":"886601217","full_name":"ayax537/Depth-First-Search-DFS-Maze-Solver","owner":"ayax537","description":"This Python script implements the Depth First Search (DFS) algorithm to solve a maze using the Turtle graphics library. The program visually represents the maze and the search process, allowing users to observe how DFS explores paths to find a solution.","archived":false,"fork":false,"pushed_at":"2024-11-11T09:16:57.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T12:12:25.054Z","etag":null,"topics":["ai","dfs-algorithm","dfs-visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ayax537.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-11-11T09:15:46.000Z","updated_at":"2024-11-11T09:17:31.000Z","dependencies_parsed_at":"2024-11-11T10:25:22.241Z","dependency_job_id":"389ac737-e067-4335-82c9-c840bf632499","html_url":"https://github.com/ayax537/Depth-First-Search-DFS-Maze-Solver","commit_stats":null,"previous_names":["ayax537/depth-first-search-dfs-maze-solver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayax537%2FDepth-First-Search-DFS-Maze-Solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayax537%2FDepth-First-Search-DFS-Maze-Solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayax537%2FDepth-First-Search-DFS-Maze-Solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayax537%2FDepth-First-Search-DFS-Maze-Solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayax537","download_url":"https://codeload.github.com/ayax537/Depth-First-Search-DFS-Maze-Solver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245641317,"owners_count":20648637,"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":["ai","dfs-algorithm","dfs-visualization"],"created_at":"2024-12-04T10:10:14.345Z","updated_at":"2025-03-26T10:43:02.220Z","avatar_url":"https://github.com/ayax537.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Depth-First-Search-DFS-Maze-Solver\n# Overview\nThis Python script implements the Depth First Search (DFS) algorithm to solve a maze using the Turtle graphics library. The program visually represents the maze and the search process, allowing users to observe how DFS explores paths to find a solution.\n\n# Key Components\n1. Turtle Graphics Setup\nThe script creates a Turtle graphics window where the maze is displayed.\nThe window has a black background and is titled \"A Maze Solving Program.\"\n2. Maze Representation\nThe maze is defined using a grid of characters:\n+ represents walls.\n  (space) represents paths.\ns marks the start position.\ne marks the end position.\n3. Turtle Classes\nFive turtle classes are defined to represent different elements of the maze:\nMaze (white turtle): Used to stamp the walls of the maze.\nGreen turtle: Marks the cells that have been visited during the search.\nBlue turtle: Shows the frontier cells currently being explored.\nRed turtle: Indicates the starting position.\nYellow turtle: Represents the end position and the solution path.\n4. Maze Setup Function\nThe setup_maze function initializes the maze based on the provided grid:\nIt iterates through each character in the grid, determining the position of walls, paths, the start, and the end points.\nTurtles are moved to their respective positions and stamped to visualize the maze layout.\n5. DFS Search Function\nThe search function implements the DFS algorithm:\nIt uses a frontier list to keep track of the current path being explored.\nThe algorithm explores possible moves (up, down, left, right) and marks cells as visited.\nIf a cell is part of the path and has not been visited, it is added to the frontier.\nThe algorithm continues until the end position is reached.\n6. Backtracking to Find the Solution Path\nThe backRoute function is called once the end is reached:\nIt retraces the path from the end back to the start, marking the solution path with the yellow turtle.\n7. Execution Flow\nThe maze is set up, the DFS search is performed, and the solution path is visualized.\nThe program ends when the user clicks on the Turtle graphics window.\n# Conclusion\nThis script serves as an educational tool for understanding how the Depth First Search algorithm works in the context of maze solving. The visual representation through Turtle graphics makes it engaging and helps illustrate the algorithm's process of exploration and backtracking. Users can modify the grid to test different maze configurations, enhancing their understanding of DFS.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayax537%2Fdepth-first-search-dfs-maze-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayax537%2Fdepth-first-search-dfs-maze-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayax537%2Fdepth-first-search-dfs-maze-solver/lists"}