I'm currently working on a Taiji-esque puzzle map and have been struggling to find an algorithmic way of checking if a given arrangement of blocks follows a determined path.
These two images show a standard puzzle for the symbol as well as how the puzzles themselves are translated into a state more readable by commands (so tests can generally be done with
/execute if blocks...
instead of having to test the entity data of each individual item frame)
These images show a more open puzzle to show why an algorithmic approach is necessary to avoid having to test hundreds of possible solutions which could all follow the correct path (there are only two specific correct answers here because of another rule but it's just to show how there could be many possible solutions to some puzzles).
I don't care about the lengths of each segment (as shown in the second set of pictures), just where it branches off or turns and that each branch splits off and ends at the correct relative height compared to the other branches (like how both examples have branch A end lower than branch B, and example 1 has branch B split off from branch A while example 2 has branch A split off from branch B).
This image shows my current method of determining the area of a section containing the symbol by comparing each block in the grid to the symbol and placing a redstone wire on the corresponding block of a flat reference model if they're the same, then powering the block containing the symbol so that command blocks can be run underneath the grid to determine the conditions of the section; however, I currently can't think of a way of encoding the actual path requirements into this reference model.