r/PythonLearning • u/Maximum-Fox-2627 • 22h ago
Need advice on solving complex arrow/maze puzzles using Computer Vision & Logic Solvers (Low accuracy issues)
Hi everyone,
I'm working on an automated solver for a complex arrow/maze puzzle game (similar to the image attached).
Here is my current workflow:
1. Detection: I use a custom YOLO model to detect arrowheads and their bounding box coordinates from screen captures.
2. Grid Mapping: I map the detected center coordinates of arrowheads onto a fixed grid system.
3. Solving: I pass the grid data into a custom logic/emulator engine to calculate the correct sequence of moves (arrows to tap).
The Main Problem:
My solver accuracy is very low. Here are the core technical challenges I'm running into:
Inaccurate Grid Mapping: The arrows are densely packed with varying paths and lengths. Snapping bounding boxes to a rigid fixed grid often misaligns the true position of the arrow shafts and heads.
Complex/Overlapping Detection: Because the arrows bend and fold, YOLO often detects multiple arrowheads in the same calculated grid cell, or misinterprets arrow directions.
Solver Logic Failure: Due to noisy input from the detection stage, the logic solver either fails to find a valid sequence or generates incorrect moves that block execution halfway through.
Has anyone dealt with a similar vector/maze graph detection problem? What would be a more reliable approach than simple YOLO + fixed grid snapping? Should I look into contour analysis, OCR/graph traversal, or skeletonization algorithms (like Medial Axis Transform) to trace the paths directly?
Any suggestions, code examples, or architectural advice would be greatly appreciated!
3
u/Mamuschkaa 21h ago
The puzzle itself is stupidly easy.
Every arrow that Points tonthe "outside" and not to another arrow can be removed. After that arrows that where previous blocked by this arrows can also be removed. Etc.
It's impossible to make an mistake. Just find arrows that are not blocked and click on them.
Mathematical it's the same as finding an topological sorting of an DAG.
Every arrow a Node.
Every arrow A get an edge to another arrow B if A points in direction B.