A solution to the Maze problem with Dijkstra

版本 1.1.0.0 (2.2 KB) 作者: Y Simson
Use Dijkstra to find the shortest path to a Maze
1.0K 次下载
更新时间 2014/3/31

查看许可证

The general idea:
1) Think of every pixel in the maze as node on a connected graph
2) Define the walls as having high weights. This ensures that walls will act as separators
3) Use a 4-connected neighborhood to link adjacent pixels/nodes
4) Convert the maze image into a sparse Distance matrix(similar to an adjacency matrix with weights instead of ones).
5) Use graphshortestpath() from the bioinformatics toolbox to find the shortest path

引用格式

Y Simson (2024). A solution to the Maze problem with Dijkstra (https://www.mathworks.com/matlabcentral/fileexchange/46072-a-solution-to-the-maze-problem-with-dijkstra), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2013a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: dijkstra very simple

启发作品: Dijkstra lowest cost for images

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Fixed a bug and added support to im2graph() function to support 8 as well as 4 connected neighborhoods

1.0.0.0