I guess I wasn’t quite finished with this project. It annoyed me to not have a fully automated backtrace of my deathtrap dungeon solver so I finally added it. Here’s the complete maze with the solved path highlighted:

custom_complete_maze_with_solution (pdf)
complete_with_solution (graphviz dot file)
Here’s how the system works:
1. Solve the maze forward using breadth-first search, propagating acquired “satisfiers” forward to child nodes (ie if your parent had a given satisfier like “SHIELD” then the child node has the same satisfier). The only trimming I do at this point is making sure I don’t add any child nodes where I don’t have the satisfier required for a given edge.
2. Backtrace from the endpoint of the maze by only following parents that meet the “requirements” that have been discovered so far. If a transition along an edge requires something, I add that requirement, and then only add subsequent parents who have that satisfier. For example, if the final node in the maze is 399->400 and it requires “DIAMOND”, I add “DIAMOND” as a requirement. Because we are only working with the possible parents available from the forward solve (meaning, it can only be a parent if at least some path arrives at the parent node with the DIAMOND) we know that at least some parent will have the required DIAMOND. If we discover at some possible point, lets say 397->399 and 398->399 that only 397 has the DIAMOND, then we can prune 398. It turns out this is sufficient to provide a single possible path (well, when I avoid all unnecessary battles) through our maze.



Recent Comments