Skip to content
Java-based Open Source CLI tool designed to solve mazes
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mazelight logo
Language: en


Java-based Open Source CLI tool designed to solve mazes.

Table of contents

About Mazelight

Mazelight is a Java-based Open Source CLI tool that can solve mazes. It uses a custom made algorithm to find nodes and paths in the maze that are later added to a graph that can be used to solve the maze with shortest path finding algorithm like Dijkstra's algorithm.

Get started


Mazelight currently supports images up to 512x512px in black and white (although the solved image contains color for the solution).
Mazes must be surrounded by a wall and only contain one start point and one exit point.
Maze paths must have 1px of width. Maze walls can be wider. Example mazes are provided in the mazes/ folder.


To get started first make sure you have at least Java 1.8 and follow the next instructions:

  1. Download the latest release.
  2. Open
  • Linux: Terminal
  • macOS: Terminal (Launchpad > Utilities > Terminal)
  • Windows: cmd (Win + R > cmd)
  1. Navigate to the path where the dowloaded release is contained.
  2. Run the program with:
    java -jar mazelight.jar path/to/image path/to/output/image

Note: A* is currently the only implemented solving method

Program arguments


  • mazelight.jar: The program itself.
  • path/to/image: The path to the maze image in black and white (as .png, .jpg or .bmp).
  • path/to/output/image: The output image path. Will export as .png


  • Implement Dijkstra's algorithm.
  • Implement Dijkstra's algorithm.
  • Optimize There's no need to add the edge reversed again.
  • Implement command line arguments.
  • Expand documentation.
  • Finish
  • Create API.

How it works

Mazelight works by analyzing an image of a maze and then converting it into a graph, so it can run algorithms to find the best solution to the problem. Some pseudocode can be found here


All docs can be found in the wiki, and a javadoc is provided.


Feel free to create issues and pull requests to solve bugs or create new features. Please check the license file in the link below


You can’t perform that action at this time.