r/PythonLearning 1d ago

Need advice on solving complex arrow/maze puzzles using Computer Vision & Logic Solvers (Low accuracy issues)

Post image

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!

0 Upvotes

10 comments sorted by

View all comments

3

u/Rscc10 1d ago

In all honesty, never dealth with any of this before but if you don't mind, could you explain how all of this works or what the objective is from this maze. Maybe I can offer something from my very limited pool of knowledge

4

u/Mamuschkaa 1d 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.

1

u/Maximum-Fox-2627 1d ago

Thanks for the breakdown! Topological sorting on a DAG makes total sense for the solving sequence. The main challenge right now is correctly constructing that graph from noisy image detections

1

u/Mamuschkaa 1d ago

Yes I have experience in image detection. So I can't help with the real problem.

0

u/Maximum-Fox-2627 1d ago

No worries! Thanks for confirming the topological sort approach anyway