Maze Solver
This algorithm finds the shortest path through black and white maze images. It outputs an image with the path marked in green.
Installing
Check that your python version is >=3.5 with python3 -V.
Also make sure that pip is installed with python3 -m pip -V.
To install, simply run python3 -m pip install mazesolver --user on the command line.
You can run the tool using mazesolver or mazesolver.exe.
What are the rules for maze images?
-
Walls marked with black pixels and paths marked with white pixels
-
Walls around the entire maze
-
One entrance on the top row and one exit on the bottom row
You can generate a compatible maze using mazegenerator, or just make your own image in an image editing program.
If this is confusing, check out some of the example mazes in the pics directory.
How do I use it?
You can use mazesolver --help to get a list of commands.
Make sure that your image meets the specifications above.
Normal usage will look something like this: mazesolver -i path/to/input_img -o path/to/output_dir/
How does the algorithm work?
-
Start at the entrance and label it zero.
-
Move to any neighbouring cells and mark them with 1
-
Move to any of the cells neighbouring the ones marked 1 and label them 2
-
Continue doing this until all cells are marked
-
Start from the exit of the maze and move to any neighbouring cell that == the current cell's number -1. Until we reach 0 (the entrance).
We now have the shortest path from the entrance to the exit!
Metadata
Release files for mazesolver 2.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mazesolver-2.2.2.tar.gz | 8.3 kB | Without provenance | Details for mazesolver-2.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mazesolver-2.2.2-py3-none-any.whl | Python 3 | none | any | Details for mazesolver-2.2.2-py3-none-any.whl |
Total release size: 29.9 kB
Release files / mazesolver-2.2.2.tar.gz
| Download URL | mazesolver-2.2.2.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bdde53fb85bf37f8ff025ea1ee5f59d300b01869e4ea6dc48234345850689be
|
|
BLAKE2b-256 checksum How to use checksums |
44e7ada5eef5ce527d162d522965ef582868a85f4364d9304afe453fea408014
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|
Release files / mazesolver-2.2.2-py3-none-any.whl
| Download URL | mazesolver-2.2.2-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b35b67ce8a3b0bd8e6a753eb1dc60537e5b96c680be7bbb2ec25f16583761849
|
|
BLAKE2b-256 checksum How to use checksums |
439d21862a0ba9fb3a2db0a9ec97f3190b6a142248fab110e6dcc928f2e2b222
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|
Security for mazesolver 2.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.