Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.15 KB

File metadata and controls

29 lines (19 loc) · 1.15 KB

Shortest Path Algorithms in a Random Maze

This repository contains a Python program that generates a random maze and uses several shortest path algorithms to find the path from a starting point to an ending point. The algorithms implemented are :

  • A* search with and without heuristic
  • Bellman-Ford
  • Dijkstra's algorithm

Installation and Usage

To use this program, you need to have Python 3 and the following libraries installed :

  • networkx
  • matplotlib

This will generate a random maze and display it on the screen, along with the shortest path found by each algorithm. The starting point is displayed in green, the ending point is displayed in red, and the path is displayed in yellow.

You can modify the starting and ending parameters as well as the maze's wall appearance rate by changing the values of the following variables at the beginning of this notebook.

Note

If the program does not find a path in the maze, you need to recompile the code.

Results

Credits

This program was written by MetalGray.