Improvement of performance for a maze solving program in Python
Improvement of performance for a maze solving program in Python fellow programmers. I need help with one of my projects. I'm making a maze solving program. It reads an image file, which has to be black and white (black pixels are walls, white pixels are paths), have only one pixel at the top which is the entrance to the maze, and only one white pixel at the bottom which is the exit. There're three main parts to the code: 1) The program first create nodes in the maze, respecting a set of rules. For exemple here's a simple maze: and here're all the nodes drawn in red: The nodes are like the corners, the crossroads, every point where you can change direction. The distance between each node and the exit of the maze is also measured. While it's generating all the nodes, it places them in a list. 2) As soon as all the nodes are generated, the program will iterate through all the nodes in the list, and try to search in every direction possible for other nodes, to "lin...