Solve the puzzle via djstra shortest path algorithm

Version 1.1.0.0 (24,1 KB) von Su Dongcai
an interesting application of djstra algorithm
418 Downloads
Aktualisiert 20. Jan 2012

Lizenz anzeigen

This file apply djstra algorithm(only consider the positive edge weight case) to solve the
puzzle and visualize the result.
Please run the following commands to duplicate the screen shot(have fun :):

mex vcDjstra.cpp;%compile the cpp file
im = imread('puzzle.png'); im = rgb2gray(im);
[pc, path] = shortestPath(im, [57, 94], [471, 496]);
Acknowledgement:
The puzzle.png is from steven's blog:
http://blogs.mathworks.com/steve/?s_cid=global_nav
Note:
The core file that implement djstra algorithm is 'cShortestPath.h', the compiler I used in
msvc++ 6.0

Zitieren als

Su Dongcai (2024). Solve the puzzle via djstra shortest path algorithm (https://www.mathworks.com/matlabcentral/fileexchange/34670-solve-the-puzzle-via-djstra-shortest-path-algorithm), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R14
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Strategy & Logic finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.1.0.0

Fix a bug on line59 'cShortestPath.h', where I erroneously written operator '%' instead of '/', this bug result in the incorrect path cost 'pc'

1.0.0.0