To handle the connection between nodes i have thought about using a matrix
so a an extreme easy maze like this
|01234
0:|#####|
1:|## ##|
2:|# #|
3:|## ##|
4:|#####|
looks this way
nodes, and their relations, considering 1 step of movement (up, down, left, right)
id0, (2, 1)
id1, (1, 2)
id2, (2, 2)
id3, (3, 2)
id4, (2, 3)
id0->id2 ( 2, 1)->( 2, 2) down
id1->id2 ( 1, 2)->( 2, 2) right
id2->id0 ( 2, 2)->( 2, 1) up
id2->id1 ( 2, 2)->( 1, 2) left
id2->id3 ( 2, 2)->( 3, 2) right
id2->id4 ( 2, 2)->( 2, 3) down
id3->id2 ( 3, 2)->( 2, 2) left
id4->id2 ( 2, 3)->( 2, 2) up
movement matrix
|01234
0|..D..
1|..R..
2|UL.RD
3|..L..
4|..U..
It appears to me that this information grows up too much