Maze-solving algorithm: Difference between revisions

Content deleted Content added
Line 112:
int MD_best = MD(src, dst);// It stores the closest MD we ever had to dst
// A productive path is the one that makes our MD to dst smaller
while (cur != dst) {
if (there exists a productive path) {
Take the productive path;
} else {
MD_best = MD(cur, dst);
Imagine a line between cur and dst;
Take the first path in the left/right of the line; // The left/right selection affects the following hand rule
while (MD(cur, dst) != MD_best || there does not exist a productive path) {
Follow the right-hand/left-hand rule; // The opposite of the selected side of the line
}
}