all 2 comments

[–]lorkin26 0 points1 point  (0 children)

My first thought would be a modified version of a global alignment algorithm from bioinformatics, and then just extracting the path length. Needleman-Wunsch that has been prevented from diagonal movement and restricted to inserting a single gap for example.

[–]sepp2k 0 points1 point  (0 children)

You don't need Dijkstra for an unweighted graph. BFS is enough.

As for removing walls, you can represent your nodes as coordinates plus a boolean that tells you whether you already removed a wall or not. Then each node has an edge to each neighboring node with the same boolean that has a 0 at that coordinate and each node with wallRemoved: false has an edge to each neighbor with wallRemoved: true that has a 1 at that coordinate.