{"id":24917062,"url":"https://github.com/codernayeem/2d-maze-solver","last_synced_at":"2025-07-04T03:34:40.932Z","repository":{"id":59536987,"uuid":"537082468","full_name":"codernayeem/2D-maze-solver","owner":"codernayeem","description":"Solve and view the solution path of a 2D Maze","archived":false,"fork":false,"pushed_at":"2022-09-17T13:25:55.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T07:44:54.554Z","etag":null,"topics":["backtracking-algorithm","cpp","maze","maze-solver"],"latest_commit_sha":null,"homepage":"","language":"C++","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/codernayeem.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}},"created_at":"2022-09-15T15:08:58.000Z","updated_at":"2022-09-16T18:32:32.000Z","dependencies_parsed_at":"2022-09-18T14:14:21.473Z","dependency_job_id":null,"html_url":"https://github.com/codernayeem/2D-maze-solver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codernayeem/2D-maze-solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codernayeem%2F2D-maze-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codernayeem%2F2D-maze-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codernayeem%2F2D-maze-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codernayeem%2F2D-maze-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codernayeem","download_url":"https://codeload.github.com/codernayeem/2D-maze-solver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codernayeem%2F2D-maze-solver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263440859,"owners_count":23467005,"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":["backtracking-algorithm","cpp","maze","maze-solver"],"created_at":"2025-02-02T08:30:52.520Z","updated_at":"2025-07-04T03:34:40.881Z","avatar_url":"https://github.com/codernayeem.png","language":"C++","readme":"# 2D-maze-solver\n\nSolve and view the solution path of a 2D Maze\n\n## Input \u0026 Output\n\n* __Maze Input Example__:\n\t\n        1 1 1 1\n        1 0 1 1\n        1 1 1 0\n        0 1 1 1\n\t\t\n\t* `0` =\u003e indicates __Obstacle__\n\t* `1` =\u003e indicates __Free Space__\n\t\n* **Output**:\n    * There can be one / multiple output maze solutions.\n    * Output can be two types.\n    * Normal Output will print with numbers where '2' represent solution path.\n    * Fancy Output will print with some character specified in styles array.\n    \n* **Normal Output Example**:\n\n        2 1 1 1 \n        2 0 1 1 \n        2 2 1 0 \n        0 2 2 2\n\n* **Fancy Output Example**:\n\n        . o o o \n        . # o o \n        . . o # \n        # . . .\n\n\n* **No Solution Output**:\n    * `0`  =\u003e If no Solution found\n    * `-1` =\u003e Start or End point is an obstacle/not in maze.\n\n\n## **1. `mazeSolverOneWay.cpp`**\n\n* Fastest. It will give a solve of the maze as soon as possible. That solve might not be the best solution.\n* Can be used to check if a maze has at least one solution.\n\n* **Input**:\n\n        * \u003cnumber of rows\u003e \u003cnumber of columns\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n* **Input Example**:\n\n        4 4\n        1 1 4 4\n\n        1 1 1 1\n        1 0 1 1\n        1 1 1 0\n        0 1 1 1\n\n* **Normal Output Example**:\n\n        2 1 1 1 \n        2 0 1 1 \n        2 2 1 0 \n        0 2 2 2\n\n* **Fancy Output Example**:\n\n        . o o o \n        . # o o \n        . . o # \n        # . . .\n\n## **2. `mazeSolverOneBestWay.cpp`**\n\n* It will give just one best [__minimum steps__] solution. There can be multiple best solutions. But it will just give one.\n* Can be used to check one of the best [__minimum steps__] solutions of the maze.\n\n* **Input**:\n\n        * \u003cnumber of rows\u003e \u003cnumber of columns\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n* **Input Example**:\n\n        4 4\n        1 1 4 4\n\n        1 1 1 0\n        1 0 1 1\n        0 1 1 1\n        0 1 0 1\n\n* **Output**:\n\n        \u003csteps taken\u003e\n        \u003csolution of the maze\u003e\n\n* **Normal Output Example**:\n\n        7\n\n        2 2 2 0 \n        1 0 2 1 \n        0 1 2 2 \n        0 1 0 2\n\n* **Fancy Output Example**:\n\n        7\n\n        . . . # \n        o # . o \n        # o . . \n        # o # .\n\n## **3. `mazeSolverMultiWay.cpp`**\n\n* It will give every possible way to solve the maze.\n* Can be used to see every possible solutions of the maze.\n\n* **Input**:\n\n        * \u003crows\u003e \u003ccolumns\u003e \u003cmax solution print\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n    * `\u003cmax solution print\u003e` can be set to -1 to print all solution. Or, It can be a limiting value of solutions print count.\n\n* **Input Example**:\n\n        3 3 -1\n        1 1 3 3\n\n        1 1 1\n        1 1 1\n        0 0 1\n\n* **Output**:\n\n        \u003cnumber of solutions\u003e\n        \u003csolutions of the maze\u003e\n\n* **Normal Output Example**:\n\n        4\n\n        2 1 1 \n        2 2 2 \n        0 0 2 \n\n        2 2 2 \n        2 2 2 \n        0 0 2 \n\n        2 2 1 \n        1 2 2 \n        0 0 2 \n\n        2 2 2 \n        1 1 2 \n        0 0 2\n\n* **Fancy Output Example**:\n\n        4\n\n        . o o \n        . . . \n        # # . \n\n        . . . \n        . . . \n        # # . \n\n        . . o \n        o . . \n        # # . \n\n        . . . \n        o o . \n        # # .\n\n## **4. `mazeSolverMultiBestWay.cpp`**\n\n* It will give every possible way [__minimum steps taken__] to solve the maze.\n* Can be used to see every __best__ possible solutions of the maze.\n\n* **Input**:\n\n        * \u003crows\u003e \u003ccolumns\u003e \u003cmax solution print\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n    * `\u003cmax solution print\u003e` can be set to -1 to print all solution. Or, It can be a limiting value of solutions print count.\n\n* **Input Example**:\n\n        4 4 -1\n        1 1 4 3\n\n        1 1 1 1 \n        1 1 1 1\n        1 1 0 1\n        0 1 1 1\n\n* **Output**:\n\n        \u003cnumber of solutions\u003e \u003csteps taken\u003e\n        \u003csolutions of the maze\u003e\n\n* **Normal Output Example**:\n\n        3 6\n\n        2 1 1 1 \n        2 1 1 1 \n        2 2 0 1 \n        0 2 2 1 \n\n        2 1 1 1 \n        2 2 1 1 \n        1 2 0 1 \n        0 2 2 1 \n\n        2 2 1 1 \n        1 2 1 1 \n        1 2 0 1 \n        0 2 2 1\n\n* **Fancy Output Example**:\n\n        3 6\n\n        . o o o \n        . o o o \n        . . # o \n        # . . o \n\n        . o o o \n        . . o o \n        o . # o \n        # . . o \n\n        . . o o \n        o . o o \n        o . # o \n        # . . o\n\n## **5. `mazeSolverMultiBestBestWay.cpp`**\n\n* It will give every possible way [__minimum steps taken__ \u0026 __minimum direction change__] to solve the maze.\n* Can be used to see every __best of the best__ possible solutions of the maze.\n\n* **Input**:\n\n        * \u003crows\u003e \u003ccolumns\u003e \u003cmax solution print\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n    * `\u003cmax solution print\u003e` can be set to -1 to print all solution. Or, It can be a limiting value of solutions print count.\n\n* **Input Example**:\n\n        4 4 -1\n        1 1 4 3\n\n        1 1 1 1\n        1 1 1 1\n        1 1 0 1\n        0 1 1 1\n\n* **Output**:\n\n        \u003cNumber of solutions\u003e \u003csteps taken\u003e \u003cdirection change\u003e\n        \u003csolutions of the maze\u003e\n\n* **Normal Output Example**:\n\n        1 6 2\n\n        2 2 1 1\n        1 2 1 1\n        1 2 0 1\n        0 2 2 1\n\n* **Fancy Output Example**:\n\n        1 6 2\n\n        . . o o\n        o . o o\n        o . # o\n        # . . o\n\n## **6. `mazeSolverAllInOne.cpp`**\n\n* It will give every possible way to solve the maze according given __mode__.\n* Can be used to see __all__ / __best__ / __best of the best__ possible solutions of the maze.\n\n* **Input**:\n\n        * \u003crows\u003e \u003ccolumns\u003e \u003cmax solution print\u003e \u003cmode\u003e\n        * \u003cstart row\u003e \u003cstart col\u003e \u003cend row\u003e \u003cend col\u003e\n        * \u003celements of the maze\u003e\n\n    * `\u003cmax solution print\u003e` can be set to -1 to print all solution. Or, It can be a limiting value of solutions print count.\n    * `\u003cmode\u003e` can be `0` / `1` / `2` to get __all__ / __best__ / __best of the best__ solutions.\n    * `mode == 0` =\u003e get all possible solve\n    * `mode == 1` =\u003e get all solve with __min steps__\n    * `mode == 2` =\u003e get all solve with __min steps__ \u0026 __min direction change__\n\n* **Input Example**:\n\n        4 5 -1 2\n        1 1 4 5\n\n        1 1 1 1 1\n        1 1 0 0 1\n        0 1 1 0 1\n        0 0 1 1 1\n\n* **Output**:\n\n        \u003csolution count, steps, direction change [according to mode]\u003e\n        \u003csolutions of the maze\u003e\n\n* **Normal Output Example**:\n\n        1 8 1\n\n        2 2 2 2 2 \n        1 1 0 0 2 \n        0 1 1 0 2 \n        0 0 1 1 2\n\n* **Fancy Output Example**:\n\n        1 8 1\n\n        . . . . . \n        o o # # . \n        # o o # . \n        # # o o .\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodernayeem%2F2d-maze-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodernayeem%2F2d-maze-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodernayeem%2F2d-maze-solver/lists"}