But does anyone know a good metric for maze difficulty? Or what the study of maze difficult would really look like? The classic maze solving algorithm (right hand rule/DFS) is deterministic anyway.
But does anyone know a good metric for maze difficulty? Or what the study of maze difficult would really look like? The classic maze solving algorithm (right hand rule/DFS) is deterministic anyway.
I didn't, but found this [1] 2001 paper without much difficulty. Getting much out of it is more difficult. As I understand it, the complexity measure they propose is somewhat related to the difference of arctans of turns to take "forward" vs turns to take "backward", summed up for every fork and scaled with some length measurement. There are definitely plenty of other complexity measure though (e.g. number of forks, number of incorrect paths, etc) -- correlating that to practical difficulty is less straightforward.
[1] https://archive.bridgesmathart.org/2001/bridges2001-213.pdf
https://en.wikipedia.org/wiki/Micromouse
For example: https://swati-mishra.com/wp-content/uploads/2020/02/advanced...
I think there are a bunch of problem-definition details that would need to be hammered out first, ex:
1. Is this solving the maze with perfect knowledge of its layout--a bird's eye view from above--or does it require gradual exploration to fill out the contours?
2. If it requires exploration, how far can you see? Do you need to actually spend a move to enter a square to know whether it is a dead end, or can you tell from N squares away? Is the viewer constrained by trigonometry, where they can only uncover partial knowledge about nearby rooms and small geometric quirks can have a big effect on exploration progress? Is there a distance limit to vision?
3. If it requires exploration, is there a cost to backtracking, or--like DFS--can you simply teleport between all places you've already been without a cost?
4. Is a "difficulty" rating across mazes based on a single algorithm, or the best-possible choice for that particular maze from a set, or does it represent the average expected effort expended by a particular population of different people/algorithms?
____
Interestingly, you don't always actually have to _have_ an actual solution - it can be possible to determine run-time bounds (that tell you how hard your problem is at least) just on theoretical grounds. This could be, e.g., by comparing it in complexity to another problem that has already been studied and whose complexity is thus known.
Since solving mazes is however (also) something to be enjoyed by humans, it’s possible that perceived maze difficulty could be dependent on factors that wouldn’t really matter for a straightforward algorithm. For example, a very “jagged” maze could feel more difficult for humans because it’s harder to follow with your gaze, while an optimal maze solution finding algorithm wouldn’t be impacted.
In cases like this, formulating difficulty can be more of an art than an optimization problem.
EDIT: See also andrew_eu’s reply (which I only saw now), where multiple “interesting” notions of “difficulty” are proposed.
EDIT: Relatedly, humans use heuristics a lot. And there are many NP-hard problems where we can solve lots of “reasonable” points in the problem space in reasonable time (computers or humans alike), at the risk of having to time out, maybe try with another approach, and eventually just give up. Traveling salesmen are actually traveling the country after all. So worst case is not always a good measure for games. But I see you mentioned that already.
This has significant implications to search spaces that are very heavily branched with many deep dead ends but a relatively shallow goal.
The number of problems in general life matching that description is… huge.
This is just another way of saying the size of the search space is (b^d), and DFS "walks the tree" until it finds the exit, which means on average its going to iterate half the entire search space before getting there. Furthermore, unless there is some other information available which correlates with the correct path at a given intersection, there's no possible way to do better than testing the possible branches sequentially (as in DFS) and therefore no way to improve on searching half the entire space.
Look at a very simple maze, you will likely “intuitively” solve it immediately without performing an actual DFS. Implementing that as an actual computer algorithm would be insane since your algorithm would now rely on the computational needs of a human perception system, which decreases algorithmic efficiency by many orders of magnitude. But humans with their weird squishy brains have what they already have, and on the flip side are simply not optimized for algorithms on all but the smallest data structures. (You can very easily read even distorted text, but you have an extremely hard time balancing a simple red-black-tree in your head or even on paper.)
EDIT: Relatedly, humans use heuristics a lot. And there are many NP-hard problems where we can solve lots of “reasonable” points in the problem space in reasonable time (computers or humans alike), at the risk of having to time out, maybe try with another approach, and eventually just give up. Traveling salesmen are actually traveling the country after all. So worst case is not always a good measure for games.